From patchwork Thu May 25 13:51:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13255249 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D7F8C77B7A for ; Thu, 25 May 2023 13:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241400AbjEYNvU (ORCPT ); Thu, 25 May 2023 09:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240966AbjEYNvT (ORCPT ); Thu, 25 May 2023 09:51:19 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FD01189; Thu, 25 May 2023 06:51:18 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.00,191,1681138800"; d="scan'208";a="160806212" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 25 May 2023 22:51:17 +0900 Received: from localhost.localdomain (unknown [10.226.93.84]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 192144226EA8; Thu, 25 May 2023 22:51:11 +0900 (JST) From: Biju Das To: Wolfram Sang Cc: Biju Das , Andy Shevchenko , Arnd Bergmann , Jarkko Nikula , Florian Fainelli , William Zhang , Mario Limonciello , Conor Dooley , Binbin Zhou , Phil Edworthy , Tharun Kumar P , Nick Hawkins , Tyrone Ting , linux-i2c@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org, Pavel Machek Subject: [PATCH 1/3] i2c: rzv2m: Drop extra space Date: Thu, 25 May 2023 14:51:06 +0100 Message-Id: <20230525135108.240651-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> References: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Drop extra space from the I2C_RZV2M config help description. Reported-by: Pavel Machek Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- drivers/i2c/busses/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 87600b4aacb3..31c0f54b0b8c 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -1025,7 +1025,7 @@ config I2C_RZV2M depends on ARCH_RENESAS || COMPILE_TEST help If you say yes to this option, support will be included for the - Renesas RZ/V2M I2C interface. + Renesas RZ/V2M I2C interface. This driver can also be built as a module. If so, the module will be called i2c-rzv2m. From patchwork Thu May 25 13:51:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13255250 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CFB9C7EE29 for ; Thu, 25 May 2023 13:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241401AbjEYNvX (ORCPT ); Thu, 25 May 2023 09:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241398AbjEYNvW (ORCPT ); Thu, 25 May 2023 09:51:22 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5DB0A183; Thu, 25 May 2023 06:51:21 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.00,191,1681138800"; d="scan'208";a="160806217" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 25 May 2023 22:51:21 +0900 Received: from localhost.localdomain (unknown [10.226.93.84]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 569EE4226EA8; Thu, 25 May 2023 22:51:18 +0900 (JST) From: Biju Das To: Wolfram Sang Cc: Biju Das , Andy Shevchenko , Philipp Zabel , linux-i2c@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org, Pavel Machek Subject: [PATCH 2/3] i2c: rzv2m: Rename macro names in all uppercase Date: Thu, 25 May 2023 14:51:07 +0100 Message-Id: <20230525135108.240651-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> References: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Normally we'd put macro names in all uppercase. Rename bit_setl->BIT_SETL and bit_clrl->BIT_CLRL. Reported-by: Pavel Machek Signed-off-by: Biju Das --- drivers/i2c/busses/i2c-rzv2m.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c index 56d0faee5c46..ccd337f2e8c3 100644 --- a/drivers/i2c/busses/i2c-rzv2m.c +++ b/drivers/i2c/busses/i2c-rzv2m.c @@ -50,8 +50,8 @@ #define IICB0MDSC BIT(7) /* Bus Mode */ #define IICB0SLSE BIT(1) /* Start condition output */ -#define bit_setl(addr, val) writel(readl(addr) | (val), (addr)) -#define bit_clrl(addr, val) writel(readl(addr) & ~(val), (addr)) +#define BIT_SETL(addr, val) writel(readl(addr) | (val), (addr)) +#define BIT_CLRL(addr, val) writel(readl(addr) & ~(val), (addr)) struct rzv2m_i2c_priv { void __iomem *base; @@ -198,7 +198,7 @@ static int rzv2m_i2c_read_with_ack(struct rzv2m_i2c_priv *priv, u8 *data, reinit_completion(&priv->msg_tia_done); /* Interrupt request timing : 8th clock */ - bit_clrl(priv->base + IICB0CTL0, IICB0SLWT); + BIT_CLRL(priv->base + IICB0CTL0, IICB0SLWT); /* Exit the wait state */ writel(IICB0WRET, priv->base + IICB0TRG); @@ -211,13 +211,13 @@ static int rzv2m_i2c_read_with_ack(struct rzv2m_i2c_priv *priv, u8 *data, if (last) { /* Disable ACK */ - bit_clrl(priv->base + IICB0CTL0, IICB0SLAC); + BIT_CLRL(priv->base + IICB0CTL0, IICB0SLAC); /* Read data*/ data_tmp = readl(priv->base + IICB0DAT); /* Interrupt request timing : 9th clock */ - bit_setl(priv->base + IICB0CTL0, IICB0SLWT); + BIT_SETL(priv->base + IICB0CTL0, IICB0SLWT); /* Exit the wait state */ writel(IICB0WRET, priv->base + IICB0TRG); @@ -229,7 +229,7 @@ static int rzv2m_i2c_read_with_ack(struct rzv2m_i2c_priv *priv, u8 *data, return -ETIMEDOUT; /* Enable ACK */ - bit_setl(priv->base + IICB0CTL0, IICB0SLAC); + BIT_SETL(priv->base + IICB0CTL0, IICB0SLAC); } else { /* Read data */ data_tmp = readl(priv->base + IICB0DAT); @@ -466,7 +466,7 @@ static int rzv2m_i2c_remove(struct platform_device *pdev) struct device *dev = priv->adap.dev.parent; i2c_del_adapter(&priv->adap); - bit_clrl(priv->base + IICB0CTL0, IICB0IICE); + BIT_CLRL(priv->base + IICB0CTL0, IICB0IICE); pm_runtime_disable(dev); return 0; @@ -481,7 +481,7 @@ static int rzv2m_i2c_suspend(struct device *dev) if (ret < 0) return ret; - bit_clrl(priv->base + IICB0CTL0, IICB0IICE); + BIT_CLRL(priv->base + IICB0CTL0, IICB0IICE); pm_runtime_put(dev); return 0; From patchwork Thu May 25 13:51:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13255251 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 585CFC7EE29 for ; Thu, 25 May 2023 13:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241190AbjEYNv1 (ORCPT ); Thu, 25 May 2023 09:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241225AbjEYNv0 (ORCPT ); Thu, 25 May 2023 09:51:26 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A50A8199; Thu, 25 May 2023 06:51:24 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.00,191,1681138800"; d="scan'208";a="160806224" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 25 May 2023 22:51:24 +0900 Received: from localhost.localdomain (unknown [10.226.93.84]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id A12D04226EA8; Thu, 25 May 2023 22:51:21 +0900 (JST) From: Biju Das To: Wolfram Sang Cc: Biju Das , Andy Shevchenko , Philipp Zabel , linux-i2c@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org, Pavel Machek Subject: [PATCH 3/3] i2c: rzv2m: Disable the operation of unit in case of error Date: Thu, 25 May 2023 14:51:08 +0100 Message-Id: <20230525135108.240651-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> References: <20230525135108.240651-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The remove and suspend callbacks disable the operation of the unit. Do the same in probe() in case of error. Reported-by: Pavel Machek Signed-off-by: Biju Das --- drivers/i2c/busses/i2c-rzv2m.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c index ccd337f2e8c3..3e9fc269e4fd 100644 --- a/drivers/i2c/busses/i2c-rzv2m.c +++ b/drivers/i2c/busses/i2c-rzv2m.c @@ -454,8 +454,10 @@ static int rzv2m_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); ret = i2c_add_numbered_adapter(adap); - if (ret < 0) + if (ret < 0) { + BIT_CLRL(priv->base + IICB0CTL0, IICB0IICE); pm_runtime_disable(dev); + } return ret; }