All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Jokiniemi <kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org
Cc: heikki.krogerus-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org,
	jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	khilman-l0cyMroinI0@public.gmane.org,
	Kalle Jokiniemi
	<kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 2/2] RX-51: Enable isp1704 power on/off
Date: Mon, 28 Mar 2011 09:51:39 +0300	[thread overview]
Message-ID: <1301295099-22066-3-git-send-email-kalle.jokiniemi@nokia.com> (raw)
In-Reply-To: <1301295099-22066-1-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>

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.

Loosely based on earlier patches from Heikki Krogerus in
Nokia N900 maemo kernel.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Cc: Heikki Krogerus <heikki.krogerus-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   27 ++++++++++++++++++++++++-
 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 e75e240..8584dd8 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>
@@ -48,6 +49,8 @@
 #define RX51_WL1251_POWER_GPIO		87
 #define RX51_WL1251_IRQ_GPIO		42
 
+#define RX51_USB_TRANSCEIVER_RST_GPIO	67
+
 /* list all spi devices here */
 enum {
 	RX51_SPI_WL1251,
@@ -106,10 +109,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)
+{
+	BUG_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
@@ -928,6 +951,6 @@ void __init rx51_peripherals_init(void)
 	if (partition)
 		omap2_hsmmc_init(mmc);
 
-	platform_device_register(&rx51_charger_device);
+	rx51_charger_init();
 }
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-03-28  6:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  6:51 [PATCH v2 0/2] isp1704_charger: fix powering for N900 Kalle Jokiniemi
     [not found] ` <1301295099-22066-1-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-28  6:51   ` [PATCH v2 1/2] isp1704_charger: allow board specific powering routine Kalle Jokiniemi
2011-03-28  8:17     ` Sergei Shtylyov
2011-03-28 10:00       ` kalle.jokiniemi
2011-03-29  5:52       ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-30 11:18         ` Sergei Shtylyov
     [not found]     ` <1301295099-22066-2-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-28  9:12       ` Heikki Krogerus
2011-03-28  9:57         ` kalle.jokiniemi
2011-03-28  6:51   ` Kalle Jokiniemi [this message]
     [not found]     ` <1301295099-22066-3-git-send-email-kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-28  7:19       ` [PATCH v2 2/2] RX-51: Enable isp1704 power on/off Keshava Munegowda
     [not found]         ` <17a241ba5fb52c72ed49ad345910065f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-28  8:06           ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-28  8:39             ` Felipe Balbi
     [not found]               ` <20110328083915.GF2251-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-03-28  8:52                 ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-28  8:55                   ` Felipe Balbi
     [not found]                     ` <20110328085525.GK2251-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-03-28  8:57                       ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w
2011-03-28  8:20       ` Sergei Shtylyov
     [not found]         ` <4D9044B2.5020607-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2011-03-28  8:39           ` Felipe Balbi
2011-03-28  9:57           ` kalle.jokiniemi-xNZwKgViW5gAvxtiuMwx3w

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301295099-22066-3-git-send-email-kalle.jokiniemi@nokia.com \
    --to=kalle.jokiniemi-xnzwkgviw5gavxtiumwx3w@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=heikki.krogerus-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
    --cc=jhnikula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=khilman-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.