From patchwork Mon Apr 15 19:25:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10901459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1AF514DB for ; Mon, 15 Apr 2019 19:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89BBB286DD for ; Mon, 15 Apr 2019 19:28:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DA4728720; Mon, 15 Apr 2019 19:28:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D73E286DD for ; Mon, 15 Apr 2019 19:28:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729556AbfDOT2n (ORCPT ); Mon, 15 Apr 2019 15:28:43 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:45297 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729063AbfDOT2m (ORCPT ); Mon, 15 Apr 2019 15:28:42 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MhDEq-1gcueH0N0s-00eLtE; Mon, 15 Apr 2019 21:28:35 +0200 From: Arnd Bergmann To: Hartley Sweeten , Alexander Sverdlin Cc: Linus Walleij , Arnd Bergmann , Dmitry Torokhov , Stefan Agner , Enric Balletbo i Serra , Guenter Roeck , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ARM: ep93xx: keypad: stop using mach/platform.h Date: Mon, 15 Apr 2019 21:25:24 +0200 Message-Id: <20190415192734.935387-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190415192734.935387-1-arnd@arndb.de> References: <20190415192734.935387-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Dz9JsujkkUgk8Frvv9ud7TM/8N/2eXNKu9k/iheacQOv6Lia4mu Fhs4U0hadKRMyQ3rmWoXQy/8RCMxp+AawzJ6kyQQPfFJCU6LtCcrtBCaj6P8W5Md4RP2qGd JoP6V1JHr4wOsQjFDtEBcFCtM9WHVqyUXKefQeWIsKjrpAtS5y32oay1hWAwS3HB+R3uGf6 O9Dv2XjPEZjo08N3aLDsQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:oX+RErlzxHA=:bofT5AK8lN0WLeiMfzF+Td +p1V42yb+a4im/yfKUfui6LNgsAYR4hlTsva/ZIPGQ6pLgGsEh17rT3XvPSKeXMh5pCEiINoA ogMvXqWbe4HpfDCnJriFsCTJ4us1LM/Nu4mjIJ5pAeGKe8p83Jh4j15Zn7UJulPCnLqwffifF OCDEIB22roZhBSu8w/Tqr6e3Q/NdsqSKlcshOlHE4bSkYMPnQB8i7ka/xhoQoqPdYiDyEjXis 8QI1eOuqnfhTp9T/tgdJZ+lEvzBKQv8G/tnaIRjnpl1+zrbHI3H1c91w6xrWo4wVypVwV7Mn3 AKBQg3+m8JSWlKMmTtIhL2NHQoD4xlDmpcrhXrOAAHwT/tSibIuXo0hRmyUkTn+15d3t7AuXn RmutzCfpdJmAT1gyB8QuV7y9Orcil5bioRFZ6qQccvBBbhfEahXh6EiXhzDCi4K0Jbg7R0IdO myv6IQsfZgRSrcAIifIwRXhEf83YTxVqeldpIkef0c5PrI8fwwAsQjbQ7/9gcUxYIFrfERGrP Z0n3Sj7ZwMv0TkPVkcUakJA8xPFqkeueCp0fi3MNQCiiX3l3aA12BoudNUjIDF0BPLlB6QOqf XnOP2bSUaET4rrdJ55uccAoADnHfLzqJ4cQQvW++7sY61IS5QxP3dyUHG+fDAZVEr9oDHCI5h 9TczqdpR1oCjqW5+tDbMMJuPL7ZhgVSvWkFDRjZ+B/g+7YflA2ZbPMY29oCfa+h+VZxjDewwz otSmwr0mb6oMfCwUqHmnNg4wPGb3rdI0+IBqlg== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We can communicate the clock rate using platform data rather than setting a flag to use a particular value in the driver, which is cleaner and avoids the dependency. No platform in the kernel currently defines the ep93xx keypad device structure, so this is a rather pointless excercise. Any out of tree users are probably dead now, but if not, they have to change their platform code to match the new platform_data structure. Signed-off-by: Arnd Bergmann Acked-by: H Hartley Sweeten Acked-by: Dmitry Torokhov --- drivers/input/keyboard/Kconfig | 2 +- drivers/input/keyboard/ep93xx_keypad.c | 5 +---- include/linux/platform_data/keypad-ep93xx.h | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index a878351f1643..b373f3274542 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -194,7 +194,7 @@ config KEYBOARD_LKKBD config KEYBOARD_EP93XX tristate "EP93xx Matrix Keypad support" - depends on ARCH_EP93XX + depends on ARCH_EP93XX || COMPILE_TEST select INPUT_MATRIXKMAP help Say Y here to enable the matrix keypad on the Cirrus EP93XX. diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index f77b295e0123..71472f6257c0 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -137,10 +137,7 @@ static void ep93xx_keypad_config(struct ep93xx_keypad *keypad) struct ep93xx_keypad_platform_data *pdata = keypad->pdata; unsigned int val = 0; - if (pdata->flags & EP93XX_KEYPAD_KDIV) - clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV4); - else - clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV16); + clk_set_rate(keypad->clk, pdata->clk_rate); if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY) val |= KEY_INIT_DIS3KY; diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h index 0e36818e3680..3054fced8509 100644 --- a/include/linux/platform_data/keypad-ep93xx.h +++ b/include/linux/platform_data/keypad-ep93xx.h @@ -9,8 +9,7 @@ struct matrix_keymap_data; #define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */ #define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */ #define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */ -#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */ -#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */ +#define EP93XX_KEYPAD_AUTOREPEAT (1<<4) /* enable key autorepeat */ /** * struct ep93xx_keypad_platform_data - platform specific device structure @@ -24,6 +23,7 @@ struct ep93xx_keypad_platform_data { unsigned int debounce; unsigned int prescale; unsigned int flags; + unsigned int clk_rate; }; #define EP93XX_MATRIX_ROWS (8) From patchwork Mon Apr 15 19:25:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10901465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C97671515 for ; Mon, 15 Apr 2019 19:30:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B189728622 for ; Mon, 15 Apr 2019 19:30:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A493F28644; Mon, 15 Apr 2019 19:30:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE24628622 for ; Mon, 15 Apr 2019 19:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728420AbfDOTaG (ORCPT ); Mon, 15 Apr 2019 15:30:06 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51347 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbfDOTaF (ORCPT ); Mon, 15 Apr 2019 15:30:05 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MRCFu-1hS8PU2ZvA-00NEDC; Mon, 15 Apr 2019 21:29:44 +0200 From: Arnd Bergmann To: Hartley Sweeten , Alexander Sverdlin Cc: Linus Walleij , Arnd Bergmann , Bartlomiej Zolnierkiewicz , Jens Axboe , Dmitry Torokhov , Thierry Reding , Mark Brown , Olof Johansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/4] ARM: ep93xx: move pinctrl interfaces into include/linux/soc Date: Mon, 15 Apr 2019 21:25:25 +0200 Message-Id: <20190415192734.935387-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190415192734.935387-1-arnd@arndb.de> References: <20190415192734.935387-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:dRvk3DqNUanFdB12QVLmdoW3VNVR+CJbLIKq3bNIeNaHjokfuCj P0OnfDT+EC2RLgx1gqyx/4vdGjEF9QjjEWwWeqNMk2DrquyzOKk9p8aYbj9eB6/KD703oYx cZN0IVmsn4HczRs+Mli1CHmCjgdbjygnc+YuVg0AxOTZTwOOh/5W/pJy92KqawV0TvaZz5i BTfYPTKfgG7ZugvwFyc2g== X-UI-Out-Filterresults: notjunk:1;V03:K0:aex9IFYN86E=:4XPEDTHn5/TAWcAS8M7/Y6 bTAbFK67uqiywdTFUlUuBJ+WHDSe0i7jpJH/VdT9WQ0E3+MIjxxVv8dFE44ehx0pV0YjmnxvQ tJeqRdKWHnBnTprSU2aus3R9IOpHWzuCmqPIxTqsSTGLw1decCmCZ0/kCKj6Mk4bKdXygzq5g PXW4yB97Aduwt/3PpZqyHwXAkp25MBp3fvH8uafNSyPb4U1+KxpZObqRp3rlfnmMbDPza/r21 q/EaI7mGBw28PG81tNlUPm6U+Q1XNw+UJpxRSKEN2qAH0IF0iJQfvickHZC2wHMJE/8YYPJ+a skPo27o969GhBejMAEqpaIMeVSQosxB32Mt/EbiwMUUQ2HsfndVxYL86WN9MOKpXpPJPdoOE2 yxjtMhIJkBAY2t5D3EZBKTae7iZqW5A8na+mpFRSZDScpOJwWe4VCzQXwPb3ggmeTAzM8N7pN 2akzkAEuFp2RfshfcGfaQquHOf5N16ojZAn960hFgelujlu5MJDTPfatv14Aj24veFb2snlIX R2Nq0Vn9ga/rYmbypPd4DEJu8GfLgimx71Nr84Wabz3ViGiYnkFGNIW6bufP72qb6cXNB5tWF nWXFptET6YVuZgIH/z/Ww/yZxKM8dHBauseOWakNcEYmJK9IMfo/FW7oXn+HUNFPQQNMylWwX uDxUHZ2+dz+0ffFLW7E6bJzGgoCXPo5dx1du4uz0Qq4gZij8RfAM7gPAin5QTMdB/sBbqt5H2 zbkwFqdVRuwpSrd/d1WJWVqtLVdq2ncOAfc7Ag== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ep93xx does not have a proper pinctrl driver, but does things ad-hoc through mach/platform.h, which is also used for setting up the boards. To avoid using mach/*.h headers completely, let's move the interfaces into include/linux/soc/. This is far from great, but gets the job done here, without the need for a proper pinctrl driver. Signed-off-by: Arnd Bergmann Acked-by: Alexander Sverdlin Acked-by: Linus Walleij --- arch/arm/mach-ep93xx/clock.c | 1 + arch/arm/mach-ep93xx/core.c | 2 ++ arch/arm/mach-ep93xx/include/mach/platform.h | 16 --------- drivers/ata/pata_ep93xx.c | 2 +- drivers/input/keyboard/ep93xx_keypad.c | 3 +- drivers/pwm/pwm-ep93xx.c | 2 +- include/linux/soc/cirrus/ep93xx.h | 37 ++++++++++++++++++++ sound/soc/cirrus/edb93xx.c | 2 +- sound/soc/cirrus/ep93xx-ac97.c | 1 + sound/soc/cirrus/ep93xx-i2s.c | 3 +- sound/soc/cirrus/simone.c | 2 +- sound/soc/cirrus/snappercl15.c | 2 +- 12 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 include/linux/soc/cirrus/ep93xx.h diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index d2eee707d27f..9f43362eb62d 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c @@ -20,6 +20,7 @@ #include #include #include +#include #include diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 706515faee06..3d245668846d 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -43,6 +43,8 @@ #include #include #include +#include + #include #include diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 43446f33c2be..b4045a186239 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h @@ -19,14 +19,6 @@ struct ep93xx_spi_info; void ep93xx_map_io(void); void ep93xx_init_irq(void); -#define EP93XX_CHIP_REV_D0 3 -#define EP93XX_CHIP_REV_D1 4 -#define EP93XX_CHIP_REV_E0 5 -#define EP93XX_CHIP_REV_E1 6 -#define EP93XX_CHIP_REV_E2 7 - -unsigned int ep93xx_chip_revision(void); - void ep93xx_register_flash(unsigned int width, resource_size_t start, resource_size_t size); @@ -36,19 +28,11 @@ void ep93xx_register_spi(struct ep93xx_spi_info *info, struct spi_board_info *devices, int num); void ep93xx_register_fb(struct ep93xxfb_mach_info *data); void ep93xx_register_pwm(int pwm0, int pwm1); -int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); -void ep93xx_pwm_release_gpio(struct platform_device *pdev); void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data); -int ep93xx_keypad_acquire_gpio(struct platform_device *pdev); -void ep93xx_keypad_release_gpio(struct platform_device *pdev); void ep93xx_register_i2s(void); -int ep93xx_i2s_acquire(void); -void ep93xx_i2s_release(void); void ep93xx_register_ac97(void); void ep93xx_register_ide(void); void ep93xx_register_adc(void); -int ep93xx_ide_acquire_gpio(struct platform_device *pdev); -void ep93xx_ide_release_gpio(struct platform_device *pdev); struct device *ep93xx_init_devices(void); extern void ep93xx_timer_init(void); diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index cc6d06c1b2c7..db271b705529 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c @@ -44,7 +44,7 @@ #include #include -#include +#include #define DRV_NAME "ep93xx-ide" #define DRV_VERSION "1.0" diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 71472f6257c0..575dac52f7b4 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -27,8 +27,7 @@ #include #include #include - -#include +#include #include /* diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c index bbf10ae02f0e..fa168581e6b8 100644 --- a/drivers/pwm/pwm-ep93xx.c +++ b/drivers/pwm/pwm-ep93xx.c @@ -35,7 +35,7 @@ #include -#include /* for ep93xx_pwm_{acquire,release}_gpio() */ +#include /* for ep93xx_pwm_{acquire,release}_gpio() */ #define EP93XX_PWMx_TERM_COUNT 0x00 #define EP93XX_PWMx_DUTY_CYCLE 0x04 diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/ep93xx.h new file mode 100644 index 000000000000..56fbe2dc59b1 --- /dev/null +++ b/include/linux/soc/cirrus/ep93xx.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _SOC_EP93XX_H +#define _SOC_EP93XX_H + +struct platform_device; + +#define EP93XX_CHIP_REV_D0 3 +#define EP93XX_CHIP_REV_D1 4 +#define EP93XX_CHIP_REV_E0 5 +#define EP93XX_CHIP_REV_E1 6 +#define EP93XX_CHIP_REV_E2 7 + +#ifdef CONFIG_ARCH_EP93XX +int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); +void ep93xx_pwm_release_gpio(struct platform_device *pdev); +int ep93xx_ide_acquire_gpio(struct platform_device *pdev); +void ep93xx_ide_release_gpio(struct platform_device *pdev); +int ep93xx_keypad_acquire_gpio(struct platform_device *pdev); +void ep93xx_keypad_release_gpio(struct platform_device *pdev); +int ep93xx_i2s_acquire(void); +void ep93xx_i2s_release(void); +unsigned int ep93xx_chip_revision(void); + +#else +static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; } +static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {} +static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; } +static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {} +static inline int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; } +static inline void ep93xx_keypad_release_gpio(struct platform_device *pdev) {} +static inline int ep93xx_i2s_acquire(void) { return 0; } +static inline void ep93xx_i2s_release(void) {} +static inline unsigned int ep93xx_chip_revision(void) { return 0; } + +#endif + +#endif diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c index 3d011abaa266..f678b4c1514a 100644 --- a/sound/soc/cirrus/edb93xx.c +++ b/sound/soc/cirrus/edb93xx.c @@ -22,11 +22,11 @@ #include #include #include +#include #include #include #include #include -#include static int edb93xx_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index cd5a939ad608..c6bc447429af 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -24,6 +24,7 @@ #include #include +#include #include "ep93xx-pcm.h" diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 0918c5da575a..beab7c516855 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -27,9 +27,8 @@ #include #include -#include -#include #include +#include #include "ep93xx-pcm.h" diff --git a/sound/soc/cirrus/simone.c b/sound/soc/cirrus/simone.c index 1ec661834e5a..cb850530331b 100644 --- a/sound/soc/cirrus/simone.c +++ b/sound/soc/cirrus/simone.c @@ -13,13 +13,13 @@ #include #include #include +#include #include #include #include #include -#include static struct snd_soc_dai_link simone_dai = { .name = "AC97", diff --git a/sound/soc/cirrus/snappercl15.c b/sound/soc/cirrus/snappercl15.c index 11ff7b2672b2..dea4909154c8 100644 --- a/sound/soc/cirrus/snappercl15.c +++ b/sound/soc/cirrus/snappercl15.c @@ -13,12 +13,12 @@ #include #include +#include #include #include #include #include -#include #include "../codecs/tlv320aic23.h"