From patchwork Tue Nov 17 21:11:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Yang-R58472 X-Patchwork-Id: 7642471 Return-Path: X-Original-To: patchwork-linux-arm@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 24538BF90C for ; Tue, 17 Nov 2015 21:31:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F82520429 for ; Tue, 17 Nov 2015 21:31:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D6452041B for ; Tue, 17 Nov 2015 21:30:59 +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 1ZynoB-00016w-Js; Tue, 17 Nov 2015 21:28:59 +0000 Received: from mail-by2on0102.outbound.protection.outlook.com ([207.46.100.102] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZynnG-00089T-Av for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 21:28:07 +0000 Received: from BN3PR0301CA0041.namprd03.prod.outlook.com (10.160.180.179) by BY1PR0301MB0855.namprd03.prod.outlook.com (10.160.193.149) with Microsoft SMTP Server (TLS) id 15.1.325.17; Tue, 17 Nov 2015 21:27:40 +0000 Received: from BL2FFO11FD039.protection.gbl (2a01:111:f400:7c09::114) by BN3PR0301CA0041.outlook.office365.com (2a01:111:e400:4000::51) with Microsoft SMTP Server (TLS) id 15.1.318.15 via Frontend Transport; Tue, 17 Nov 2015 21:27:40 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (TLS) id 15.1.325.5 via Frontend Transport; Tue, 17 Nov 2015 21:27:39 +0000 Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.70]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id tAHLRbLr019664; Tue, 17 Nov 2015 14:27:38 -0700 From: Li Yang To: Wolfram Sang Subject: [PATCH] i2c: imx: fix build issue for platforms without pinctrl Date: Tue, 17 Nov 2015 15:11:15 -0600 Message-ID: <1447794675-19411-1-git-send-email-leoli@freescale.com> X-Mailer: git-send-email 2.3.3 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD039; 1:2BPEulPK3UoGHDo+mIZiFMBLXJKb2cXtKvqO4Cpx/a3vZwdZQWSamPF94C4e83PQMAY5YA3iVwvcYi5M7GLC0LCgpAYnvbpKkh76Pv/BagEOlcpMJcfYeTbeuLK/TVfsrqFEOMCKUTfZsLkwb7gAgcuOoVQIAoRv+u6C6OneRB8rbSyse7I4H6dQDKe2e8KO7uPq/Io80icPpZuDusel/oOpRKTLCN7AW+oiNpBi/NaRYarttW3QMcGXjoXx6NNZQ1LqzSCmNu5pkIcVH+pXj57AAvnvtX2J+spySrLGuYVJcNjkDF0w3bU+WXb0TJMme1zxq5rWKfBWlRd3v/9Qum/iWzhFYZWd3AH10tIFpzub9hFYUk+cUgVXIDYKyGgjE/cynXtmAhszmu4t/gR0ctJr2tMHaXfK8H78dAXoIUzwvWDq6FuF99lZ9GT3P4CS X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(3190300001)(199003)(189002)(104016004)(5003940100001)(106466001)(48376002)(77096005)(50986999)(50466002)(586003)(92566002)(47776003)(50226001)(19580405001)(19580395003)(5001960100002)(11100500001)(4001430100002)(5008740100001)(229853001)(80792005)(81156007)(5007970100001)(110136002)(87936001)(189998001)(5001920100001)(33646002)(6806005)(97736004)(85326001)(36756003)(86362001)(107886002)(129583001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB0855; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0855; 2:28DEeMgXn6Yeh4LPU3JtxPjkaA0h0R7DsA+1cFp/1uYs6/ygYMfl0DnD2HANuE3jSCtnF+EJKWJa5nwMgPKX/WuiH/V5gJ5CB6QkCgh4qKx6pHlxjDxjRORmtm/Eco8OGxEs5yaHa8jJsfsb8MHYs3+0gAzssz9ycwWlKMWMFOY=; 3:WsZe1NTYkSicwWnFNFA8OT2QGpYxmqXJToEhDEMylysr1udApzaJCShNghmQdM/AHQ30ISK1JDWPwmgSqtffMxhwg31yzgNvhelfVCnCFMlnwBQC8aGM+J80FwjfFFeOyTm85RajY+lHqvHyY/fdwdoVDW2ymuasdxkilUJn2az5IIh5cpLSy0+ph+I/ndlXk04nEOKDThuhHk8htCBFfgsMSLyeq7JOwe7f95BlY+I=; 25:3esSzA8TzqSlYJ0b0Wg9C/Ps9p5w9CFhUWPJr4nzHo6+i96aWauy8gc7FYaB8IJltUz1nsAQRlHDSbAIP4/ihiEB3BwTlT9HBHTmd0OCGYAHCS5qwG1v8kzisWbXximV8hDD05H7guRh4lisOJO4x2P62215lOlWDJvKwN9f4kWBTVePmRqN9/oL66Zd/1Jfp5o3rvxmm6oIr8jO7d/5FKGSLYN8pqzZrat4M96qDAsgdmsNcKSTi28+vUZV/Nm6OQNl7X6vq8UUHTosjhIoSQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB0855; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0855; 20:cm+JX6/SAi0HRSX22pmYwSnxobU5VdkkU9PuU2OiH0gTEWZvtd0y0pERHFEYvXwFmjucFrJni9fCP8ReFjOjuqSB7f+sy/tDhn0y0boW83G95XxputvPXL6jbH8kXtOx1B6XiR4W9++Itgr49jOrZmPhpNqZ40Q7KwPh7A8aUVqAKGhkyKVxygjQ+FWDQ2Ilmtl/HtMtda6h3OUEES8AkqN3a2UxTj13tXS3J7qWLWPC2g+EZxjOQpiRwqg8apaqWyhDS0USsswqiVviI9Y7m0kc2kqGIpA0+NX9llj3bb7YS9tHINsRgSsDld3hyylN/dKL1Jg5wF4OydtVu2wIQyI/0lK8L71c0/hCAzV5z30=; 4:qWzjXqkrJOMuRkvcZT6cC63o7PYpyUHFD9rDIKphb6SsNhqzIQLQ+uE1J88raMTBv9eVbd63MpTtYa1kQvUsbUJOgyNRp+tLsYsB7LAIxcCJqV7HhlHG0RpNuhZgB1ET+rL0WKNw0Kn2+D2GOadGgC5mi9i7gbwIHjZj04uaee4oHG5NXvnHk4coyNSvb35hq2bqekMR1YfP0F/hCn3hnDAD95UPL2SZtQ7rNpj/4QSE9AC7nb7Qd59hd4lSINwQOBUXP56loqOLkFdTv9RYY3b/hUlX7hD236qEp/04dAQWofNKFU0BWPZwEdF8OLhmOb7LMSDnJ6HrZa/yLB+leQCD4Eblxm0q5MFqt+4rGOQaxWGBOEKGxoFgkIJgdxfN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:BY1PR0301MB0855; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB0855; X-Forefront-PRVS: 07630F72AD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB0855; 23:eBHV0WWTzuJuW3H324hhJvlPWLIE1VvUsnzJ9kG?= =?us-ascii?Q?HKNBUgX5dka09g3Tg6u7/TArfcg76dHHoo4dU+o+wn7oOvRfVrAdNHbgZ2j8?= =?us-ascii?Q?jUMBeTLHoFkflQNISe7B88p1iggZzTYdDAjkkdLOaRpbMwkuCE2l8qPFt/Po?= =?us-ascii?Q?GmR/KJWVKQbk0y7fVpdfAvrYu6k1+4U+dkF1xIna49cNRk0HbtBo6GKaNLx+?= =?us-ascii?Q?l5ufjVycCdIpzbtB4MBH1+aFxIEiQ4y+rTVB40aevvJm7xAScASIQaldshtr?= =?us-ascii?Q?Gt4Z2aRQW0jBIbPAiDUZrr46L0Jju3PhCZzAJhQpiPxUizpHyzGSJBhk9zm3?= =?us-ascii?Q?oMyFd9ibL8ZhOuiZJ2XYRmqETF2pkEE1dhRDZ3JJIOiMp4HtZ+DPROkDBtck?= =?us-ascii?Q?heuUwa7phOxOycVSNQxWoqEUA9GsdGbutP/MneNXW+T9QHN6Q8zgNRbs4xGA?= =?us-ascii?Q?eIHODuCxbL0OoVFTkY7uyq3sITXf395+knr5lZOfztlwbN0fwaZqE6vG9xtq?= =?us-ascii?Q?eq7+V1jpS4ex6/Tdyft6BlRwgcd8SKr65T/DKob6TcHSVbXxDfbfQlJxsmRG?= =?us-ascii?Q?BtfpbH9JYS6YxJNUpUgD3xuxS9YibNGXuFRXZl4wyL5kjCdodhPdU+51JxEM?= =?us-ascii?Q?KUyrHiJ+douYZyvIY+y9BCzR9Hv2Sd7WgfMSsSQToKoGPB8xJ0W7fFxkzncU?= =?us-ascii?Q?5mIpS5BDAY+Xqlz/RFnew56JftnyL40CJOCNknAEYxyo1XOsKNu0dXt7E6+6?= =?us-ascii?Q?27ug+voasol+OVxM7DSbkmXrz7Iuj79kRWQIQypsFnF4Waa4zMVgik4w4saf?= =?us-ascii?Q?oq96vfi0d62YYimvBA0yMTkyqEnd9T0/HQbE5Qj/GQAa4lAAosHPb3LubH2i?= =?us-ascii?Q?ibe8nsydneniQ+r/h0s7kDVGCnBokeYh24+vx9FZn7AGoKMZbBtpkJ9w5uRH?= =?us-ascii?Q?yNqkoDMlu7DdoSngpMrotJa+Ru+5bOv8FNUZlCawOeJ/Sj2euZtUeuI6FLrm?= =?us-ascii?Q?p02V2B2ImtPkk7wVNfScW4c1RK6qc+Wh+VrVsHwq4TQWWnwBZpJSEhzWV8GW?= =?us-ascii?Q?VDk4XcJVhAMZgvHueO8pH3Z7vuzLJ?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0855; 5:h3VTKQFLjLtXoWW9KT6i7DmyhJrYWezy7aGAnpUd7JdF9ULeTF0S4IKe64Ts9N08vUdlXnSApq60nhC9WmRvR/2Id3YVdF9v6oq7r9zMhREICYkHkJuSkOK8/EhUyKzx5Hzl9dkqkUCSpHfuVB+EjQ==; 24:6fXUIgevF26zqAZEnAkxc/tS2vNzEe+JRKVGi6mri2BSQrv2FfZuIlZzzsoqoA9uu8LA36dklU6l8NfA28R06JFqXLm9ULL538+H0G5qDsA=; 20:lBXpLLE1TUoSnZPwpY4Np8KrSD5OKf0vN37fC04O+Aj2jwLiXvs84htnEXpLnjXbPV5urCtLmnhsvzdmmPV7lg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 21:27:39.5340 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_132802_647165_BF79EF3C X-CRM114-Status: GOOD ( 15.97 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gao Pan , Li Yang , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 With commit 1c4b6c3b (i2c: imx: implement bus recovery) the driver starts to use pinctrl to do i2c bus recovery. But this breaks build for platforms that don't implement pinctrl, such as ls1021a and ls1043a. This patch fix the problem by only compiling the bus recovery code when CONFIG_PINCTRL is enabled. Reported-by: Ren Xiaofeng Signed-off-by: Li Yang Cc: Gao Pan --- drivers/i2c/busses/i2c-imx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 1e4d99d..614253a 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -208,11 +208,13 @@ struct imx_i2c_struct { unsigned int cur_clk; unsigned int bitrate; const struct imx_i2c_hwdata *hwdata; +#ifdef CONFIG_PINCTRL struct i2c_bus_recovery_info rinfo; struct pinctrl *pinctrl; struct pinctrl_state *pinctrl_pins_default; struct pinctrl_state *pinctrl_pins_gpio; +#endif struct imx_i2c_dma *dma; }; @@ -902,12 +904,14 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter, /* Start I2C transfer */ result = i2c_imx_start(i2c_imx); +#ifdef CONFIG_PINCTRL if (result) { if (i2c_imx->adapter.bus_recovery_info) { i2c_recover_bus(&i2c_imx->adapter); result = i2c_imx_start(i2c_imx); } } +#endif if (result) goto fail0; @@ -969,6 +973,7 @@ fail0: return (result < 0) ? result : num; } +#ifdef CONFIG_PINCTRL static void i2c_imx_prepare_recovery(struct i2c_adapter *adap) { struct imx_i2c_struct *i2c_imx; @@ -1017,6 +1022,7 @@ static void i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx, rinfo->recover_bus = i2c_generic_gpio_recovery; i2c_imx->adapter.bus_recovery_info = rinfo; } +#endif static u32 i2c_imx_func(struct i2c_adapter *adapter) { @@ -1086,11 +1092,13 @@ static int i2c_imx_probe(struct platform_device *pdev) return ret; } +#ifdef CONFIG_PINCTRL i2c_imx->pinctrl = devm_pinctrl_get(&pdev->dev); if (IS_ERR(i2c_imx->pinctrl)) { ret = PTR_ERR(i2c_imx->pinctrl); goto clk_disable; } +#endif /* Request IRQ */ ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, 0, @@ -1125,7 +1133,9 @@ static int i2c_imx_probe(struct platform_device *pdev) goto clk_disable; } +#ifdef CONFIG_PINCTRL i2c_imx_init_recovery_info(i2c_imx, pdev); +#endif /* Set up platform driver data */ platform_set_drvdata(pdev, i2c_imx);