From patchwork Mon Jun 8 20:56:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6568141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 854849F1C1 for ; Mon, 8 Jun 2015 21:09:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EB4720461 for ; Mon, 8 Jun 2015 21:09:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4377B2045B for ; Mon, 8 Jun 2015 21:09:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z24Ew-0000ja-GF; Mon, 08 Jun 2015 21:05:50 +0000 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z247N-0000oJ-V7 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jun 2015 20:58:03 +0000 Received: by labko7 with SMTP id ko7so105949891lab.2 for ; Mon, 08 Jun 2015 13:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N9tDRtDdSYD+tH6GyKRnxZkheOLzNH4aAqRqqBiGVmQ=; b=D9gujExScP2RnDWXESZ8NHSf11BfNtpxkUQe27LRgQEiJsP3AbICJv+wuDQFAXZAJA 3qCEFgbsLSfllm956zRAHmIpycI+874DhpzNHAYh9v+hD6CJAmm9lqUdSHmZ1T4nKmnX IzKgIy6jDGcLyGqmZOSrWjQGY8kgwSaOJaqCCM1mkMsITdksYbf4yJzIlQeApsUtWkNa wlig/ruVE7Ct+chei9PCBhUPd2eNmWGd6HMFPvbnBq3V2k0nNaRHbxCczj+RW890T4vW A8ZoTFL8z7pqPVlnlD1oPW5hM4S9CjLXaXaLVtRNljnbcnXRcUho5A7vMH0DekGYEVz8 b/FA== X-Received: by 10.152.25.227 with SMTP id f3mr18694576lag.67.1433797059471; Mon, 08 Jun 2015 13:57:39 -0700 (PDT) Received: from anuminas.rup.mentorg.com (ppp89-110-20-81.pppoe.avangarddsl.ru. [89.110.20.81]) by mx.google.com with ESMTPSA id s8sm892556las.29.2015.06.08.13.57.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jun 2015 13:57:37 -0700 (PDT) From: Dmitry Eremin-Solenikov To: Russell King , Lee Jones Subject: [PATCH v5 14/17] ARM: pxa: poodle: use new LoCoMo driver Date: Mon, 8 Jun 2015 23:56:45 +0300 Message-Id: <1433797008-6246-15-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433797008-6246-1-git-send-email-dbaryshkov@gmail.com> References: <1433797008-6246-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150608_135802_275467_F448C5DC X-CRM114-Status: GOOD ( 15.58 ) X-Spam-Score: -0.8 (/) Cc: Andrea Adami , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert poodle to use new mfd-based LoCoMo driver. Signed-off-by: Dmitry Eremin-Solenikov Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik --- arch/arm/mach-pxa/Kconfig | 1 - arch/arm/mach-pxa/include/mach/poodle.h | 6 ---- arch/arm/mach-pxa/poodle.c | 58 ++++++++++++++++++++++++++++++--- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 8896e71..a2756b0 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -481,7 +481,6 @@ config MACH_POODLE bool "Enable Sharp SL-5600 (Poodle) Support" depends on PXA_SHARPSL select PXA25x - select SHARP_LOCOMO config MACH_CORGI bool "Enable Sharp SL-C700 (Corgi) Support" diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h index b56b193..5905cf1 100644 --- a/arch/arm/mach-pxa/include/mach/poodle.h +++ b/arch/arm/mach-pxa/include/mach/poodle.h @@ -81,12 +81,6 @@ #define POODLE_GPIO_L_LCLK (POODLE_SCOOP_GPIO_BASE + 10) #define POODLE_GPIO_HS_OUT (POODLE_SCOOP_GPIO_BASE + 11) -#define POODLE_LOCOMO_GPIO_AMP_ON LOCOMO_GPIO(8) -#define POODLE_LOCOMO_GPIO_MUTE_L LOCOMO_GPIO(10) -#define POODLE_LOCOMO_GPIO_MUTE_R LOCOMO_GPIO(11) -#define POODLE_LOCOMO_GPIO_232VCC_ON LOCOMO_GPIO(12) -#define POODLE_LOCOMO_GPIO_JK_B LOCOMO_GPIO(13) - #define POODLE_NR_IRQS (IRQ_BOARD_START + 4) /* 4 for LoCoMo */ extern struct platform_device poodle_locomo_device; diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 195b112..0236ee8 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -49,7 +52,6 @@ #include #include -#include #include #include "generic.h" @@ -179,7 +181,8 @@ static struct resource locomo_resources[] = { }; static struct locomo_platform_data locomo_info = { - .irq_base = IRQ_BOARD_START, + .gpio_base = -1, + .comadj = 118, }; struct platform_device poodle_locomo_device = { @@ -192,8 +195,6 @@ struct platform_device poodle_locomo_device = { }, }; -EXPORT_SYMBOL(poodle_locomo_device); - #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) static struct pxa2xx_spi_master poodle_spi_info = { .num_chipselect = 1, @@ -424,6 +425,47 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = { { I2C_BOARD_INFO("wm8731", 0x1b) }, }; +static struct iio_map locomo_iio_map[] = { + { + .consumer_dev_name = "locomo-lcd.0", + .consumer_channel = "comadj", + .adc_channel_label = "CH0", + }, + { } +}; + +static struct i2c_board_info locomo_i2c_devs[] __initdata = { + { + I2C_BOARD_INFO("m62332", 0x4e), + .platform_data = locomo_iio_map, + }, +}; + +static struct gpiod_lookup_table poodle_audio_gpios_table = { + .dev_id = "poodle-audio", + .table = { + GPIO_LOOKUP("locomo-gpio", 10, "mute-l", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("locomo-gpio", 11, "mute-r", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("locomo-gpio", 8, "amp-on", GPIO_ACTIVE_LOW), + { }, + }, +}, poodle_bl_gpios_table = { + .dev_id = "locomo-backlight.0", + .table = { + GPIO_LOOKUP("locomo-gpio", 9, "flvr", GPIO_ACTIVE_HIGH), + { }, + }, +}, poodle_lcd_gpios_table = { + .dev_id = "locomo-lcd.0", + .table = { + GPIO_LOOKUP("locomo-gpio", 4, "VSHA", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("locomo-gpio", 5, "VSHD", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("locomo-gpio", 6, "Vee", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("locomo-gpio", 7, "MOD", GPIO_ACTIVE_HIGH), + { }, + }, +}; + static void poodle_poweroff(void) { pxa_restart(REBOOT_HARD, NULL); @@ -445,6 +487,13 @@ static void __init poodle_init(void) platform_scoop_config = &poodle_pcmcia_config; + if (sharpsl_param.comadj != -1) + locomo_info.comadj = sharpsl_param.comadj; + + gpiod_add_lookup_table(&poodle_audio_gpios_table); + gpiod_add_lookup_table(&poodle_bl_gpios_table); + gpiod_add_lookup_table(&poodle_lcd_gpios_table); + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret) pr_warn("poodle: Unable to register LoCoMo device\n"); @@ -455,6 +504,7 @@ static void __init poodle_init(void) pxa_set_ficp_info(&poodle_ficp_platform_data); pxa_set_i2c_info(NULL); i2c_register_board_info(0, ARRAY_AND_SIZE(poodle_i2c_devices)); + i2c_register_board_info(1, ARRAY_AND_SIZE(locomo_i2c_devs)); poodle_init_spi(); regulator_has_full_constraints(); }