From patchwork Wed Nov 25 16:06:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7701081 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 B45319F2EC for ; Wed, 25 Nov 2015 16:13:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA8B620842 for ; Wed, 25 Nov 2015 16:13:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F91B2085E for ; Wed, 25 Nov 2015 16:13:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568AbbKYQM5 (ORCPT ); Wed, 25 Nov 2015 11:12:57 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:65034 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbbKYQHt (ORCPT ); Wed, 25 Nov 2015 11:07:49 -0500 Received: from wuerfel.lan. ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0LrHzA-1aSw0O2xP2-0133OG; Wed, 25 Nov 2015 17:07:08 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , Mark Brown , Vasily Khoruzhick , Charles Keepax , Tomasz Figa , Ben Dooks , linux-samsung-soc@vger.kernel.org, Arnd Bergmann Subject: [PATCH 07/10] ARM: s3c64xx: use new adc/touchscreen driver Date: Wed, 25 Nov 2015 17:06:52 +0100 Message-Id: <1448467615-447097-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1448467615-447097-1-git-send-email-arnd@arndb.de> References: <1448467615-447097-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:rUr+mV2miMzea8uM4/KshSagTAgnj96HzA/8jipGHmPNH9TDZQ9 WvYuGpgObu18M5ZH2UboGhMSJQux1MAxI69zECE/aW0Tlzqzvz5OGQ7D9HRH8+oxSAhjcrS qZR3I5Yd9HrYXD6TVg8UAiXODr3IIXIaIFOLneMRc/0zPFta9L4wczsvyXyu2Twpqhhlv+E 8aiwVeAuMV75mQ1wydFAw== X-UI-Out-Filterresults: notjunk:1; V01:K0:nZsHyjxZILU=:/eAoQkfDIbFStWvTTxk8TN oZRR4TdcskjCl8vlzqFNflTdvgl7Tt21r5ENrJMnVLM0oLf1ExIlUt4xLtMkQ3I0qF0QR11s+ F3kg6U+IOShU9HBE2PYR5UFQaCh8zrN2fRlhK9VaXvz3wJb+oBdOsb+moP3guZ3xC3F+4b7zd WTGpwXeL6hnKlPT1J9yNqcIuS/p5UBbYy0NC3GJ2slfZP99leYcNg480Unk1KcUUy3xwf0qLg mcjpiPI7ASDxd+DTKhmWI4CR5o5VrmOpojq6/eIC8+admTuxZmnroSbEgJg8lm3W8BuSQIpSY o1nhYz7mfjgn70PXHYhiJXjFgqvL/kgAFDvZPDBy7mJpJVhVBpAwF/2SnWN5N9EOPyMYBCvsk 73MqjRLDbzAomcb7kt+Vn+Av74lHGf2yJfGC4shXwufTKH/6J9IPC8UsnvZSVlr20pe3H084e XiQpFE2E/DewLjAnPMzZXXs5cfCjNkvLwRtPCa97X977qXQU3XDeDsztWp55kc2cDjYuvW8U5 ypBD8TrfT0gahQDyMNUB8wYK58ftjXEbEyLpXJRa5L6RhI+KFxds1dEgIZiSHUzT3I9LIL9P+ 3iZkoVO/3DO1mWMQmev5kK4skyszKZNH8/AZ7qkTvFWKt5YYZCM4WCiVrnrTLHTr60V7b2O5d OUce9bLlyJL5rwl3mAJldyg5RE0S9pFwDfsnMqAkO0vxX5YCgwYcXC2IQ16bi8VRsroY= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The old ADC and touchscreen drivers are not compatible with multiplatform support, but we can use the exynos-adc driver as a replacement. This changes the common device creation functions for s3c64xx (but not s3c24xx for now) to use the new driver. To do this, we have to pass the interrupt resources in the opposite order and pass the platform data in the adc device node. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c64xx/mach-mini6410.c | 3 +-- arch/arm/mach-s3c64xx/mach-real6410.c | 3 +-- arch/arm/mach-s3c64xx/mach-smartq.c | 3 +-- arch/arm/mach-s3c64xx/mach-smdk6410.c | 3 +-- arch/arm/plat-samsung/devs.c | 22 +++++----------------- include/linux/platform_data/touchscreen-s3c2410.h | 1 + 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index 3ce5842ed51b..ae999fb3fe6d 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c @@ -234,7 +234,6 @@ static struct platform_device *mini6410_devices[] __initdata = { &s3c_device_fb, &mini6410_lcd_powerdev, &s3c_device_adc, - &s3c_device_ts, }; static void __init mini6410_map_io(void) @@ -333,7 +332,7 @@ static void __init mini6410_machine_init(void) s3c_nand_set_platdata(&mini6410_nand_info); s3c_fb_set_platdata(&mini6410_lcd_pdata[features.lcd_index]); s3c_sdhci1_set_platdata(&mini6410_hsmmc1_pdata); - s3c24xx_ts_set_platdata(NULL); + s3c64xx_ts_set_platdata(NULL); /* configure nCS1 width to 16 bits */ diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index ca6548a1ed3b..4e240ffa7ac7 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c @@ -203,7 +203,6 @@ static struct platform_device *real6410_devices[] __initdata = { &s3c_device_fb, &s3c_device_nand, &s3c_device_adc, - &s3c_device_ts, &s3c_device_ohci, }; @@ -302,7 +301,7 @@ static void __init real6410_machine_init(void) s3c_fb_set_platdata(&real6410_lcd_pdata[features.lcd_index]); s3c_nand_set_platdata(&real6410_nand_info); - s3c24xx_ts_set_platdata(NULL); + s3c64xx_ts_set_platdata(NULL); /* configure nCS1 width to 16 bits */ diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c index 96784e7f894a..936a63fc68d5 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq.c +++ b/arch/arm/mach-s3c64xx/mach-smartq.c @@ -253,7 +253,6 @@ static struct platform_device *smartq_devices[] __initdata = { &s3c_device_ohci, &s3c_device_rtc, &samsung_device_pwm, - &s3c_device_ts, &s3c_device_usb_hsotg, &s3c64xx_device_iis0, &smartq_backlight_device, @@ -400,7 +399,7 @@ void __init smartq_machine_init(void) s3c_hwmon_set_platdata(&smartq_hwmon_pdata); s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata); s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata); - s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata); + s3c64xx_ts_set_platdata(&smartq_touchscreen_pdata); i2c_register_board_info(0, smartq_i2c_devs, ARRAY_SIZE(smartq_i2c_devs)); diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index 34d31bd48954..8a894ee3ee76 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -290,7 +290,6 @@ static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_adc, &s3c_device_cfcon, &s3c_device_rtc, - &s3c_device_ts, &s3c_device_wdt, }; @@ -669,7 +668,7 @@ static void __init smdk6410_machine_init(void) samsung_keypad_set_platdata(&smdk6410_keypad_data); - s3c24xx_ts_set_platdata(NULL); + s3c64xx_ts_set_platdata(NULL); /* configure nCS1 width to 16 bits */ diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index f39938fa9ef6..b53d4ff3befb 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -119,12 +119,12 @@ struct platform_device s3c_device_adc = { #if defined(CONFIG_SAMSUNG_DEV_ADC) static struct resource s3c_adc_resource[] = { [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256), - [1] = DEFINE_RES_IRQ(IRQ_TC), - [2] = DEFINE_RES_IRQ(IRQ_ADC), + [1] = DEFINE_RES_IRQ(IRQ_ADC), + [2] = DEFINE_RES_IRQ(IRQ_TC), }; struct platform_device s3c_device_adc = { - .name = "samsung-adc", + .name = "exynos-adc", .id = -1, .num_resources = ARRAY_SIZE(s3c_adc_resource), .resource = s3c_adc_resource, @@ -956,31 +956,19 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_ #endif /* CONFIG_PLAT_S3C24XX */ #ifdef CONFIG_SAMSUNG_DEV_TS -static struct resource s3c_ts_resource[] = { - [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256), - [1] = DEFINE_RES_IRQ(IRQ_TC), -}; - static struct s3c2410_ts_mach_info default_ts_data __initdata = { .delay = 10000, .presc = 49, .oversampling_shift = 2, }; -struct platform_device s3c_device_ts = { - .name = "s3c64xx-ts", - .id = -1, - .num_resources = ARRAY_SIZE(s3c_ts_resource), - .resource = s3c_ts_resource, -}; - -void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd) +void __init s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd) { if (!pd) pd = &default_ts_data; s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info), - &s3c_device_ts); + &s3c_device_adc); } #endif /* CONFIG_SAMSUNG_DEV_TS */ diff --git a/include/linux/platform_data/touchscreen-s3c2410.h b/include/linux/platform_data/touchscreen-s3c2410.h index 58dc7c5ae63b..71eccaa9835d 100644 --- a/include/linux/platform_data/touchscreen-s3c2410.h +++ b/include/linux/platform_data/touchscreen-s3c2410.h @@ -17,6 +17,7 @@ struct s3c2410_ts_mach_info { }; extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *); +extern void s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *); /* defined by architecture to configure gpio */ extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev);