Skip to content

Commit 10299e2

Browse files
Kalle Jokiniemienomsg
authored andcommitted
ARM: RX-51: Enable isp1704 power on/off
The isp1704 usb tranceiver is used for charging and can be disabled when not in use. Provide the powering routine to the driver via platform data. Also changed the indent of ".name" variable in rx51_charger_device definition to use tabs same way as the new ".dev" variable indent. Put this in the same patch since the indent fix is only needed when there are multiple members in the struct definition. Loosely based on earlier patches from Heikki Krogerus in Nokia N900 maemo kernel. Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com> Acked-By: Heikki Krogerus <heikki.krogerus@nokia.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
1 parent 2785cef commit 10299e2

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎arch/arm/mach-omap2/board-rx51-peripherals.c‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/gpio.h>
2424
#include <linux/gpio_keys.h>
2525
#include <linux/mmc/host.h>
26+
#include <linux/power/isp1704_charger.h>
2627

2728
#include <plat/mcspi.h>
2829
#include <plat/board.h>
@@ -52,6 +53,8 @@
5253
#define RX51_FMTX_RESET_GPIO 163
5354
#define RX51_FMTX_IRQ 53
5455

56+
#define RX51_USB_TRANSCEIVER_RST_GPIO 67
57+
5558
/* list all spi devices here */
5659
enum {
5760
RX51_SPI_WL1251,
@@ -110,10 +113,30 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
110113
},
111114
};
112115

116+
static void rx51_charger_set_power(bool on)
117+
{
118+
gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
119+
}
120+
121+
static struct isp1704_charger_data rx51_charger_data = {
122+
.set_power = rx51_charger_set_power,
123+
};
124+
113125
static struct platform_device rx51_charger_device = {
114-
.name = "isp1704_charger",
126+
.name = "isp1704_charger",
127+
.dev = {
128+
.platform_data = &rx51_charger_data,
129+
},
115130
};
116131

132+
static void __init rx51_charger_init(void)
133+
{
134+
WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
135+
GPIOF_OUT_INIT_LOW, "isp1704_reset"));
136+
137+
platform_device_register(&rx51_charger_device);
138+
}
139+
117140
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
118141

119142
#define RX51_GPIO_CAMERA_LENS_COVER 110
@@ -981,6 +1004,6 @@ void __init rx51_peripherals_init(void)
9811004
if (partition)
9821005
omap2_hsmmc_init(mmc);
9831006

984-
platform_device_register(&rx51_charger_device);
1007+
rx51_charger_init();
9851008
}
9861009

0 commit comments

Comments
 (0)