From patchwork Thu Oct 18 11:26:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 10647047 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 491E0109C for ; Thu, 18 Oct 2018 11:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 375CE283B2 for ; Thu, 18 Oct 2018 11:28:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 259FE2842E; Thu, 18 Oct 2018 11:28:45 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C23CF283B2 for ; Thu, 18 Oct 2018 11:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dtUb0IwulTmNdn4xkAxk9sS+khR9FKhM3bfIEF0P/A4=; b=udkzLfPnM9tdHr tPiuJXZfEUscPwK0WAYtLdBDPAJNh3TnFuEvf+fWXp3GvOzGuQCSD/eU4HYSNe2GYvk4IIDN7RlRv 9zIqZM/XGMIEzRA53FJ40PnfC/7eLj7ITnm//zTp1ZYklqbxsMzNrQf8ZGa7ehSQJ5jjjI8BClTF9 M115r4pohyS68bewr+oCRhmysO9RDU7c3FSedpYR8nvrMelcZFmNsOLSf+ueobpvYoxt9yEchX1Sq Gndnhcj1tZ3AEeAqJNCOZUbOvxlLoGRV04UmImspzyrfPqH2dTWXfFTV9KyRo6Av78NMTPyhgY7Ng U8IL5ZwEBp+CnefTB5lw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6Th-0001Sp-L0; Thu, 18 Oct 2018 11:28:33 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6Rz-0000ZJ-QW for linux-arm-kernel@lists.infradead.org; Thu, 18 Oct 2018 11:26:56 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gD6RV-0004aM-Eg; Thu, 18 Oct 2018 13:26:17 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1gD6RU-0007f3-JA; Thu, 18 Oct 2018 13:26:16 +0200 From: Oleksij Rempel To: Wolfram Sang , Shawn Guo , Sascha Hauer Subject: [PATCH v1 1/3] ARM: dts: imx6sll: fix typo for fsl,imx6sll-i2c node Date: Thu, 18 Oct 2018 13:26:13 +0200 Message-Id: <20181018112615.29362-2-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181018112615.29362-1-o.rempel@pengutronix.de> References: <20181018112615.29362-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181018_042648_031770_751E172F X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel , linux-i2c@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , linux-arm-kernel@lists.infradead.org, NXP Linux Team Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Oleksij Rempel Acked-by: Uwe Kleine-König --- arch/arm/boot/dts/imx6sll.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi index 000e6136a9d6..3e6ffaf5f104 100644 --- a/arch/arm/boot/dts/imx6sll.dtsi +++ b/arch/arm/boot/dts/imx6sll.dtsi @@ -709,7 +709,7 @@ i2c1: i2c@21a0000 { #address-cells = <1>; #size-cells = <0>; - compatible = "fs,imx6sll-i2c", "fsl,imx21-i2c"; + compatible = "fsl,imx6sll-i2c", "fsl,imx21-i2c"; reg = <0x021a0000 0x4000>; interrupts = ; clocks = <&clks IMX6SLL_CLK_I2C1>; From patchwork Thu Oct 18 11:26:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 10647041 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 EF1F2181D for ; Thu, 18 Oct 2018 11:27:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1D6528505 for ; Thu, 18 Oct 2018 11:27:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D664628698; Thu, 18 Oct 2018 11:27:21 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3A7728653 for ; Thu, 18 Oct 2018 11:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BjaXvqp43CqkMWGAlbtRqMPufyAlal+ie9nycbUe08o=; b=he2Txm073ZgUsD eRvwoCZ4X/UyvhuqA54ylRHc01kr85X6A+IF7OsNwS4k9U2vJV4bQYJ/3X6pEP62V5HcJhiu3GLvj V42AxGXP7CVbEdehjFUvVRTO5xShyzIsSDbxwyNsg+o+t8fAJUZhAn4i3bqe9aeQYiE4Yikz/fUmd I8pPJwygd8fuVauLruJNrVqn2WRfll5S83vFuwI4d7ACZPduWCb5e02hPYeeuQWbJlOjw9m0E8yL6 EaPCb8LPiMnDp/TXXMRJBY15f8YcAyWqGJBgJtOY+avL5UqdVCYkc9/GCRjF/K1ZCe2igoHVb4gcq eSm8VzXPcRcThmI6+j1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6SQ-0000rG-Ns; Thu, 18 Oct 2018 11:27:14 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6Ro-0000YB-2o for linux-arm-kernel@lists.infradead.org; Thu, 18 Oct 2018 11:26:37 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gD6RV-0004aN-Eg; Thu, 18 Oct 2018 13:26:17 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1gD6RU-0007fC-Jx; Thu, 18 Oct 2018 13:26:16 +0200 From: Oleksij Rempel To: Wolfram Sang , Shawn Guo , Sascha Hauer Subject: [PATCH v1 2/3] i2c: imx: probe dma only only on i.MX50 and later. Date: Thu, 18 Oct 2018 13:26:14 +0200 Message-Id: <20181018112615.29362-3-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181018112615.29362-1-o.rempel@pengutronix.de> References: <20181018112615.29362-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181018_042636_310453_A4404203 X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel , linux-i2c@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , linux-arm-kernel@lists.infradead.org, NXP Linux Team Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The DMA support for I2C was introduced on i.MX50. So, avoid of DMA probing on not supported versions. Signed-off-by: Oleksij Rempel --- drivers/i2c/busses/i2c-imx.c | 53 ++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index c406700789e1..df013b1b6fa4 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -169,6 +169,7 @@ struct imx_i2c_hwdata { unsigned ndivs; unsigned i2sr_clr_opcode; unsigned i2cr_ien_opcode; + bool has_dmamode; }; struct imx_i2c_dma { @@ -211,7 +212,7 @@ static const struct imx_i2c_hwdata imx1_i2c_hwdata = { .ndivs = ARRAY_SIZE(imx_i2c_clk_div), .i2sr_clr_opcode = I2SR_CLR_OPCODE_W0C, .i2cr_ien_opcode = I2CR_IEN_OPCODE_1, - + .has_dmamode = false, }; static const struct imx_i2c_hwdata imx21_i2c_hwdata = { @@ -221,7 +222,17 @@ static const struct imx_i2c_hwdata imx21_i2c_hwdata = { .ndivs = ARRAY_SIZE(imx_i2c_clk_div), .i2sr_clr_opcode = I2SR_CLR_OPCODE_W0C, .i2cr_ien_opcode = I2CR_IEN_OPCODE_1, + .has_dmamode = false, +}; +static const struct imx_i2c_hwdata imx50_i2c_hwdata = { + .devtype = IMX21_I2C, + .regshift = IMX_I2C_REGSHIFT, + .clk_div = imx_i2c_clk_div, + .ndivs = ARRAY_SIZE(imx_i2c_clk_div), + .i2sr_clr_opcode = I2SR_CLR_OPCODE_W0C, + .i2cr_ien_opcode = I2CR_IEN_OPCODE_1, + .has_dmamode = true, }; static struct imx_i2c_hwdata vf610_i2c_hwdata = { @@ -231,7 +242,7 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = { .ndivs = ARRAY_SIZE(vf610_i2c_clk_div), .i2sr_clr_opcode = I2SR_CLR_OPCODE_W1C, .i2cr_ien_opcode = I2CR_IEN_OPCODE_0, - + .has_dmamode = true, }; static const struct platform_device_id imx_i2c_devtype[] = { @@ -241,6 +252,33 @@ static const struct platform_device_id imx_i2c_devtype[] = { }, { .name = "imx21-i2c", .driver_data = (kernel_ulong_t)&imx21_i2c_hwdata, + }, { + .name = "imx50-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx51-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx53-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx6q-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx6sl-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx6sll-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx6sx-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx6ul-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, + }, { + .name = "imx7d-i2c", + .driver_data = (kernel_ulong_t)&imx50_i2c_hwdata, }, { /* sentinel */ } @@ -250,6 +288,14 @@ MODULE_DEVICE_TABLE(platform, imx_i2c_devtype); static const struct of_device_id i2c_imx_dt_ids[] = { { .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, }, { .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, }, + { .compatible = "fsl,imx50-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx51-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx53-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx6q-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx6sl-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx6sll-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx6sx-i2c", .data = &imx50_i2c_hwdata, }, + { .compatible = "fsl,imx6ul-i2c", .data = &imx50_i2c_hwdata, }, { .compatible = "fsl,vf610-i2c", .data = &vf610_i2c_hwdata, }, { /* sentinel */ } }; @@ -281,6 +327,9 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, struct device *dev = &i2c_imx->adapter.dev; int ret; + if (!i2c_imx->hwdata->has_dmamode) + return; + dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL); if (!dma) return; From patchwork Thu Oct 18 11:26:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 10647045 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 AFB1617DE for ; Thu, 18 Oct 2018 11:28:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FAFE28505 for ; Thu, 18 Oct 2018 11:28:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93B3428653; Thu, 18 Oct 2018 11:28:07 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CC3728505 for ; Thu, 18 Oct 2018 11:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sCfB0KaKIN3nPV2+cfVSKDEkT/0o2KSv6o5d5FHXAPI=; b=PBqmSJ77vQP37W ewmgIxb9kqIQfi6Ummq5eJbWMZxjaD5EgJ8DD9ZKSAt98kJ91Z90GZZVZm7woz6pJEY+xKEsDiDzs AOkl3wYJodgQzK3xyOG/liYHcFtL4PALu0WsqYeUmfp1oGlBwNhrZIkAJVy8BEBRqPV9Daoo/R47Z Q1BnqfNxHRF24/Sa6V1fCGF9QBVpGPvfMeT1Byak8Bi8nuQx6WKbI3zxnkLDVtEUH7xeANRzQ8bbm WoSNO8H5g7rmb17HuIlP40o0c9Y59BgTGZVKYEd8NJXQpeUlk/YZ2xxMThXj/mYMocEUAsdJHOB4F 3DOVKVV2nzE3/CuQm5pQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6T5-0001CK-RZ; Thu, 18 Oct 2018 11:27:55 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD6Ro-0000YA-2q for linux-arm-kernel@lists.infradead.org; Thu, 18 Oct 2018 11:26:39 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gD6RV-0004aO-Eg; Thu, 18 Oct 2018 13:26:17 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1gD6RU-0007fL-Kn; Thu, 18 Oct 2018 13:26:16 +0200 From: Oleksij Rempel To: Wolfram Sang , Shawn Guo , Sascha Hauer Subject: [PATCH v1 3/3] i2c: imx: don't print error if DMA is not configured Date: Thu, 18 Oct 2018 13:26:15 +0200 Message-Id: <20181018112615.29362-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181018112615.29362-1-o.rempel@pengutronix.de> References: <20181018112615.29362-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181018_042636_316555_8130CF57 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleksij Rempel , linux-i2c@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , linux-arm-kernel@lists.infradead.org, NXP Linux Team Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP At least on i.MX5x variants is DMA event for I2C muxed with SDHC. So it is project specific configuration and not an error. Signed-off-by: Oleksij Rempel --- drivers/i2c/busses/i2c-imx.c | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index df013b1b6fa4..bd362fe07257 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -319,7 +319,7 @@ static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx, } /* Functions for DMA support */ -static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, +static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, dma_addr_t phy_addr) { struct imx_i2c_dma *dma; @@ -328,15 +328,17 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, int ret; if (!i2c_imx->hwdata->has_dmamode) - return; + return 0; dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL); if (!dma) - return; + return -ENOMEM; - dma->chan_tx = dma_request_slave_channel(dev, "tx"); - if (!dma->chan_tx) { - dev_dbg(dev, "can't request DMA tx channel\n"); + dma->chan_tx = dma_request_chan(dev, "tx"); + if (IS_ERR(dma->chan_tx)) { + ret = PTR_ERR(dma->chan_rx); + if (ret != -ENODEV && ret != -EPROBE_DEFER) + dev_err(dev, "can't request DMA tx channel (%d)\n", ret); goto fail_al; } @@ -347,13 +349,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, dma_sconfig.direction = DMA_MEM_TO_DEV; ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig); if (ret < 0) { - dev_dbg(dev, "can't configure tx channel\n"); + dev_err(dev, "can't configure tx channel (%d)\n", ret); goto fail_tx; } - dma->chan_rx = dma_request_slave_channel(dev, "rx"); - if (!dma->chan_rx) { - dev_dbg(dev, "can't request DMA rx channel\n"); + dma->chan_rx = dma_request_chan(dev, "rx"); + if (IS_ERR(dma->chan_rx)) { + ret = PTR_ERR(dma->chan_rx); + if (ret != -ENODEV && ret != -EPROBE_DEFER) + dev_err(dev, "can't request DMA rx channel (%d)\n", ret); goto fail_tx; } @@ -364,7 +368,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, dma_sconfig.direction = DMA_DEV_TO_MEM; ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig); if (ret < 0) { - dev_dbg(dev, "can't configure rx channel\n"); + dev_err(dev, "can't configure rx channel (%d)\n", ret); goto fail_rx; } @@ -373,15 +377,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, dev_info(dev, "using %s (tx) and %s (rx) for DMA transfers\n", dma_chan_name(dma->chan_tx), dma_chan_name(dma->chan_rx)); - return; + return 0; fail_rx: dma_release_channel(dma->chan_rx); fail_tx: dma_release_channel(dma->chan_tx); fail_al: - devm_kfree(dev, dma); - dev_info(dev, "can't use DMA, using PIO instead.\n"); + /* return successfully if there is no dma support */ + return ret == -ENODEV ? 0 : ret; } static void i2c_imx_dma_callback(void *arg) @@ -1208,11 +1212,13 @@ static int i2c_imx_probe(struct platform_device *pdev) dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res); dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n", i2c_imx->adapter.name); - dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); /* Init DMA config if supported */ - i2c_imx_dma_request(i2c_imx, phy_addr); + ret = i2c_imx_dma_request(i2c_imx, phy_addr); + if (ret < 0) + goto clk_notifier_unregister; + dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n"); return 0; /* Return OK */ clk_notifier_unregister: