aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorKalle Jokiniemi <kalle.jokiniemi@nokia.com>2011-03-29 09:28:00 -0400
committerAnton Vorontsov <cbouatmailru@gmail.com>2011-04-20 09:48:50 -0400
commit10299e2e4e3ed3b16503d4e04edd48b33083f4e2 (patch)
tree51b90686a4e174fe97bc26bdd0346b5087c15e55 /arch/arm
parent2785cefc98051646bd1d36a627822a3f43736697 (diff)
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>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index bbcb6775a6a3..fad98abd4844 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -23,6 +23,7 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/power/isp1704_charger.h>
26 27
27#include <plat/mcspi.h> 28#include <plat/mcspi.h>
28#include <plat/board.h> 29#include <plat/board.h>
@@ -52,6 +53,8 @@
52#define RX51_FMTX_RESET_GPIO 163 53#define RX51_FMTX_RESET_GPIO 163
53#define RX51_FMTX_IRQ 53 54#define RX51_FMTX_IRQ 53
54 55
56#define RX51_USB_TRANSCEIVER_RST_GPIO 67
57
55/* list all spi devices here */ 58/* list all spi devices here */
56enum { 59enum {
57 RX51_SPI_WL1251, 60 RX51_SPI_WL1251,
@@ -110,10 +113,30 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
110 }, 113 },
111}; 114};
112 115
116static void rx51_charger_set_power(bool on)
117{
118 gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
119}
120
121static struct isp1704_charger_data rx51_charger_data = {
122 .set_power = rx51_charger_set_power,
123};
124
113static struct platform_device rx51_charger_device = { 125static struct platform_device rx51_charger_device = {
114 .name = "isp1704_charger", 126 .name = "isp1704_charger",
127 .dev = {
128 .platform_data = &rx51_charger_data,
129 },
115}; 130};
116 131
132static 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
117#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 140#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
118 141
119#define RX51_GPIO_CAMERA_LENS_COVER 110 142#define RX51_GPIO_CAMERA_LENS_COVER 110
@@ -981,6 +1004,6 @@ void __init rx51_peripherals_init(void)
981 if (partition) 1004 if (partition)
982 omap2_hsmmc_init(mmc); 1005 omap2_hsmmc_init(mmc);
983 1006
984 platform_device_register(&rx51_charger_device); 1007 rx51_charger_init();
985} 1008}
986 1009