From patchwork Mon Mar 28 06:33:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kalle.jokiniemi@nokia.com X-Patchwork-Id: 667341 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2S6XtpB022032 for ; Mon, 28 Mar 2011 06:33:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752235Ab1C1Gdv (ORCPT ); Mon, 28 Mar 2011 02:33:51 -0400 Received: from smtp.nokia.com ([147.243.128.26]:30191 "EHLO mgw-da02.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938Ab1C1Gdu (ORCPT ); Mon, 28 Mar 2011 02:33:50 -0400 Received: from nokia.com (localhost [127.0.0.1]) by mgw-da02.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p2S6XlAg032582; Mon, 28 Mar 2011 09:33:47 +0300 Received: from kalle-t43.nmp.nokia.com ([trdhcp213154.nmp.nokia.com [172.22.213.154]]) by mgw-da02.nokia.com with RELAY id p2S6XDpm031948 ; Mon, 28 Mar 2011 09:33:20 +0300 From: Kalle Jokiniemi To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, balbi@ti.com Cc: heikki.krogerus@nokia.com, jhnikula@gmail.com, khilman@ti.com, Kalle Jokiniemi Subject: [PATCH 2/2] RX-51: Enable isp1704 power on/off Date: Mon, 28 Mar 2011 09:33:05 +0300 Message-Id: <1301293985-21687-3-git-send-email-kalle.jokiniemi@nokia.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1301293985-21687-1-git-send-email-kalle.jokiniemi@nokia.com> References: <1301293985-21687-1-git-send-email-kalle.jokiniemi@nokia.com> X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 28 Mar 2011 06:33:55 +0000 (UTC) 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 #include #include +#include #include #include @@ -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(); }