From patchwork Mon Apr 27 23:55:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6284631 Return-Path: X-Original-To: patchwork-linux-fbdev@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 C00A99F3D1 for ; Mon, 27 Apr 2015 23:57:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6CEE20304 for ; Mon, 27 Apr 2015 23:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75DDD20384 for ; Mon, 27 Apr 2015 23:57:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933113AbbD0X5z (ORCPT ); Mon, 27 Apr 2015 19:57:55 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:34518 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932194AbbD0X5x (ORCPT ); Mon, 27 Apr 2015 19:57:53 -0400 Received: by pdbqa5 with SMTP id qa5so144747627pdb.1; Mon, 27 Apr 2015 16:57:52 -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=oewa/JWGlZLUih6RhITPOuo0OlNT9xovsx3OeOzxoD0=; b=Bkixd6LcNV0aJ5stZD+6rcz5KJf6QPlcvtDhBxxFmUDnGcsNzkNQcSy0LZ7oXWcNJs 9/zs7ZHYhu7hdTVM35cNFr8VNoiAj7AS0PmVeE2yPSq5A4V0vVkUJcmo09JU4RJlGVym GHTmEccehMlsW20tHpTHB7Dn68Sg7NCQBPY1vivMA2ZZuldBxLHgQLn63olcTmcHSz71 ALCDD0oMfPzTisLCvhFcppgtSnpqsOGlV03cmEV9g0FQeqDXhyffW4+vq8XNp+ifmyVp HVLVQCRR4DaeJC7EPTaJ3I2TE9gINd97EtFO3ET+Gzubw3IyDqF06JN287UTu8zouUq7 DTqQ== X-Received: by 10.68.191.101 with SMTP id gx5mr26900655pbc.148.1430179072666; Mon, 27 Apr 2015 16:57:52 -0700 (PDT) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id pv2sm20428375pbb.12.2015.04.27.16.57.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Apr 2015 16:57:52 -0700 (PDT) From: Dmitry Eremin-Solenikov To: Russell King , Daniel Mack , Robert Jarzmik , Linus Walleij , Alexandre Courbot , Wolfram Sang , Dmitry Torokhov , Bryan Wu , Richard Purdie , Samuel Ortiz , Lee Jones , Mark Brown , Jingoo Han , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Liam Girdwood , Andrea Adami Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH v2 14/17] ARM: pxa: poodle: use new LoCoMo driver Date: Tue, 28 Apr 2015 02:55:51 +0300 Message-Id: <1430178954-11138-15-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com> References: <1430178954-11138-1-git-send-email-dbaryshkov@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 --- arch/arm/mach-pxa/Kconfig | 1 - arch/arm/mach-pxa/include/mach/poodle.h | 16 ++++++--- arch/arm/mach-pxa/poodle.c | 58 ++++++++++++++++++++++++++++++--- 3 files changed, 65 insertions(+), 10 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..dd4afae 100644 --- a/arch/arm/mach-pxa/include/mach/poodle.h +++ b/arch/arm/mach-pxa/include/mach/poodle.h @@ -81,11 +81,17 @@ #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_LOCOMO_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12) +#define POODLE_GPIO_LCD_VSHA_ON (POODLE_LOCOMO_GPIO_BASE + 4) +#define POODLE_GPIO_LCD_VSHD_ON (POODLE_LOCOMO_GPIO_BASE + 5) +#define POODLE_GPIO_LCD_VEE_ON (POODLE_LOCOMO_GPIO_BASE + 6) +#define POODLE_GPIO_LCD_MOD (POODLE_LOCOMO_GPIO_BASE + 7) +#define POODLE_GPIO_AMP_ON (POODLE_LOCOMO_GPIO_BASE + 8) +#define POODLE_GPIO_FL_VR (POODLE_LOCOMO_GPIO_BASE + 9) +#define POODLE_GPIO_MUTE_L (POODLE_LOCOMO_GPIO_BASE + 10) +#define POODLE_GPIO_MUTE_R (POODLE_LOCOMO_GPIO_BASE + 11) +#define POODLE_GPIO_232VCC_ON (POODLE_LOCOMO_GPIO_BASE + 12) +#define POODLE_GPIO_JK_B (POODLE_LOCOMO_GPIO_BASE + 13) #define POODLE_NR_IRQS (IRQ_BOARD_START + 4) /* 4 for LoCoMo */ diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 195b112..a61e4b8 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 = POODLE_LOCOMO_GPIO_BASE, + .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(); }