From patchwork Wed Jan 14 07:52:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonic zhang X-Patchwork-Id: 5628461 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2BF0BC058D for ; Wed, 14 Jan 2015 08:28:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15E4F2038A for ; Wed, 14 Jan 2015 08:28:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECA7B2021F for ; Wed, 14 Jan 2015 08:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753268AbbANI2O (ORCPT ); Wed, 14 Jan 2015 03:28:14 -0500 Received: from mail-by2on0088.outbound.protection.outlook.com ([207.46.100.88]:33984 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753257AbbANI2L (ORCPT ); Wed, 14 Jan 2015 03:28:11 -0500 Received: from CO2PR03CA0043.namprd03.prod.outlook.com (10.141.194.170) by CY1PR0301MB0747.namprd03.prod.outlook.com (25.160.159.153) with Microsoft SMTP Server (TLS) id 15.1.53.17; Wed, 14 Jan 2015 07:55:21 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::140) by CO2PR03CA0043.outlook.office365.com (2a01:111:e400:1414::42) with Microsoft SMTP Server (TLS) id 15.1.53.17 via Frontend Transport; Wed, 14 Jan 2015 07:55:20 +0000 Received: from nwd2mta2.analog.com (137.71.25.57) by BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server (TLS) id 15.1.49.13 via Frontend Transport; Wed, 14 Jan 2015 07:55:20 +0000 Received: from NWD2HUBCAS9.ad.analog.com (nwd2hubcas9.ad.analog.com [10.64.72.142]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id t0EB1MWP010562 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 14 Jan 2015 06:01:23 -0500 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS9.ad.analog.com (10.64.72.142) with Microsoft SMTP Server id 14.3.210.2; Wed, 14 Jan 2015 02:54:26 -0500 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id t0E7sOSU023525; Wed, 14 Jan 2015 02:54:24 -0500 Received: from nine.ad.analog.com (unknown [10.99.24.95]) by linux.site (Postfix) with ESMTP id F28AA3AF040D; Tue, 13 Jan 2015 16:57:23 -0700 (MST) From: Sonic Zhang To: Dmitry Torokhov , CC: Michael Hennerich , , Sonic Zhang Subject: [PATCH 2/3] bfin_rotary: Move peripheral pinmux definition into platform data Date: Wed, 14 Jan 2015 15:52:54 +0800 Message-ID: <1421221975-30728-2-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1421221975-30728-1-git-send-email-sonic.adi@gmail.com> References: <1421221975-30728-1-git-send-email-sonic.adi@gmail.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130656957210069199; (52f37747-95c3-483a-bd05-08d153b03fac); () Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 137.71.25.57 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=sonic.adi@gmail.com; X-Forefront-Antispam-Report: CIP:137.71.25.57; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(83322999)(2950100001)(77096005)(76482003)(77156002)(62966003)(55446002)(33646002)(6806004)(61266001)(64706001)(47776003)(19580395003)(19580405001)(105596002)(106466001)(86362001)(76176999)(50986999)(87572001)(92566002)(81442002)(73972006)(73392002)(46102003)(87936001)(50226001)(48376002)(229853001)(36756003)(50466002)(82202001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0747; H:nwd2mta2.analog.com; FPR:; SPF:SoftFail; MLV:sfv; PTR:nwd2mail11.analog.com; A:1; MX:1; LANG:en; X-DmarcStatus-Test: Failed X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(3004003)(3005003); SRVR:CY1PR0301MB0747; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:CY1PR0301MB0747; X-Forefront-PRVS: 04569283F9 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(401002)(400003); SRVR:CY1PR0301MB0747; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2015 07:55:20.8977 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[137.71.25.57] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0747 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,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 From: Sonic Zhang Signed-off-by: Sonic Zhang --- arch/blackfin/mach-bf527/boards/ad7160eval.c | 8 ++++++++ arch/blackfin/mach-bf527/boards/ezkit.c | 8 ++++++++ arch/blackfin/mach-bf548/boards/ezkit.c | 8 ++++++++ arch/blackfin/mach-bf609/boards/ezkit.c | 8 ++++++++ drivers/input/misc/bfin_rotary.c | 12 +++--------- include/linux/platform_data/bfin_rotary.h | 1 + 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/arch/blackfin/mach-bf527/boards/ad7160eval.c b/arch/blackfin/mach-bf527/boards/ad7160eval.c index beb011b..029a050 100644 --- a/arch/blackfin/mach-bf527/boards/ad7160eval.c +++ b/arch/blackfin/mach-bf527/boards/ad7160eval.c @@ -668,6 +668,13 @@ static struct platform_device bfin_sport1_uart_device = { #if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY) #include +static const u16 per_cnt[] = { + P_CNT_CUD, + P_CNT_CDG, + P_CNT_CZM, + 0 +}; + static struct bfin_rotary_platform_data bfin_rotary_data = { /*.rotary_up_key = KEY_UP,*/ /*.rotary_down_key = KEY_DOWN,*/ @@ -676,6 +683,7 @@ static struct bfin_rotary_platform_data bfin_rotary_data = { .debounce = 10, /* 0..17 */ .mode = ROT_QUAD_ENC | ROT_DEBE, .pm_wakeup = 1, + .pin_list = per_cnt, }; static struct resource bfin_rotary_resources[] = { diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 728cda4..cc80c5b 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c @@ -1094,6 +1094,13 @@ static struct platform_device bfin_device_gpiokeys = { #if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY) #include +static const u16 per_cnt[] = { + P_CNT_CUD, + P_CNT_CDG, + P_CNT_CZM, + 0 +}; + static struct bfin_rotary_platform_data bfin_rotary_data = { /*.rotary_up_key = KEY_UP,*/ /*.rotary_down_key = KEY_DOWN,*/ @@ -1102,6 +1109,7 @@ static struct bfin_rotary_platform_data bfin_rotary_data = { .debounce = 10, /* 0..17 */ .mode = ROT_QUAD_ENC | ROT_DEBE, .pm_wakeup = 1, + .pin_list = per_cnt, }; static struct resource bfin_rotary_resources[] = { diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 8f70f83..0b68781 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c @@ -161,6 +161,13 @@ static struct platform_device bf54x_kpad_device = { #if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY) #include +static const u16 per_cnt[] = { + P_CNT_CUD, + P_CNT_CDG, + P_CNT_CZM, + 0 +}; + static struct bfin_rotary_platform_data bfin_rotary_data = { /*.rotary_up_key = KEY_UP,*/ /*.rotary_down_key = KEY_DOWN,*/ @@ -169,6 +176,7 @@ static struct bfin_rotary_platform_data bfin_rotary_data = { .debounce = 10, /* 0..17 */ .mode = ROT_QUAD_ENC | ROT_DEBE, .pm_wakeup = 1, + .pin_list = per_cnt, }; static struct resource bfin_rotary_resources[] = { diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c index f9dc64d..4ac72c6 100644 --- a/arch/blackfin/mach-bf609/boards/ezkit.c +++ b/arch/blackfin/mach-bf609/boards/ezkit.c @@ -77,6 +77,13 @@ static struct platform_device bfin_isp1760_device = { #if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY) #include +static const u16 per_cnt[] = { + P_CNT_CUD, + P_CNT_CDG, + P_CNT_CZM, + 0 +}; + static struct bfin_rotary_platform_data bfin_rotary_data = { /*.rotary_up_key = KEY_UP,*/ /*.rotary_down_key = KEY_DOWN,*/ @@ -84,6 +91,7 @@ static struct bfin_rotary_platform_data bfin_rotary_data = { .rotary_button_key = KEY_ENTER, .debounce = 10, /* 0..17 */ .mode = ROT_QUAD_ENC | ROT_DEBE, + .pin_list = per_cnt, }; static struct resource bfin_rotary_resources[] = { diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c index 8f6c7cd..dd62fc9 100644 --- a/drivers/input/misc/bfin_rotary.c +++ b/drivers/input/misc/bfin_rotary.c @@ -16,13 +16,6 @@ #include -static const u16 per_cnt[] = { - P_CNT_CUD, - P_CNT_CDG, - P_CNT_CZM, - 0 -}; - struct bfin_rot { struct input_dev *input; int irq; @@ -102,7 +95,7 @@ static int bfin_rotary_probe(struct platform_device *pdev) return -EINVAL; } - error = peripheral_request_list(per_cnt, dev_name(&pdev->dev)); + error = peripheral_request_list(pdata->pin_list, dev_name(&pdev->dev)); if (error) { dev_err(&pdev->dev, "requesting peripherals failed\n"); return error; @@ -197,6 +190,7 @@ out1: static int bfin_rotary_remove(struct platform_device *pdev) { + struct bfin_rotary_platform_data *pdata = dev_get_platdata(&pdev->dev); struct bfin_rot *rotary = platform_get_drvdata(pdev); bfin_write_CNT_CONFIG(0); @@ -204,7 +198,7 @@ static int bfin_rotary_remove(struct platform_device *pdev) free_irq(rotary->irq, pdev); input_unregister_device(rotary->input); - peripheral_free_list(per_cnt); + peripheral_free_list(pdata->pin_list); kfree(rotary); diff --git a/include/linux/platform_data/bfin_rotary.h b/include/linux/platform_data/bfin_rotary.h index 8895a75..9882937 100644 --- a/include/linux/platform_data/bfin_rotary.h +++ b/include/linux/platform_data/bfin_rotary.h @@ -40,6 +40,7 @@ struct bfin_rotary_platform_data { unsigned short debounce; /* 0..17 */ unsigned short mode; unsigned short pm_wakeup; + unsigned short *pin_list; }; /* CNT_CONFIG bitmasks */