diff mbox

[v3,2/2] RX-51: Enable isp1704 power on/off

Message ID 1301405280-16899-3-git-send-email-kalle.jokiniemi@nokia.com (mailing list archive)
State New, archived
Headers show

Commit Message

kalle.jokiniemi@nokia.com March 29, 2011, 1:28 p.m. UTC
None

Comments

Heikki Krogerus April 13, 2011, 5:10 a.m. UTC | #1
Hi,

On Wed, Mar 30, 2011 at 08:08:54AM +0300, ext Heikki Krogerus wrote:
> On Tue, Mar 29, 2011 at 04:28:00PM +0300, Kalle Jokiniemi wrote:
> > 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>
> > Cc: Heikki Krogerus <heikki.krogerus@nokia.com>
> 
> Acked-By: Heikki Krogerus <heikki.krogerus@nokia.com>

Before Anton takes these, this one needs ack from Tony.
Tony Lindgren April 13, 2011, 6:28 a.m. UTC | #2
* Heikki Krogerus <heikki.krogerus@nokia.com> [110413 08:07]:
> Hi,
> 
> On Wed, Mar 30, 2011 at 08:08:54AM +0300, ext Heikki Krogerus wrote:
> > On Tue, Mar 29, 2011 at 04:28:00PM +0300, Kalle Jokiniemi wrote:
> > > 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>
> > > Cc: Heikki Krogerus <heikki.krogerus@nokia.com>
> > 
> > Acked-By: Heikki Krogerus <heikki.krogerus@nokia.com>
> 
> Before Anton takes these, this one needs ack from Tony.

Looks good to me:

Acked-by: Tony Lindgren <tony@atomide.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index bbcb677..fad98ab 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -23,6 +23,7 @@ 
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/mmc/host.h>
+#include <linux/power/isp1704_charger.h>
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
@@ -52,6 +53,8 @@ 
 #define RX51_FMTX_RESET_GPIO		163
 #define RX51_FMTX_IRQ			53
 
+#define RX51_USB_TRANSCEIVER_RST_GPIO	67
+
 /* list all spi devices here */
 enum {
 	RX51_SPI_WL1251,
@@ -110,10 +113,30 @@  static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
 	},
 };
 
+static void rx51_charger_set_power(bool on)
+{
+	gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
+}
+
+static struct isp1704_charger_data rx51_charger_data = {
+	.set_power	= rx51_charger_set_power,
+};
+
 static struct platform_device rx51_charger_device = {
-	.name = "isp1704_charger",
+	.name	= "isp1704_charger",
+	.dev	= {
+		.platform_data = &rx51_charger_data,
+	},
 };
 
+static void __init rx51_charger_init(void)
+{
+	WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
+		GPIOF_OUT_INIT_LOW, "isp1704_reset"));
+
+	platform_device_register(&rx51_charger_device);
+}
+
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 
 #define RX51_GPIO_CAMERA_LENS_COVER	110
@@ -981,6 +1004,6 @@  void __init rx51_peripherals_init(void)
 	if (partition)
 		omap2_hsmmc_init(mmc);
 
-	platform_device_register(&rx51_charger_device);
+	rx51_charger_init();
 }