From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 618BA173321 for ; Fri, 21 Jun 2024 11:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718968998; cv=none; b=igN56r0TnSSXbDcIF3HWqSgoDWBvw0pcMwhfdbRNh2C4CZqWlHTBQVPQzZMVbfMFV5M5PNU4OwmPHWEs+0USzwc79yJ6dKUwU18rHBimz77jTneVlUChu8rMh95UfeXt91rk7Ngqv4UfF5x9Be8BmT3YnNR6YNf6ZcZfYIDIZAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718968998; c=relaxed/simple; bh=IjqB5K3yTTGpfsfSv09ofrCn4aXpotuyc6Jhgv4pWbk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G4+ZgnHCXTuueuTu6iw31GTUP82N/McDb4VtJoiPqPmbPSrkBuD2z+4ULKPAH6lfYHBOjEShMqqXu6C72haPyHsuHokT6z5bciRQNpxxneNntpL1PszPWREq/AoAqLz4E/FcaSU0aqJnk8ggPo2qwRE28SBqLgdfLeAExJD6+Kc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=CLXtLtX8; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="CLXtLtX8" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a6f0e153eddso241966966b.0 for ; Fri, 21 Jun 2024 04:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718968996; x=1719573796; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cgq1OghRTQpWPIPh5SM3MxJFBQJBAY3NN025Q37Id8M=; b=CLXtLtX8c7C6khqzQ6phLdoEWz4MJBIwG4y7bqop6nTAor4wffRvgYbAvccDAp+Rqe BeleyMxht50y4kHVF3xTDOcHrRiebztnybecXC/OwFxs66xgQVCC+XoonpJfr/iMXtu2 t7Adx2jRBf22bqwunPe82BrcaZ1At+HlmBhGcMIb6UQwIEYQkQzLzFbBWDZRHW7EtPLc t0aIl2p8ts6pxPwfxnFpQzRf/YhlyWxLA9Q79F1kLJzhbKA1zpvEJUHSaGkHNP9Q1QqK XuvvTyY1imLGywFrUEQ4+SpwfJDnAxUemE63Tw3Kt/bOb+8XBy2Wl4CduazF9yAQS+0C 71nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718968996; x=1719573796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cgq1OghRTQpWPIPh5SM3MxJFBQJBAY3NN025Q37Id8M=; b=QRVDVGmszEatVU0fxUvcdMCbse98/FElieIeeNTJIaQK4t41q7S3YMySm4MTPSj1t3 Q+4DFsaoBR1FIbWJJzU28eHJtPtfCU0zuOpomCg4g4rNKFTe1fqSfR/bB+1yofgPZuv1 GF+qd06FOYHfD14SzXu+MNaSLoMraLg3ZCKNNpA7ffLuF/Xy9rSQRQXj9n6N2XProKYN yj6vbll2uC/QJz2ZO14PdWLPI/Cj/n/BqAeDlj4p3JBnexXbC82QKsCsBR0J4pDdDkuK byE+wOf3yUT13U9NtDKHWL0sas+bqcvhZtzx7NQFvfp93prmj05VjP+U1nZGaNBM/+2i B/kQ== X-Forwarded-Encrypted: i=1; AJvYcCU5gJEdX0gsojUDwjtEdVfBaY5210ddf/yUj+f5JDBnZyGZc4DcWVctLgpLwoClFmha/wIoJsiJD+UFcZ4AOlHUF/iYUTqVLWqmW+2l X-Gm-Message-State: AOJu0YwGclDaplfOLr4gWpDIIwHCsp9B+yYGA2RfB3G8iplLkQ1XwPHi PV0JLM54SOd6qfXTs//GDhbfY2m6LGwcd3d+FLfd6nTfebc/78nAh7+8XDEvNg4= X-Google-Smtp-Source: AGHT+IEs1anfd3yompMBKukVYfgrAHEqy/KpI7/nK6qHHwwIJuii2W5AgRvJ/UKk5m7gC+Xl4zJygQ== X-Received: by 2002:a17:906:da02:b0:a6f:314c:a75d with SMTP id a640c23a62f3a-a6fab7dda52mr469041566b.73.1718968995818; Fri, 21 Jun 2024 04:23:15 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:15 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 01/12] clk: renesas: r9a08g045: Add clock, reset and power domain support for I2C Date: Fri, 21 Jun 2024 14:22:52 +0300 Message-Id: <20240621112303.1607621-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Add clock, reset and power domain support for the I2C channels available on the Renesas RZ/G3S SoC. Signed-off-by: Claudiu Beznea --- drivers/clk/renesas/r9a08g045-cpg.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a0= 8g045-cpg.c index b068733b145f..a07eb3b359fc 100644 --- a/drivers/clk/renesas/r9a08g045-cpg.c +++ b/drivers/clk/renesas/r9a08g045-cpg.c @@ -213,6 +213,10 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[]= =3D { DEF_COUPLED("eth1_axi", R9A08G045_ETH1_CLK_AXI, R9A08G045_CLK_M0, 0x57c,= 1), DEF_COUPLED("eth1_chi", R9A08G045_ETH1_CLK_CHI, R9A08G045_CLK_ZT, 0x57c,= 1), DEF_MOD("eth1_refclk", R9A08G045_ETH1_REFCLK, R9A08G045_CLK_HP, 0x57c, 9= ), + DEF_MOD("i2c0", R9A08G045_I2C0_PCLK, R9A08G045_CLK_P0, 0x580, 0), + DEF_MOD("i2c1", R9A08G045_I2C1_PCLK, R9A08G045_CLK_P0, 0x580, 1), + DEF_MOD("i2c2", R9A08G045_I2C2_PCLK, R9A08G045_CLK_P0, 0x580, 2), + DEF_MOD("i2c3", R9A08G045_I2C3_PCLK, R9A08G045_CLK_P0, 0x580, 3), DEF_MOD("scif0_clk_pck", R9A08G045_SCIF0_CLK_PCK, R9A08G045_CLK_P0, 0x584= , 0), DEF_MOD("gpio_hclk", R9A08G045_GPIO_HCLK, R9A08G045_OSCCLK, 0x598, 0), }; @@ -227,6 +231,10 @@ static const struct rzg2l_reset r9a08g045_resets[] =3D= { DEF_RST(R9A08G045_SDHI2_IXRST, 0x854, 2), DEF_RST(R9A08G045_ETH0_RST_HW_N, 0x87c, 0), DEF_RST(R9A08G045_ETH1_RST_HW_N, 0x87c, 1), + DEF_RST(R9A08G045_I2C0_MRST, 0x880, 0), + DEF_RST(R9A08G045_I2C1_MRST, 0x880, 1), + DEF_RST(R9A08G045_I2C2_MRST, 0x880, 2), + DEF_RST(R9A08G045_I2C3_MRST, 0x880, 3), DEF_RST(R9A08G045_SCIF0_RST_SYSTEM_N, 0x884, 0), DEF_RST(R9A08G045_GPIO_RSTN, 0x898, 0), DEF_RST(R9A08G045_GPIO_PORT_RESETN, 0x898, 1), @@ -272,6 +280,18 @@ static const struct rzg2l_cpg_pm_domain_init_data r9a0= 8g045_pm_domains[] =3D { DEF_PD("eth1", R9A08G045_PD_ETHER1, DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(3)), RZG2L_PD_F_NONE), + DEF_PD("i2c0", R9A08G045_PD_I2C0, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(10)), + RZG2L_PD_F_NONE), + DEF_PD("i2c1", R9A08G045_PD_I2C1, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(11)), + RZG2L_PD_F_NONE), + DEF_PD("i2c2", R9A08G045_PD_I2C2, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(12)), + RZG2L_PD_F_NONE), + DEF_PD("i2c3", R9A08G045_PD_I2C3, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(13)), + RZG2L_PD_F_NONE), DEF_PD("scif0", R9A08G045_PD_SCIF0, DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(1)), RZG2L_PD_F_NONE), --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF66717334D for ; Fri, 21 Jun 2024 11:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969001; cv=none; b=ie5EJDSj8DCoEa0n75HFXuXeITY3OWP2Hk2Hpg2qlWwl++DWB4Oy51xVFahnJ8p7bMqJQAK4MCq0mEu3YTa3v0Px4RWvIaG5xS2ZobbSbYbgHznNnchJ6g43KaAs4/q6mr0BlUkeY9l1ETgkxX+PRPJcb92xlZ9wqcZ6kRUCAE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969001; c=relaxed/simple; bh=EXsxLarD5ClXmWdFfNRjLR3Hci/j/5hO4n+XcVx0/wg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s4Kr/49PF1i8mhMEPL+PRDlaPENkhpKLuCYAZZ5xb5ElVB3cAL8Pj7GgNBfgACf7XFDFSm/DaTX+4ObnxhAsxrixnuJh1QzyUi7BFg53oAR9z89Ecr3TTUnyzyG2uNWknX7k/dAjhgpzKGFHGEAxyfJvUsD6ZZ8ZVY7GccHturg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=BfiRKsZ7; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="BfiRKsZ7" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a6f09eaf420so213664966b.3 for ; Fri, 21 Jun 2024 04:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718968998; x=1719573798; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O3H2/xCH1KL76lyoZfUUQjrHXfexHfpjVXcG8XkXUMg=; b=BfiRKsZ7646iBbo5YNk1ABykSnJESmMWEvX9syDp2CtaoO6B12SxngOJQirCqrDepX nDwSsUv4sQcwdhKMT+PkQPWBo6M2fC9pQrH2HNxuxv6V7bX1aD2y5a235dTAD9nGmP6G VBv8bS9LjruW/or+/tgM/ncJie6Bm/M8JbvKHJF4EoIAKd+bHmvxxd53yJob0HwLjFJ+ xRPQe37aUSGGOd/SQlEWEAr9wKqH01BDc5q6ni5Cl6Q5IEa7Apmn77elNYwengeH+F8v OvFbYf5xwl8JA0Ht3jpdF4wmmgA9oKCtfLcVtdU9tltJ0toSAOttYUrC8zzEtJF4Nx3S R3VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718968998; x=1719573798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O3H2/xCH1KL76lyoZfUUQjrHXfexHfpjVXcG8XkXUMg=; b=hDO6nMePJg1Lu/jEtw5gOVNZZp48HIc2A0c6w57KZ2Q2XkgaeujMSboN0NHu1FPCE0 LpnpSHN2ZYnaNQ19wKlFDpFMcE6tRivJ/PuohY0l69tfcTlO5r0gRh2G8K8XL0BF7HjK wr0lvGMGgRZF5a09/sLOz9Rv3SGFyQjLkxWGXgiEIQJwT7HJwP5F4piiBehYvDhLzKb7 79eEQ1hFCkziXZ58T+JmumhNHPx4fdstlAw/y7ExAci15Syv+vudeVIcS2Et2pou7239 uIKCxBynP7EqRwurBBOHyu3/m5gvPV0UtBJuV2MCx3tG5VwnCnjJGlwrSuKw9NEFpeNl PNiA== X-Forwarded-Encrypted: i=1; AJvYcCXi5YiL5ss3gXYGEGI4n1N1KNcic9a6mfJPnOACoLj/6fGQBkbVmuluZ9e9YgLkExqKYe/OySUvRu/UlR09Kg84oR9av/QIuaB3cVJO X-Gm-Message-State: AOJu0YyMufuLsJEIs0svmskkQXE7ZPSaEyR1RadgCptNuKH2XCeMsLh5 s9NcIYPTmvroJSsijpuW6IInZE344PCJdvt1HM08JW4e96LLh4zFAsNKzuODvEM= X-Google-Smtp-Source: AGHT+IHNpJHjpYpjeVnsPvIvzyTvzFCXudzr8z4xB/fYWqy08HAHxV8RgGkWHWAPI9itD5sx9QL7iA== X-Received: by 2002:a17:907:a802:b0:a6f:bae8:f84a with SMTP id a640c23a62f3a-a6fbae8f920mr456177666b.20.1718968997999; Fri, 21 Jun 2024 04:23:17 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:17 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 02/12] i2c: riic: Use temporary variable for struct device Date: Fri, 21 Jun 2024 14:22:53 +0300 Message-Id: <20240621112303.1607621-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Use a temporary variable for the struct device pointers to avoid dereferencing. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index f608b1838cad..c08c988f50c7 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -131,11 +131,12 @@ static inline void riic_clear_set_bit(struct riic_dev= *riic, u8 clear, u8 set, u static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int = num) { struct riic_dev *riic =3D i2c_get_adapdata(adap); + struct device *dev =3D adap->dev.parent; unsigned long time_left; int i; u8 start_bit; =20 - pm_runtime_get_sync(adap->dev.parent); + pm_runtime_get_sync(dev); =20 if (riic_readb(riic, RIIC_ICCR2) & ICCR2_BBSY) { riic->err =3D -EBUSY; @@ -168,7 +169,7 @@ static int riic_xfer(struct i2c_adapter *adap, struct i= 2c_msg msgs[], int num) } =20 out: - pm_runtime_put(adap->dev.parent); + pm_runtime_put(dev); =20 return riic->err ?: num; } @@ -303,11 +304,12 @@ static int riic_init_hw(struct riic_dev *riic, struct= i2c_timings *t) int ret =3D 0; unsigned long rate; int total_ticks, cks, brl, brh; + struct device *dev =3D riic->adapter.dev.parent; =20 - pm_runtime_get_sync(riic->adapter.dev.parent); + pm_runtime_get_sync(dev); =20 if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) { - dev_err(&riic->adapter.dev, + dev_err(dev, "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ); ret =3D -EINVAL; @@ -347,7 +349,7 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) } =20 if (brl > (0x1F + 3)) { - dev_err(&riic->adapter.dev, "invalid speed (%lu). Too slow.\n", + dev_err(dev, "invalid speed (%lu). Too slow.\n", (unsigned long)t->bus_freq_hz); ret =3D -EINVAL; goto out; @@ -396,7 +398,7 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1); =20 out: - pm_runtime_put(riic->adapter.dev.parent); + pm_runtime_put(dev); return ret; } =20 @@ -415,13 +417,14 @@ static void riic_reset_control_assert(void *data) =20 static int riic_i2c_probe(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct riic_dev *riic; struct i2c_adapter *adap; struct i2c_timings i2c_t; struct reset_control *rstc; int i, ret; =20 - riic =3D devm_kzalloc(&pdev->dev, sizeof(*riic), GFP_KERNEL); + riic =3D devm_kzalloc(dev, sizeof(*riic), GFP_KERNEL); if (!riic) return -ENOMEM; =20 @@ -429,22 +432,22 @@ static int riic_i2c_probe(struct platform_device *pde= v) if (IS_ERR(riic->base)) return PTR_ERR(riic->base); =20 - riic->clk =3D devm_clk_get(&pdev->dev, NULL); + riic->clk =3D devm_clk_get(dev, NULL); if (IS_ERR(riic->clk)) { - dev_err(&pdev->dev, "missing controller clock"); + dev_err(dev, "missing controller clock"); return PTR_ERR(riic->clk); } =20 - rstc =3D devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); + rstc =3D devm_reset_control_get_optional_exclusive(dev, NULL); if (IS_ERR(rstc)) - return dev_err_probe(&pdev->dev, PTR_ERR(rstc), + return dev_err_probe(dev, PTR_ERR(rstc), "Error: missing reset ctrl\n"); =20 ret =3D reset_control_deassert(rstc); if (ret) return ret; =20 - ret =3D devm_add_action_or_reset(&pdev->dev, riic_reset_control_assert, r= stc); + ret =3D devm_add_action_or_reset(dev, riic_reset_control_assert, rstc); if (ret) return ret; =20 @@ -453,29 +456,29 @@ static int riic_i2c_probe(struct platform_device *pde= v) if (ret < 0) return ret; =20 - ret =3D devm_request_irq(&pdev->dev, ret, riic_irqs[i].isr, + ret =3D devm_request_irq(dev, ret, riic_irqs[i].isr, 0, riic_irqs[i].name, riic); if (ret) { - dev_err(&pdev->dev, "failed to request irq %s\n", riic_irqs[i].name); + dev_err(dev, "failed to request irq %s\n", riic_irqs[i].name); return ret; } } =20 - riic->info =3D of_device_get_match_data(&pdev->dev); + riic->info =3D of_device_get_match_data(dev); =20 adap =3D &riic->adapter; i2c_set_adapdata(adap, riic); strscpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name)); adap->owner =3D THIS_MODULE; adap->algo =3D &riic_algo; - adap->dev.parent =3D &pdev->dev; - adap->dev.of_node =3D pdev->dev.of_node; + adap->dev.parent =3D dev; + adap->dev.of_node =3D dev->of_node; =20 init_completion(&riic->msg_done); =20 - i2c_parse_fw_timings(&pdev->dev, &i2c_t, true); + i2c_parse_fw_timings(dev, &i2c_t, true); =20 - pm_runtime_enable(&pdev->dev); + pm_runtime_enable(dev); =20 ret =3D riic_init_hw(riic, &i2c_t); if (ret) @@ -487,24 +490,24 @@ static int riic_i2c_probe(struct platform_device *pde= v) =20 platform_set_drvdata(pdev, riic); =20 - dev_info(&pdev->dev, "registered with %dHz bus speed\n", - i2c_t.bus_freq_hz); + dev_info(dev, "registered with %dHz bus speed\n", i2c_t.bus_freq_hz); return 0; =20 out: - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); return ret; } =20 static void riic_i2c_remove(struct platform_device *pdev) { struct riic_dev *riic =3D platform_get_drvdata(pdev); + struct device *dev =3D &pdev->dev; =20 - pm_runtime_get_sync(&pdev->dev); + pm_runtime_get_sync(dev); riic_writeb(riic, 0, RIIC_ICIER); - pm_runtime_put(&pdev->dev); + pm_runtime_put(dev); i2c_del_adapter(&riic->adapter); - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); } =20 static const struct riic_of_data riic_rz_a_info =3D { --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E10EB175543 for ; Fri, 21 Jun 2024 11:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969003; cv=none; b=BM1bVAApMau4jP9ZWhrvlkk+v+Obw1PpTCaHRb1QDI+PYdVD8rwQ2IGa7V3r/bpKzbCDvwVgorGHaVvkHDl1dLr+83F11JSUXT3MbZRfq0FihEgCmcYwZ2X+BLks4wYFX5NH/6A5iRhusvAoBIzteHsGrjQJZrppt7lP9hpZlLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969003; c=relaxed/simple; bh=NQzIWHZbQOQ5hZWT2KZyCkN3O4AwH2pGjBQniFQN5pM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QEvQSyQM0NvPOL8zBaCFpWDNZP/e3Q0eUKQSAO8TATqzEnWzYBgArsXKjQNYCOXZo7bI8kw5RC/p22viF5P+oku8PwIpbjlt9wn2FS2AiA2BgDYicvenUUS0bkTLlxoZcpt6mKuu9WM7AJ5ksEeYJzlm/ZNokmprV0iRMrRkGHs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=Vpd8Nudd; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="Vpd8Nudd" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a6ef793f4b8so194155166b.1 for ; Fri, 21 Jun 2024 04:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969000; x=1719573800; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I0bK5sELhW9b20RoSzNu6z24gTPhP8Pd9YLVyDsBpSI=; b=Vpd8NuddfU3hYmAsYrmQjUyfigmwDidsq10zMqD4nDZOEIH19NUoCE36RyWvLqFGbs gmjnxRqAFzvNZ2/4PeDTs6y5KchXLY6uP4hIIjmPEljXRa+uYt8kmFVYr9/A9LUjS9Db sguWhi/FssnW9TONpiF2EqMU9Wasi0n6kxWXz8gevLFditWhbUB/PCK/ntGMDMy1gOwQ qeCR248ZM47wWVYCSeaXhXmTYm7osLOhJAY2CJTFTx/oGb+VKTvOQJJGkp+4HC1QtHQX HhiR5SwzCKy5cCbO0J0c91P9yVzAvVNrV+ymyA2CCGT4yNPxSHCTUoykGAMTbwof3ouw P4sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969000; x=1719573800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I0bK5sELhW9b20RoSzNu6z24gTPhP8Pd9YLVyDsBpSI=; b=t7SWmdpWJU/B05DFaoVskVtTtavRxzu20I86+TIChzgHrcl9K8qNhY6np9hWQqiKqh /1uijYEuqywbCBRBBIqJ9fUyQaGDEyqEfJQTLRSsQFePnm8HQjWHz45gNL7wXdXCuEi9 0aN8QRlii+TvoBhvqxTLF60DNm2E4AmNJUwbh54YAT9PoUfh/YY2yXoQ2xQqcqXEx4Jv AKhABCKIx7ik8O6a78pDmqWb4qYiXNCzvlcx437RmC5NuOl1U8ae+BJtmZP8gIopKXmE FJf+9yrbnfeXkj2OwZuoODAMTkPrUckIfdihiDqQGEfGFfxF9rYGRJWwluvnM3nIr8QO prWA== X-Forwarded-Encrypted: i=1; AJvYcCVcDCuO4uBkcNYNikdgkXgNRecwlHnMz1S7KDZDPI20umN+0WAd1IRrc2RSTsRA6OdCZATL3SblHNPFf4nrMzd0hkDP9UMeuf2dzkt4 X-Gm-Message-State: AOJu0YwUWYa8sxIy/a+6LxgALakE1pHjHrYzkbicM0SVEH+W3lzCjIsR TZLAamdq0DDyojDh7nuVufLX4a2ZIu/eLq6ESHJiS6NCAYcH1o2jnRyVjPeUW34= X-Google-Smtp-Source: AGHT+IGllrhtLTISfndDW1RoyJxEoneoZGKfLjhvsC7mU4Me34BDPAm0LGxD7vGESeYf1S8qDoqr7g== X-Received: by 2002:a17:906:bf45:b0:a6e:f91e:efd0 with SMTP id a640c23a62f3a-a6fab779a0fmr562920966b.56.1718969000335; Fri, 21 Jun 2024 04:23:20 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:19 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 03/12] i2c: riic: Call pm_runtime_get_sync() when need to access registers Date: Fri, 21 Jun 2024 14:22:54 +0300 Message-Id: <20240621112303.1607621-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea There is no need to runtime resume the device as long as the IP registers are not accessed. Calling pm_runtime_get_sync() at the register access time leads to a simpler error path. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index c08c988f50c7..83e4d5e14ab6 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -301,19 +301,15 @@ static const struct i2c_algorithm riic_algo =3D { =20 static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t) { - int ret =3D 0; unsigned long rate; int total_ticks, cks, brl, brh; struct device *dev =3D riic->adapter.dev.parent; =20 - pm_runtime_get_sync(dev); - if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) { dev_err(dev, "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ); - ret =3D -EINVAL; - goto out; + return -EINVAL; } =20 rate =3D clk_get_rate(riic->clk); @@ -351,8 +347,7 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) if (brl > (0x1F + 3)) { dev_err(dev, "invalid speed (%lu). Too slow.\n", (unsigned long)t->bus_freq_hz); - ret =3D -EINVAL; - goto out; + return -EINVAL; } =20 brh =3D total_ticks - brl; @@ -384,6 +379,8 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) t->scl_fall_ns / (1000000000 / rate), t->scl_rise_ns / (1000000000 / rate), cks, brl, brh); =20 + pm_runtime_get_sync(dev); + /* Changing the order of accessing IICRST and ICE may break things! */ riic_writeb(riic, ICCR1_IICRST | ICCR1_SOWP, RIIC_ICCR1); riic_clear_set_bit(riic, 0, ICCR1_ICE, RIIC_ICCR1); @@ -397,9 +394,8 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) =20 riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1); =20 -out: pm_runtime_put(dev); - return ret; + return 0; } =20 static struct riic_irq_desc riic_irqs[] =3D { --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3875A176226 for ; Fri, 21 Jun 2024 11:23:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969005; cv=none; b=OD5il0Gu/0uDjBFo15X+uyeUzj4qB6u0faG3Ih6IC+oYVp4haCz6JqfDuO+SdxiWPFW8OjsE3PWzAe7FjLZPVA1O1debTvwtnyNq36TDuCba1SVuMdqnKmibLHv+ysA5Zp1lOWBRQ/n80BufcMUKY8FebWVhtdtZfZ0Bigvw3VU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969005; c=relaxed/simple; bh=S1hm/Q+NuAcT9nxD/pVjadLD+I32CWUrwiArUqlGHZ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G8iYhYA0AZbK+nyso/9WI8oQVqjVwt49JOT/5//y9lrb5Fpz5Y88ldCiDMkoAyBR6uhclv1DVr7erOyN8PGzmfbKdNAyVYMsN56EQ0cB00XZKrZSlFzA57cMq7vfKXLvEX/tBsntilZneESSpJ0ZWLO5VYGQ1XaTQy1ohciC0zY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=GeZynVUt; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="GeZynVUt" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a6fb696d2e5so214019966b.3 for ; Fri, 21 Jun 2024 04:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969002; x=1719573802; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Q2S7HvfURtpVg3mGnjpDhomnr+bQTG6duN65cLSQuA=; b=GeZynVUtyNJ7ICUa+oeTYkvg05nCPYCHKrpxNRu4oAGR1PUDDW8QksNp7RoW9xMo47 EVz3gZiymrJhwTrnfKlyVGH2MZpCmoJ0RI45l0Kotpu88fhvliOoKIRMCEOv91KxcF5+ BI4pSgZ5Ajtn50Aw79Sg914/BstzazII0MW03GrTQBlX9tKzVDSK7v3MASrWpl8f4T2M rbCTY2T0gJ0zNPi+KBTWvL0stojZ+1T6SRt9yTX1rRuY8GnI/d+Wt/8d79enhuz25WM4 FbljAahvZX26/5fSR1nDXCwi+KXZmZMANLYoPlz2PEqwV7+KIXshqcXjph6CVjXIZh8z ADMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969002; x=1719573802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Q2S7HvfURtpVg3mGnjpDhomnr+bQTG6duN65cLSQuA=; b=f/bas4GC3livgBAVgfl5y7knwiU87EDyjdhGd5K+19jsATdeCNuuRYTAQVJtSwcSqz f9JXRg3CRIqf66tIKMCjpqk5cAuVtnVLo6C1C7SDIz5ucMif2nr+k7oQE4pZ432yczbS 2NSFjHFoUvJ7uFbkNx2Rnv07CdleeROwbaxjileRroDQXHogS/FOWlgMYlVUjbvO4q3D QDyODzEwCgucj3XK/CJJhmcBxmaT+RDs0HKis9XDIrj4yf61nCmFN7GiaIwgfZsyXJCU 0xLKeKRY38wo5wKXz9qoNu/EyhmQHCbmDL/io8yHy2CQSqPmmqAjS790EcCvyT+hIc7j MAgw== X-Forwarded-Encrypted: i=1; AJvYcCVfKr0a21vJK2lwtaS/evwxuHR+sqoktnMxdmWTimUyEJOen91YqSTh8V3X2A6XGHAu52kifLQNIGm2Sx9wialN0dpep4Eht8U8Apps X-Gm-Message-State: AOJu0Yy84fZ0qujEiSIEs+XQLgrjMS31bRM62NO045twmmHcz1A/UMJs OvhWNGcGgqaO2BiBau+yCZBU35MsHBokp5iYsICnmhxb0mV0u19Y2x7ycvAkcZ0= X-Google-Smtp-Source: AGHT+IFBywlMwo6ddeYYu3/kNuX5vO5gDzF03oKjx3N6oQ3I7NwLK+CukGLkpEtNcx6M4DcPC6fEDA== X-Received: by 2002:a17:906:c385:b0:a6f:5fc2:fe8b with SMTP id a640c23a62f3a-a6fab62f61dmr408251266b.32.1718969002596; Fri, 21 Jun 2024 04:23:22 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:22 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 04/12] i2c: riic: Use pm_runtime_resume_and_get() Date: Fri, 21 Jun 2024 14:22:55 +0300 Message-Id: <20240621112303.1607621-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea pm_runtime_get_sync() may return with error. In case it returns with error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 83e4d5e14ab6..6b739483ef37 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -113,6 +113,8 @@ struct riic_irq_desc { char *name; }; =20 +static const char * const riic_rpm_err_msg =3D "Failed to runtime resume"; + static inline void riic_writeb(struct riic_dev *riic, u8 val, u8 offset) { writeb(val, riic->base + riic->info->regs[offset]); @@ -133,10 +135,14 @@ static int riic_xfer(struct i2c_adapter *adap, struct= i2c_msg msgs[], int num) struct riic_dev *riic =3D i2c_get_adapdata(adap); struct device *dev =3D adap->dev.parent; unsigned long time_left; - int i; + int i, ret; u8 start_bit; =20 - pm_runtime_get_sync(dev); + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + dev_err(dev, riic_rpm_err_msg); + return ret; + } =20 if (riic_readb(riic, RIIC_ICCR2) & ICCR2_BBSY) { riic->err =3D -EBUSY; @@ -301,6 +307,7 @@ static const struct i2c_algorithm riic_algo =3D { =20 static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t) { + int ret; unsigned long rate; int total_ticks, cks, brl, brh; struct device *dev =3D riic->adapter.dev.parent; @@ -379,7 +386,11 @@ static int riic_init_hw(struct riic_dev *riic, struct = i2c_timings *t) t->scl_fall_ns / (1000000000 / rate), t->scl_rise_ns / (1000000000 / rate), cks, brl, brh); =20 - pm_runtime_get_sync(dev); + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + dev_err(dev, riic_rpm_err_msg); + return ret; + } =20 /* Changing the order of accessing IICRST and ICE may break things! */ riic_writeb(riic, ICCR1_IICRST | ICCR1_SOWP, RIIC_ICCR1); @@ -498,8 +509,14 @@ static void riic_i2c_remove(struct platform_device *pd= ev) { struct riic_dev *riic =3D platform_get_drvdata(pdev); struct device *dev =3D &pdev->dev; + int ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + dev_err(dev, riic_rpm_err_msg); + return; + } =20 - pm_runtime_get_sync(dev); riic_writeb(riic, 0, RIIC_ICIER); pm_runtime_put(dev); i2c_del_adapter(&riic->adapter); --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28349176AA2 for ; Fri, 21 Jun 2024 11:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969008; cv=none; b=t+NqNBIrBIaXl4+vZ3nBVKRYkvZuteSkWe68qOlb0PoK2gnU/R9U+T0Sahy5WEnz/3tNdmUbfOSJGDwVK/+Jd75JVfSuY2h7+3B2Csr2VtseLfmvbby3Q9Z1F/Ajs4ve2la+XQAuB6SOnoFvzCjvyX8egQFdBC1aYGMXYeXXnkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969008; c=relaxed/simple; bh=wovYL+KBiDSSeNAZuqj5Clu00lS6lYUfaKOjsQH6z1I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rqf1f+uKSovI5eGDm40gnq8w/x3Sx2n3snMsamuq3Kss+0EPnQA5+7drmimJcmd1hcz1OsmozHdybbEpqSM5N9arGh7Dj18cO7Pk7j3Lb0tZhdRon1LpMPeVbH5BOHR7s1QAxgAJqbZd6vQR1BVOAPTbz0fx3Y2cMx3MD7zVGks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=DxdgPVxd; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="DxdgPVxd" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a6f1c4800easo209797266b.3 for ; Fri, 21 Jun 2024 04:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969005; x=1719573805; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dW9T/eZM5RV9t43dNQ65JhpJklu5g8GWF2aDPxi7wbI=; b=DxdgPVxdNQdH85Kp1i4VWsWAgJ3HtfIyaLY4BZz6QHWxDAP4zhdUXom5tupZJhc8Mp 8O4OMWAm1jHiiahWlnwQc0zPtKT45bsoZ6MqhII3ZbYLca0HIC4s+ba8loBEDXGMNJOP LvVzCSkghK4nPykmblRYAFgP2QlTc5i8wKjwlL90T9X5lNz1ZetDTVtV/QQ2zi6JJNJH tLmHJXRUA5yrUMTQZrne2RAgWRBCWgAAa+9UXydzcc/GM2+miV6T/djEELurH8g8J1uD wSm0RKNnf9kzCH78uDSxhXGURYLR9HoZS7pMCfxX31uZ7bCr9I3ARmZY1PSAliZn5/3F j6zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969005; x=1719573805; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dW9T/eZM5RV9t43dNQ65JhpJklu5g8GWF2aDPxi7wbI=; b=JWu2Hywyre53w1wtxE+HmqVV9erNXuHd8QxSleUXUTwhRsXkryitAbjr3J1CBszgjM Dp7nw7wSB6HP32EThQbJDUSKmHguUVuNibi91aQSoI9bxajQdPm7ZFQjl5jY2lPaD9J5 entqwUmw92BJJeZVBZaCelzlL8DVjCfHIk2qdtqIOpjCV6IzPIi/eeUH0frjiyZF6fP6 +Ge86Ea6uPoJAxSgQa94NqEnLGv/yzNDc7im6oApWSHGwF92VUHEaRk9rqkho4sHs+ta NUO+V+PcSKp9eaS8aM996TQiZSURt6KnLWgncRGjfpiwbhNWoWm3qBu2ZmhMHSCfnOgQ +OKg== X-Forwarded-Encrypted: i=1; AJvYcCUyLQIaR9vp+I/WHQv9t62D/VK11DP0MI4cYcphm54/r+Mq02tSJqKIk/3lTcJO/faRTaPr57TAvvRxT0Lktz1tDUO0oTX4uq6LHVHU X-Gm-Message-State: AOJu0YwXvIwEnxVM8/1KyCsc2zv2IBQrG/6vunflLiK3upz2ROXI8Nrg C9sETch7ZS2UhJF3QFsoi7c7/j4VN3bd4CM5zdxkq5IBVSK+oEH0J48oQZgSOMk= X-Google-Smtp-Source: AGHT+IFy1kAEcnlAOSo5nHvfvKjAEwLrS0YbBwtI4Y6CfpkEaCc5opX+RA9D00tsKvOBrO+igWIdbg== X-Received: by 2002:a17:907:c80a:b0:a6f:bdb3:9748 with SMTP id a640c23a62f3a-a6fbdb397e2mr314408366b.33.1718969005480; Fri, 21 Jun 2024 04:23:25 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:24 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 05/12] i2c: riic: Enable runtime PM autosuspend support Date: Fri, 21 Jun 2024 14:22:56 +0300 Message-Id: <20240621112303.1607621-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Enable runtime PM autosuspend support for the RIIC driver. With this, in case there are consecutive xfer requests the device wouldn't be runtime enabled/disabled after each consecutive xfer but after the the delay configured by user. With this, we can avoid touching hardware registers involved in runtime PM suspend/resume saving in this way some cycles. The default chosen autosuspend delay is zero to keep the previous driver behavior. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 6b739483ef37..00fb09786e48 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -175,7 +175,8 @@ static int riic_xfer(struct i2c_adapter *adap, struct i= 2c_msg msgs[], int num) } =20 out: - pm_runtime_put(dev); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); =20 return riic->err ?: num; } @@ -405,7 +406,8 @@ static int riic_init_hw(struct riic_dev *riic, struct i= 2c_timings *t) =20 riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1); =20 - pm_runtime_put(dev); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); return 0; } =20 @@ -485,6 +487,8 @@ static int riic_i2c_probe(struct platform_device *pdev) =20 i2c_parse_fw_timings(dev, &i2c_t, true); =20 + pm_runtime_set_autosuspend_delay(dev, 0); + pm_runtime_use_autosuspend(dev); pm_runtime_enable(dev); =20 ret =3D riic_init_hw(riic, &i2c_t); @@ -502,6 +506,7 @@ static int riic_i2c_probe(struct platform_device *pdev) =20 out: pm_runtime_disable(dev); + pm_runtime_dont_use_autosuspend(dev); return ret; } =20 @@ -521,6 +526,7 @@ static void riic_i2c_remove(struct platform_device *pde= v) pm_runtime_put(dev); i2c_del_adapter(&riic->adapter); pm_runtime_disable(dev); + pm_runtime_dont_use_autosuspend(dev); } =20 static const struct riic_of_data riic_rz_a_info =3D { --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31A19176ACA for ; Fri, 21 Jun 2024 11:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969011; cv=none; b=fZgq4keFI1eYBTgwLGPc+WCCwQVoEglrkoSKdbHqXLZZSfM0L5Oc9UkdRGqiS0fpHwqJlG+NQ6sFCDZy927vrSNJFdE+Ylgocg80LCYSsismXORw5uDbSF/x9NWc89G/M68NBJilCVkTA5NjzqG3rIZ3kaG/QJKtY1StfeYHhN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969011; c=relaxed/simple; bh=HPttF8PMIfMdD0q3vRsNpNkTZTwvPxmdjIPSC65SLag=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oMlNkMOWpgX/Lhnj7gIlmO8WkwyBmMpePMNE1vIuZZoQ+ctCm4y3Qg2ruNvqe8+e307VAhgNdgezsmYG5olb9Lx5lDt5lKzcW8ZxzQ/squxp53cLv0toixYtwNxIAD2XNIIDPhvlRabaDUbuFaN5a/47GLrMicR9Juth112jlMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=AFVzbYTP; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="AFVzbYTP" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-57d26a4ee65so1577017a12.2 for ; Fri, 21 Jun 2024 04:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969007; x=1719573807; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TB4G6RBUncwv9ha85OdZCXvfKxm1R3567nIHgdG02RA=; b=AFVzbYTPrs7tpSfVyar+gnjV8v+AvLQeKeRXyIdAV1fx8vJ6nNGPZWDhN1AIPtGrJa um/eMLBe0Mcyi0uEe2kIjuSHL/dsG/E2dWgjdZ/6V9nTPE+mc//I0MtAi1mvREh6ZAt9 Anooj6gMP6iO01rMulWRRiOG6yub36AKmwI/e3+2a0a0ZIGPW5mUG333HOjb/YLj7qst J7dAws99LOHPJAvqfu73JaLhiGaSr0nAOpewgNZL+5zYC7m2jFHXyYs0FNy20rgOxJZ6 8hGcLJucbu1XtDlPKWL3/weokY5VbL2GlFgYxtukoxWX31SI3MtE3rGBhugQXNf2kRnH eEHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969007; x=1719573807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TB4G6RBUncwv9ha85OdZCXvfKxm1R3567nIHgdG02RA=; b=NTWEOxisd4Sozbb9sJJWwx2b+Be9mg+OH0UjWcr/Y6dO2Z5xOeIHYuZ8GgqvvV6vZl d4cv5qRKNvc/+9RA2ZTr8LtDP8PCGtWMvh7TdsA/EFaVKAj6VAihRT2/keZNY+R8beVD lMOY/ZwUgEpdZ8PMZ9L/UEObJaxTa2rzFk+C+djzq8Ak2FvjsBN8Sf+3ugWiOJwDW3To OBQEMZB0Ldc8uyQgPO+NQFuX4rhkfHNUcqHwGWpI3QR+BBW3GzqeBm3pJcykcBd1zfGN q8fEh/NlZpVVKs5YTBazobE8bDiXE9mjpHBmUyXsa0Eted37yS+Fv7MgDkEl66iuYci2 oehw== X-Forwarded-Encrypted: i=1; AJvYcCWzorszmjknZYWlONXCNcvcTqojHCEic3rIthojZWpHA5J5pONLRlEs/0QI817rIBSHuNs9MTlgOZWOgfZ5/iql4BmhPDbmCOz4BHSi X-Gm-Message-State: AOJu0YzBYw4+wcJThjM3Ehqvqhq1zr9OXEpoF81/w2CPmRzDkYcn2zbs 4NbSjWVW8DZ+SOXXAPnS4xY+rDVCaNGNXrg9MIhjJ9O/zJsH1Cn0CaCqf1B5gx0= X-Google-Smtp-Source: AGHT+IHR6ZQF+USh+Vr/BefMKv7g9tmizkZF6pClxkCR0ycBdTVyYUBcww2griHlTmLatTTejdlU7Q== X-Received: by 2002:a17:907:6a13:b0:a6f:24fe:f2a7 with SMTP id a640c23a62f3a-a6fab6031e1mr489221866b.10.1718969007614; Fri, 21 Jun 2024 04:23:27 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:27 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 06/12] i2c: riic: Add suspend/resume support Date: Fri, 21 Jun 2024 14:22:57 +0300 Message-Id: <20240621112303.1607621-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Add suspend/resume support for the RIIC driver. This is necessary for the Renesas RZ/G3S SoC which support suspend to deep sleep state where power to most of the SoC components is turned off. As a result the I2C controller needs to be reconfigured after suspend/resume. For this, the reset line was stored in the driver private data structure as well as i2c timings. The reset line and I2C timings are necessary to re-initialize the controller after resume. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 66 +++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 00fb09786e48..f9b9e92570d8 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -105,6 +105,8 @@ struct riic_dev { struct completion msg_done; struct i2c_adapter adapter; struct clk *clk; + struct reset_control *rstc; + struct i2c_timings i2c_t; }; =20 struct riic_irq_desc { @@ -306,11 +308,12 @@ static const struct i2c_algorithm riic_algo =3D { .functionality =3D riic_func, }; =20 -static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t) +static int riic_init_hw(struct riic_dev *riic) { int ret; unsigned long rate; int total_ticks, cks, brl, brh; + struct i2c_timings *t =3D &riic->i2c_t; struct device *dev =3D riic->adapter.dev.parent; =20 if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) { @@ -429,8 +432,6 @@ static int riic_i2c_probe(struct platform_device *pdev) struct device *dev =3D &pdev->dev; struct riic_dev *riic; struct i2c_adapter *adap; - struct i2c_timings i2c_t; - struct reset_control *rstc; int i, ret; =20 riic =3D devm_kzalloc(dev, sizeof(*riic), GFP_KERNEL); @@ -447,16 +448,16 @@ static int riic_i2c_probe(struct platform_device *pde= v) return PTR_ERR(riic->clk); } =20 - rstc =3D devm_reset_control_get_optional_exclusive(dev, NULL); - if (IS_ERR(rstc)) - return dev_err_probe(dev, PTR_ERR(rstc), + riic->rstc =3D devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(riic->rstc)) + return dev_err_probe(dev, PTR_ERR(riic->rstc), "Error: missing reset ctrl\n"); =20 - ret =3D reset_control_deassert(rstc); + ret =3D reset_control_deassert(riic->rstc); if (ret) return ret; =20 - ret =3D devm_add_action_or_reset(dev, riic_reset_control_assert, rstc); + ret =3D devm_add_action_or_reset(dev, riic_reset_control_assert, riic->rs= tc); if (ret) return ret; =20 @@ -485,13 +486,13 @@ static int riic_i2c_probe(struct platform_device *pde= v) =20 init_completion(&riic->msg_done); =20 - i2c_parse_fw_timings(dev, &i2c_t, true); + i2c_parse_fw_timings(dev, &riic->i2c_t, true); =20 pm_runtime_set_autosuspend_delay(dev, 0); pm_runtime_use_autosuspend(dev); pm_runtime_enable(dev); =20 - ret =3D riic_init_hw(riic, &i2c_t); + ret =3D riic_init_hw(riic); if (ret) goto out; =20 @@ -501,7 +502,7 @@ static int riic_i2c_probe(struct platform_device *pdev) =20 platform_set_drvdata(pdev, riic); =20 - dev_info(dev, "registered with %dHz bus speed\n", i2c_t.bus_freq_hz); + dev_info(dev, "registered with %dHz bus speed\n", riic->i2c_t.bus_freq_hz= ); return 0; =20 out: @@ -561,6 +562,48 @@ static const struct riic_of_data riic_rz_v2h_info =3D { }, }; =20 +static int riic_i2c_suspend(struct device *dev) +{ + struct riic_dev *riic =3D dev_get_drvdata(dev); + int ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + i2c_mark_adapter_suspended(&riic->adapter); + + /* Disable output on SDA, SCL pins. */ + riic_clear_set_bit(riic, ICCR1_ICE, 0, RIIC_ICCR1); + + pm_runtime_mark_last_busy(dev); + pm_runtime_put_sync(dev); + + return reset_control_assert(riic->rstc); +} + +static int riic_i2c_resume(struct device *dev) +{ + struct riic_dev *riic =3D dev_get_drvdata(dev); + int ret; + + ret =3D reset_control_deassert(riic->rstc); + if (ret) + return ret; + + ret =3D riic_init_hw(riic); + if (ret) + return ret; + + i2c_mark_adapter_resumed(&riic->adapter); + + return 0; +} + +static const struct dev_pm_ops riic_i2c_pm_ops =3D { + SYSTEM_SLEEP_PM_OPS(riic_i2c_suspend, riic_i2c_resume) +}; + static const struct of_device_id riic_i2c_dt_ids[] =3D { { .compatible =3D "renesas,riic-rz", .data =3D &riic_rz_a_info }, { .compatible =3D "renesas,riic-r9a09g057", .data =3D &riic_rz_v2h_info }, @@ -573,6 +616,7 @@ static struct platform_driver riic_i2c_driver =3D { .driver =3D { .name =3D "i2c-riic", .of_match_table =3D riic_i2c_dt_ids, + .pm =3D pm_ptr(&riic_i2c_pm_ops), }, }; =20 --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D22DC176FB4 for ; Fri, 21 Jun 2024 11:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969013; cv=none; b=MvXNwHe6EbwX6S4NowGi5cIVVdFKRBnYjUMDCI6H1z+a8hb2NQXbeZ8X00U/QOk2JiK4HrN/QdfEFHYPjjFQ22HT8SGbr184bkcJxzNR3Mi+BO1qylzo3nKlIZNIn/0dTyGUH3+2gqy+GRVLMG/2G+kuz/zF+3wEHtNPKQDPrNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969013; c=relaxed/simple; bh=RfYez9u5Ak2SMIO0DEHAa2+9k5wdFaN5G9kzhpx8cZo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nAu8XFdT4upQ0hU81qCEENwgB5wVWWroQUxThl9qft6LfWRO9qt+iPcYlIielQtPCXfcNFsBXYu5NLEaqWvaT2ULHLXKTrJdlqTYrhlRWyLSM/WXrybycsq99FScKGgcRUuVPV2c/BoEuz9+fp0GRpH3FWhXz0LXyoGmi34M/9c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=OfOAIeJ5; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="OfOAIeJ5" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a6f9fe791f8so312937266b.0 for ; Fri, 21 Jun 2024 04:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969010; x=1719573810; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kPhmKh5jKgJmuUvvPetSNlsnz5DPCDUj94A1k27txko=; b=OfOAIeJ5F+54whmteMS9xrDZDP7rZV5fI9cAb6a4Jn6AbUzHX9Jqqy1pXUXoWuY8U2 hennh1NLa2fGRyK3jRmFH+Bh1mMNKrpFlZErJxEzkjcWufrh8vP50IUfmAUHo1AVJ0vm ryGWXbH8+D7iuyUQw9wLDDb6Q7uNbarDpByElsVTp3KcQF8sXIBsB6TEmk4evkaUGPeo Z3JNY1voMdaUfRad7KQdkV5ReTUmjV92rk1Ewt7cwaHYt0sT/+Yf3Kb/MR0FDQubkqyV yWM/pbQjwlfal6KoO2TC9FTYi+pOdfJyet59hNAULGXIpS3Qm2Iqfu1AJqUlAIo2NYOA a/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969010; x=1719573810; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kPhmKh5jKgJmuUvvPetSNlsnz5DPCDUj94A1k27txko=; b=sqi/uvTS4NekVLmk0AI66OBDVVvi5uTJsvXz+4BzyRA6fEkhgaf47CwRyQHLSn0EIr BSTBxUMJgKdeaRnNSVIKcaQ8P/NvsAVfZM7P9RhSB3yCzCGnuoejXylMgY00l6RP14hG aEWv1orOrCaGa3R6PY6Lgvw+AC6IAW1yS+QHtPu05DLwmsf1HnYgadbH7lcKckXly+w8 tzDpPL5OEV/PPTOXHDYt2vJV917jnogBkn4OileEeMvQQPK7+S+mA4z5vIvZyH0GaL/k 2RzEop+O8+UsfqvRydJjJ1alRfKVvgiB8+DKdvvU6QMDN2iEpWyR6z4EI+sLkDcr8iWT PcnQ== X-Forwarded-Encrypted: i=1; AJvYcCV1ddWmNsx9kbg1CTwTxY66/yxugp9XwKNpEflOoDEcq/bP+IlB+ITSRml34gB/oqaKgGJhLChvbkPDHFHmLbzyfKcioupV7obNl9Nk X-Gm-Message-State: AOJu0YzL9VZrUjJzpYz7C3ZSnWC1Q9zXgIH1H3bmVtYlZfagWw5EIHzY 6+jEimU1dkta5fTzyvfqSWo1NDL9O18199BXlg+utuqlTWhn1FGO5dF01JF7OjM= X-Google-Smtp-Source: AGHT+IHBTxiQrf0wAKOR2ezweJqHlvILVoM5bIbyJNw7cBRiSN/Ej9U9o9S0APKYUNMc2fthSYB+Pw== X-Received: by 2002:a17:906:b318:b0:a6f:259d:9a5f with SMTP id a640c23a62f3a-a6f9508e83cmr703320166b.35.1718969010055; Fri, 21 Jun 2024 04:23:30 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:29 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 07/12] i2c: riic: Define individual arrays to describe the register offsets Date: Fri, 21 Jun 2024 14:22:58 +0300 Message-Id: <20240621112303.1607621-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Define individual arrays to describe the register offsets. In this way we can describe different IP variants that share the same register offsets but have differences in other characteristics. Commit prepares for the addition of fast mode plus. Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 58 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index f9b9e92570d8..46070f323810 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -91,7 +91,7 @@ enum riic_reg_list { }; =20 struct riic_of_data { - u8 regs[RIIC_REG_END]; + const u8 *regs; }; =20 struct riic_dev { @@ -530,36 +530,40 @@ static void riic_i2c_remove(struct platform_device *p= dev) pm_runtime_dont_use_autosuspend(dev); } =20 +static const u8 riic_rz_a_regs[RIIC_REG_END] =3D { + [RIIC_ICCR1] =3D 0x00, + [RIIC_ICCR2] =3D 0x04, + [RIIC_ICMR1] =3D 0x08, + [RIIC_ICMR3] =3D 0x10, + [RIIC_ICSER] =3D 0x18, + [RIIC_ICIER] =3D 0x1c, + [RIIC_ICSR2] =3D 0x24, + [RIIC_ICBRL] =3D 0x34, + [RIIC_ICBRH] =3D 0x38, + [RIIC_ICDRT] =3D 0x3c, + [RIIC_ICDRR] =3D 0x40, +}; + static const struct riic_of_data riic_rz_a_info =3D { - .regs =3D { - [RIIC_ICCR1] =3D 0x00, - [RIIC_ICCR2] =3D 0x04, - [RIIC_ICMR1] =3D 0x08, - [RIIC_ICMR3] =3D 0x10, - [RIIC_ICSER] =3D 0x18, - [RIIC_ICIER] =3D 0x1c, - [RIIC_ICSR2] =3D 0x24, - [RIIC_ICBRL] =3D 0x34, - [RIIC_ICBRH] =3D 0x38, - [RIIC_ICDRT] =3D 0x3c, - [RIIC_ICDRR] =3D 0x40, - }, + .regs =3D riic_rz_a_regs, +}; + +static const u8 riic_rz_v2h_regs[RIIC_REG_END] =3D { + [RIIC_ICCR1] =3D 0x00, + [RIIC_ICCR2] =3D 0x01, + [RIIC_ICMR1] =3D 0x02, + [RIIC_ICMR3] =3D 0x04, + [RIIC_ICSER] =3D 0x06, + [RIIC_ICIER] =3D 0x07, + [RIIC_ICSR2] =3D 0x09, + [RIIC_ICBRL] =3D 0x10, + [RIIC_ICBRH] =3D 0x11, + [RIIC_ICDRT] =3D 0x12, + [RIIC_ICDRR] =3D 0x13, }; =20 static const struct riic_of_data riic_rz_v2h_info =3D { - .regs =3D { - [RIIC_ICCR1] =3D 0x00, - [RIIC_ICCR2] =3D 0x01, - [RIIC_ICMR1] =3D 0x02, - [RIIC_ICMR3] =3D 0x04, - [RIIC_ICSER] =3D 0x06, - [RIIC_ICIER] =3D 0x07, - [RIIC_ICSR2] =3D 0x09, - [RIIC_ICBRL] =3D 0x10, - [RIIC_ICBRH] =3D 0x11, - [RIIC_ICDRT] =3D 0x12, - [RIIC_ICDRR] =3D 0x13, - }, + .regs =3D riic_rz_v2h_regs, }; =20 static int riic_i2c_suspend(struct device *dev) --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE908178371 for ; Fri, 21 Jun 2024 11:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969015; cv=none; b=V/9HNEJt/iHIETyJmu/YGKlWdK2ZIU/96tOvh9xHLI2t0mloMbIZmyPhR1uYuUaHhczIJiRZp6oIgLMlEnUB74YU4+wV0zXK7a7Lr5bqkPeQk/hnLDFltM4fK7PqwDiwQdkH+weRGGF5wZkijQhJJ3wjzxR42lq3cIPQcalMzJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969015; c=relaxed/simple; bh=tWEdZsb5TVhDZdgUGXwEPUKi4yqwoX12X8EvMXZzLoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KhQp3s3qbrn8oSRq+09p83NzsEpNbuPSnC2HXZjX4NiTxUIFvAA2Yldt1/yXgZ+UJhsPpquM4Mc/MhvclI5/Lpox4ZrrtjvFyuCvGjrLG5/0LLNGe858qnaE+jsv/v5Ypu2W41dzLFKhw+aMSZEi1a4+O3fMIDDRTcqelgezKts= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=CDQYhouu; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="CDQYhouu" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a6ef8bf500dso198506466b.0 for ; Fri, 21 Jun 2024 04:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969012; x=1719573812; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U3dWmB2UOK8ijvT1OLodQzKsVR6IgXqmnkZzW+KAtZo=; b=CDQYhouunZ54JveSvZnQEGWD625OzCAAaToiryCu1Zmxx3mhgBZ5ESxmjrdZgqx3ph XLlkrqWw2iJXGVkfP8NpDOSmACspwfH8qfwJOxdHsBxczlUpdiWUAu/POnJdeygx4HF7 /TpQ0zNkWgaN6odUGJoLTLTAnGg/mI70BkJ/JXOItBXlvXIR8jC9A/odFMXpJ8DpVZQc Ko7lDaMqvimTCQH5ri12jNj1//0WGSWlI+S/FqhACyTB41jNA0LCutFlaXLy9wFtgmKN FlJRvNfSToVoODvdB4oAk6htm+lwLyJGOdwBbKoSTN95OwZkxNoSSK1dl8heDV3/SJFl w+Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969012; x=1719573812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U3dWmB2UOK8ijvT1OLodQzKsVR6IgXqmnkZzW+KAtZo=; b=GRCgu5+SLossnoeAI6laeJQ9P9zKUTwqzta11R0oSrc76d/KpRsrL7VLf6GUhT6ogH RyFzF1h5ATtWXBO4WXv0OUWrP6oOleMsp+FdOpWdKoDYm/mrnjLyV/GZqFTMCoTnIgnN O7qTRi6KPBat2AtTXkmJiZ/NaIEjFtPsHkGEKpQyqJ48ABPuuVZXzvgQTcbD6fcI11+5 mV9H0ULCf9SOZRLbZqKmBg7izElB9eLe79tTmQ5MVmxfmVWktm+HzZma70ZQ40bBAj2e rLNZiGq5RIeG3iYyGd5ckcm7QK7Hs0mxm32o16V9+N2sPxzqwOivyXEr0hndFDaZPBKI qhlw== X-Forwarded-Encrypted: i=1; AJvYcCUXSrF1S/sgZeilZvy79Pbh5I9Mw9LqLuNLrPJ24ddaSYaKGXd5JTJ0KGI9SRnmv/MAuR0l9h1tNgA9WFQHh1muJds1aukXPelKbWVE X-Gm-Message-State: AOJu0Yy7g0D5hjfggLpB7Y8mIUHMcJ0UdXXAUTmuW70+vkLALRpVBGkU 2proRJXXP6DL/tG+VQGLXaR5vbLdYcsxqDASu0r/RUEXWzRu2bnATS7OK9hNwYM= X-Google-Smtp-Source: AGHT+IHzl5TLckn1vyR1Ut/8oOHXJ6FR5MxQOdfCgKOUT/SduD1uH9D1tCQh3ggUMHfkFwoHlgDbuQ== X-Received: by 2002:a17:907:2e01:b0:a6f:2a43:e956 with SMTP id a640c23a62f3a-a6fab7d0901mr486512566b.74.1718969012377; Fri, 21 Jun 2024 04:23:32 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:31 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 08/12] dt-bindings: i2c: renesas,riic: Document the R9A08G045 support Date: Fri, 21 Jun 2024 14:22:59 +0300 Message-Id: <20240621112303.1607621-9-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Document the Renesas RZ/G3S (R9A08G045) RIIC IP. This is compatible with the version available on Renesas RZ/V2H (R9A09G075). Most of the IP variants that the RIIC driver is working with supports fast mode plus. However, it happens that on the same SoC to have IP instatiations that support fast mode plus as well as IP instantiation that doesn't support it. For this, introduced the renesas,riic-no-fast-mode-plus property. Signed-off-by: Claudiu Beznea --- Documentation/devicetree/bindings/i2c/renesas,riic.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml b/Docu= mentation/devicetree/bindings/i2c/renesas,riic.yaml index 91ecf17b7a81..c0964edbca69 100644 --- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml +++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml @@ -25,6 +25,10 @@ properties: - renesas,riic-r9a07g054 # RZ/V2L - const: renesas,riic-rz # RZ/A or RZ/G2L =20 + - items: + - const: renesas,riic-r9a08g045 # RZ/G3S + - const: renesas,riic-r9a09g057 + - const: renesas,riic-r9a09g057 # RZ/V2H(P) =20 reg: @@ -66,6 +70,10 @@ properties: resets: maxItems: 1 =20 + renesas,riic-no-fast-mode-plus: + description: specifies if fast mode plus is not supported + type: boolean + required: - compatible - reg --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 733AD178CFD for ; Fri, 21 Jun 2024 11:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969018; cv=none; b=N/NnZA1cvrTTM1nF1+FjcC5az4rjo7dOkd4mnX6S9/zUjAqitpxCr535Ea4CyHsr9/2ii9HfbL0D4EZY1j0wSkItda5Ea47mdpxw8K3LWcW1oxdki7sVSR7W4kEDFFnPAAXrJ0VbpO3siJ7L9RW7gemWydVfgwnwntC+dRYEgPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969018; c=relaxed/simple; bh=ij3uV6J3X/K1ZAOcphoXyGB9f+JD3XmCdAzZi2OaBxA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=teXI6JGppNq+RVt7QT2WBcvtaxqNhQDc2YRtldk2ts3TqbKKzDSzTDakC/EjrE7aEYT71hYFGAhMSXwFDpogf2bf2/2aHrNfk5LJkE1TCFvWYCsLTRwbA82SJ9M6P0DAgKesjfkb0B62ZE3f2hwotQGg/z8S4mLacuWS2UDxaJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=JslEfuNu; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="JslEfuNu" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a6fbe639a76so308721366b.1 for ; Fri, 21 Jun 2024 04:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969015; x=1719573815; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mzooG8q3y54I5nVFOpy/sRgqo30+e1A/eDOSMBNJffw=; b=JslEfuNua7tF8zrwb/sqVIAntRhFQXlEvBShMqzz5q/DJ2E5w8H+OZ+y26Q5Gra7s1 fV9PriJ4sI88xVH3eG917b28ZYDDctSqQZqcASvuJ9DWe5MRmOgHB2MuOqowqJf0/0zV 8XNhi/qvIyOj52nhQACcHFtNYKz59YC9NJ4a8W6lO+IeW1jjZtuXVlVauCP7f40hGvAp yT+SOg1z0RovIpjn76fA5yITGL+s293r5AEWXqzhYx3oy9lGkZPQtxSVZDWzWHBtgNHg cC1B2OJKclDRXzJHU0Z6JKhUtLsXNepG/Vyq+Y+XTIruTz0LmHd5yPZhOFlEf10a4Rsc mvlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969015; x=1719573815; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mzooG8q3y54I5nVFOpy/sRgqo30+e1A/eDOSMBNJffw=; b=bXG5ssR2/BEaNrV1WQnk5tzWwqDTcyWTdv4PUmmPsG9v8eo/tQ3H/CzfqfjB42pewG Tt0wrm/R+LWcHO70xH+GVaAC2rRfJvswao+oaowF8ldFcfmQVDT+K9RoHJfz1x6e3n0Y 2voZxMx3hfThUZY87Cg9eRqQoVqNAddMawgjy4Bn5nsd4Ytitz1EQa4yAdlBUs24Z35X +fFyTdoZ0v/TBMp0wXVv3fqrXFUL46zAUlhbTLlEqznnqYD9Xt+OFCremSdwhQYvEqaH IXcIWY5Nsbp0viMfFNWGl2ZSa+dS+mdD0vUpM4miTYTJi2UPlg/FRO/e5+VogeGL2s66 qM5Q== X-Forwarded-Encrypted: i=1; AJvYcCUL++CJHIv8pAKTusvkALv0aZaLjS087I6enhW87DnPSVOJTX6jh2MtYFwzfYWaVOP608fdMyXDH+/D+duik/I+gHFhespqRhkO5oDP X-Gm-Message-State: AOJu0YwqhPSHfYft/ti8VKETB+4aFXSP5AFgi/iw9ZUFVzgSDOI65XvQ 1OlGXS+MyGXIJpKRa3WkrXSEDFBc0OClUyoB4pfzW5QQqJoAjkiN+3lXVthaCl0= X-Google-Smtp-Source: AGHT+IGlGxv7FMPWXU1mq1C+qo0WZXeJY4oV0Qo4ZYYvf0BrFDYx+1/DPENJzXqHjmukDxE4Y0PLYg== X-Received: by 2002:a17:907:c205:b0:a6e:f53c:8da0 with SMTP id a640c23a62f3a-a6fa40d43c0mr648572866b.8.1718969014938; Fri, 21 Jun 2024 04:23:34 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:34 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 09/12] i2c: riic: Add support for fast mode plus Date: Fri, 21 Jun 2024 14:23:00 +0300 Message-Id: <20240621112303.1607621-10-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Fast mode plus is available on most of the IP variants that RIIC driver is working with. The exception is (according to HW manuals of the SoCs where this IP is available) the Renesas RZ/A1H. Along with it, according to the RZ/G3S HW manual, chapter 47.5.15 I2C Bus Interface Access Timing, note 7, Tfmin cannot meet the specification in fast-mode plus for the RIIC ch2 and ch3. Due to these limitations: - the struct riic_of_data::fast_mode_plus was introduced to address the Renesas RZ/A1H use case - the renesas,riic-no-fast-mode-plus was introduced to address the Renesas RZ/G3S limitation. Fast mode plus was tested on RZ/G3S, RZ/G2{L,UL,LC}, RZ/Five by instantiating the RIIC frequency to 1MHz and issuing i2c reads on the fast mode plus capable devices (and the i2c clock frequency was checked on RZ/G3S). Signed-off-by: Claudiu Beznea --- drivers/i2c/busses/i2c-riic.c | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 46070f323810..d246143a1037 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -63,6 +63,8 @@ #define ICMR3_ACKWP 0x10 #define ICMR3_ACKBT 0x08 =20 +#define ICFER_FMPE 0x80 + #define ICIER_TIE 0x80 #define ICIER_TEIE 0x40 #define ICIER_RIE 0x20 @@ -80,6 +82,7 @@ enum riic_reg_list { RIIC_ICCR2, RIIC_ICMR1, RIIC_ICMR3, + RIIC_ICFER, RIIC_ICSER, RIIC_ICIER, RIIC_ICSR2, @@ -92,6 +95,7 @@ enum riic_reg_list { =20 struct riic_of_data { const u8 *regs; + bool fast_mode_plus; }; =20 struct riic_dev { @@ -107,6 +111,7 @@ struct riic_dev { struct clk *clk; struct reset_control *rstc; struct i2c_timings i2c_t; + bool fast_mode_plus; }; =20 struct riic_irq_desc { @@ -316,10 +321,11 @@ static int riic_init_hw(struct riic_dev *riic) struct i2c_timings *t =3D &riic->i2c_t; struct device *dev =3D riic->adapter.dev.parent; =20 - if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) { - dev_err(dev, - "unsupported bus speed (%dHz). %d max\n", - t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ); + if ((!riic->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) || + (riic->fast_mode_plus && t->bus_freq_hz > I2C_MAX_FAST_MODE_PLUS_FREQ= )) { + dev_err(dev, "unsupported bus speed (%dHz). %d max\n", t->bus_freq_hz, + riic->fast_mode_plus ? I2C_MAX_FAST_MODE_PLUS_FREQ : + I2C_MAX_FAST_MODE_FREQ); return -EINVAL; } =20 @@ -407,6 +413,9 @@ static int riic_init_hw(struct riic_dev *riic) riic_writeb(riic, 0, RIIC_ICSER); riic_writeb(riic, ICMR3_ACKWP | ICMR3_RDRFS, RIIC_ICMR3); =20 + if (riic->fast_mode_plus && t->bus_freq_hz =3D=3D I2C_MAX_FAST_MODE_PLUS_= FREQ) + riic_clear_set_bit(riic, 0, ICFER_FMPE, RIIC_ICFER); + riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1); =20 pm_runtime_mark_last_busy(dev); @@ -487,6 +496,14 @@ static int riic_i2c_probe(struct platform_device *pdev) init_completion(&riic->msg_done); =20 i2c_parse_fw_timings(dev, &riic->i2c_t, true); + if (riic->info->fast_mode_plus) { + /* + * On the same SoC it may happen to have IP variants that support + * fast mode plus as well as IP variants that doesn't support it. + */ + riic->fast_mode_plus =3D !of_property_read_bool(dev->of_node, + "renesas,riic-no-fast-mode-plus"); + } =20 pm_runtime_set_autosuspend_delay(dev, 0); pm_runtime_use_autosuspend(dev); @@ -535,6 +552,7 @@ static const u8 riic_rz_a_regs[RIIC_REG_END] =3D { [RIIC_ICCR2] =3D 0x04, [RIIC_ICMR1] =3D 0x08, [RIIC_ICMR3] =3D 0x10, + [RIIC_ICFER] =3D 0x14, [RIIC_ICSER] =3D 0x18, [RIIC_ICIER] =3D 0x1c, [RIIC_ICSR2] =3D 0x24, @@ -548,11 +566,17 @@ static const struct riic_of_data riic_rz_a_info =3D { .regs =3D riic_rz_a_regs, }; =20 +static const struct riic_of_data riic_rz_g2_info =3D { + .regs =3D riic_rz_a_regs, + .fast_mode_plus =3D true, +}; + static const u8 riic_rz_v2h_regs[RIIC_REG_END] =3D { [RIIC_ICCR1] =3D 0x00, [RIIC_ICCR2] =3D 0x01, [RIIC_ICMR1] =3D 0x02, [RIIC_ICMR3] =3D 0x04, + [RIIC_ICFER] =3D 0x05, [RIIC_ICSER] =3D 0x06, [RIIC_ICIER] =3D 0x07, [RIIC_ICSR2] =3D 0x09, @@ -564,6 +588,7 @@ static const u8 riic_rz_v2h_regs[RIIC_REG_END] =3D { =20 static const struct riic_of_data riic_rz_v2h_info =3D { .regs =3D riic_rz_v2h_regs, + .fast_mode_plus =3D true, }; =20 static int riic_i2c_suspend(struct device *dev) @@ -610,6 +635,9 @@ static const struct dev_pm_ops riic_i2c_pm_ops =3D { =20 static const struct of_device_id riic_i2c_dt_ids[] =3D { { .compatible =3D "renesas,riic-rz", .data =3D &riic_rz_a_info }, + { .compatible =3D "renesas,riic-r9a07g043", .data =3D &riic_rz_g2_info, = }, + { .compatible =3D "renesas,riic-r9a07g044", .data =3D &riic_rz_g2_info, = }, + { .compatible =3D "renesas,riic-r9a07g054", .data =3D &riic_rz_g2_info, = }, { .compatible =3D "renesas,riic-r9a09g057", .data =3D &riic_rz_v2h_info }, { /* Sentinel */ }, }; --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7DE1179967 for ; Fri, 21 Jun 2024 11:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969020; cv=none; b=IORbRiZRB3H6ljWFVD44HJT1czrVetVdPlo2KHxiM6uFUhdMOrUx3hNFqS7ipvKSoxyzdGWyY2dxx8PsiBG/W2rSg4Jj+E53S0DV5wtYIMYq3LNVp59By4qPedCC9UUUVVnpcx2Ji1goRGl0bW1AXhUhHmLIvuoIDBv/IwTh9a8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969020; c=relaxed/simple; bh=lNldhumSE6RINO7oqa+VZtuUTBaUdRaXgz5D33kBNAs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hBiu7pX5Wo5zSmk0HBiNVMa01T8nAq473qbHhwlgxkqhqCw/n4+wNzCwlPAbjkfqTPDmsCmlfzI8Wqyc2ysJ6PBveaMSFmqdOS/P/nGDvY/vr+unWRaUvHX8smyn5e4qkncG0TL+JYE2rgeXL7wD98fyAJ1R/baNN6bYjJuc1A0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=bcFzA+EA; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="bcFzA+EA" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57cfe600cbeso2209250a12.2 for ; Fri, 21 Jun 2024 04:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969017; x=1719573817; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rP4+zuetuuIfhuOzhXeFAzrE549ps3331iDalIZrx6w=; b=bcFzA+EAsUy4SO6/cfglGOW42Yy0TzcyVBEJl1JTnRvaXaNchrVVgdQsvSpknXkhqC 07rePusNlPT3B6Ae/vHfZOOZV7Hm0L/xKL6ResvzmkscXqNhLZ+zK1BM+T0GlmKBsYwP S/RpYudq4SRtfFlUffqHAqScjF6gfHZ3X4aZsV62vDukJW2YYFk9be3Wjrb0JxL71vs2 zGHFY2QpHqQMXDfU40tg8e4tnlv3Xu+z9bgRyq7WQXEOwR+z3L32AmdonltmeQu1TpaZ M5NuTozDAb3d0rS4wBObPq1s/S0VMUnUbczSmfMnVtTK3W2cKacFkIGOkXT4NBcdrJKY hqvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969017; x=1719573817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rP4+zuetuuIfhuOzhXeFAzrE549ps3331iDalIZrx6w=; b=Ml3ZyonDLxm+P7zmC3rgz0fYSiMgVBP/f1vvQkR2WtchQoA1TSu8S/r0SAOBt7jQri 0sHPzYSOR/DxuDnSq4ord+wOFq3ptHQtiwWW1W9RWBeAdUPq9zBVVS4KpJ1imdPYMq4L E7FtgUFSfkI6Lr5RrMO661vKEcRNL4XxM2HivvTdsY4BXYs88x3b1r+lGb9Qhd3Kp/xL uBjQJZ6TrAZKBfkCnL53aHJNvtstfoQdS9l0ClIuZC1C95PSyHgELaa/9vHlWrVbY0Se aEWVJN80rl/Gxdt7X2lDjU6JVOS1nCxYr/Nl2neiAUws9K9HIoTjUFimSdOUbkpkv89P oOtg== X-Forwarded-Encrypted: i=1; AJvYcCXBHLBxs4XI8xxKkGvGhcleqLq7fwuYzfkCFxyflL6PPQLl+NzyAMfbD/7yERZ30NtjTxTW5dJKhFJy80nT2Zl5FGARqJ3rbCot1OSO X-Gm-Message-State: AOJu0YzXlHG3qlmw6Hl+Ghvq4M3Y2roadrAu3VPkk/DgjYF/3O/xCPvk 5TUKer4KoiyDfPyy5kIV6UnCNUft3tsA1LVztsU+JBV54Larg4806lnus2mUd1w= X-Google-Smtp-Source: AGHT+IFIq66bSlA38LAdExrJtWaTZlg6NozLGS4VPpVsqky9aYie4i5NKq+JpOklKvZ45RaWZgib2g== X-Received: by 2002:a17:907:bc4:b0:a6f:4ef7:85bd with SMTP id a640c23a62f3a-a6fab77a648mr353123466b.47.1718969017264; Fri, 21 Jun 2024 04:23:37 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:36 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 10/12] arm64: dts: renesas: r9a08g045: Add I2C nodes Date: Fri, 21 Jun 2024 14:23:01 +0300 Message-Id: <20240621112303.1607621-11-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea The Renesas RZ/G3S has 4 I2C channels. Add DT nodes for it. Signed-off-by: Claudiu Beznea --- arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/d= ts/renesas/r9a08g045.dtsi index 2162c247d6de..cc5beed37ae8 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi @@ -72,6 +72,96 @@ scif0: serial@1004b800 { status =3D "disabled"; }; =20 + i2c0: i2c@10090000 { + compatible =3D "renesas,riic-r9a08g045", "renesas,riic-r9a09g057"; + reg =3D <0 0x10090000 0 0x400>; + interrupts =3D , + , + , + , + , + , + , + ; + interrupt-names =3D "tei", "ri", "ti", "spi", "sti", + "naki", "ali", "tmoi"; + clocks =3D <&cpg CPG_MOD R9A08G045_I2C0_PCLK>; + clock-frequency =3D <100000>; + resets =3D <&cpg R9A08G045_I2C0_MRST>; + power-domains =3D <&cpg>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + + i2c1: i2c@10090400 { + compatible =3D "renesas,riic-r9a08g045", "renesas,riic-r9a09g057"; + reg =3D <0 0x10090400 0 0x400>; + interrupts =3D , + , + , + , + , + , + , + ; + interrupt-names =3D "tei", "ri", "ti", "spi", "sti", + "naki", "ali", "tmoi"; + clocks =3D <&cpg CPG_MOD R9A08G045_I2C1_PCLK>; + clock-frequency =3D <100000>; + resets =3D <&cpg R9A08G045_I2C1_MRST>; + power-domains =3D <&cpg>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + + i2c2: i2c@10090800 { + compatible =3D "renesas,riic-r9a08g045", "renesas,riic-r9a09g057"; + reg =3D <0 0x10090800 0 0x400>; + interrupts =3D , + , + , + , + , + , + , + ; + interrupt-names =3D "tei", "ri", "ti", "spi", "sti", + "naki", "ali", "tmoi"; + clocks =3D <&cpg CPG_MOD R9A08G045_I2C2_PCLK>; + clock-frequency =3D <100000>; + resets =3D <&cpg R9A08G045_I2C2_MRST>; + power-domains =3D <&cpg>; + #address-cells =3D <1>; + #size-cells =3D <0>; + renesas,riic-no-fast-mode-plus; + status =3D "disabled"; + }; + + i2c3: i2c@10090c00 { + compatible =3D "renesas,riic-r9a08g045", "renesas,riic-r9a09g057"; + reg =3D <0 0x10090c00 0 0x400>; + interrupts =3D , + , + , + , + , + , + , + ; + interrupt-names =3D "tei", "ri", "ti", "spi", "sti", + "naki", "ali", "tmoi"; + clocks =3D <&cpg CPG_MOD R9A08G045_I2C3_PCLK>; + clock-frequency =3D <100000>; + resets =3D <&cpg R9A08G045_I2C3_MRST>; + power-domains =3D <&cpg>; + #address-cells =3D <1>; + #size-cells =3D <0>; + renesas,riic-no-fast-mode-plus; + status =3D "disabled"; + }; + cpg: clock-controller@11010000 { compatible =3D "renesas,r9a08g045-cpg"; reg =3D <0 0x11010000 0 0x10000>; --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEDF717A93A for ; Fri, 21 Jun 2024 11:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969022; cv=none; b=YlovrrIynPSaXdErxYjDP7jkxdtO4T1BLBy2U9gCBSx3yDRUBJYBsXa4PLiuPs0+94o9hsDs7suuE+iInwbnQ14JIjbZi/FWnkCT9PA8wShBOxTX5HiDc7SbRjgGqYTgLQvNAu/4DnNO0r42cY8Q1VRNT0htIAhvCzouXSVbAdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969022; c=relaxed/simple; bh=JYgANfGK0OX8coSzjyoca5b835OY0thvAp8k5tv/WVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jwDd6PKOQ0A4PoCGGsExw+woEeYTEuigc12b0VKYHH0+JvgwX17PuClX5gv/zT4l5cMgfZRRaYSfmS/+1oOruO0neA/Vq5e4fZgovjvsg6Heg04eoxIoAahMFvcn85EqLxA9Cj51SK235E0HYsU/2UqcM4jzaJTdqwUC+UvkzZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=JAa7eP8N; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="JAa7eP8N" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a6f13dddf7eso233568066b.0 for ; Fri, 21 Jun 2024 04:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969019; x=1719573819; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ebUuaMvHVQnkndloXfGsR/owtWP+gpjE1NoWoH3dplE=; b=JAa7eP8NR3gPlIWuXDitYo/A9n1uSnBAtziN6wps1x1rrVVjUtYJ0ujtn55MkhJ/Tb ORWKkmkyukeN5BgoHQ5halpq6Fa+aWnKNioEF/R6sXt83DKoofB5jCtNeOZ9quJWNM9G As9zlAO51VCsfZc9q19X3oTw/5XCX9jUBEqNAmbj72DNuQAydzc4n2etJMySMJ1VRytY X4OXV6p2A2P7vnMUvuYj1htW5lrsgCPsqE22vEb9P/PtsBoHy9VkSoRGfG6cao17wtXo r0BEnujtQC2IP6shoU2xugkAXIHtlWEDUcvmOvaa/IaH8hLQngx1AEMhoFyDxNRKT+N6 QRJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969019; x=1719573819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ebUuaMvHVQnkndloXfGsR/owtWP+gpjE1NoWoH3dplE=; b=wnYL8Wdbbe4HKM/WuwYkLCWUgJ8LZA8r/KIMw/6QrIyFKkZvRzfGye6t1pOXuUwJ+N DCkV3bKqjIdv+6gKx8B29+wvfqR1PMZ+j+EcE9clBCJV6j1aLAkj1G+ITCRBaonC9dGH JEn/H6zW14E560YHNzVTgsgs0RwtZTrmi1+gRGxboh1s3uJ5oWPOz2IZiWighXFl7xD6 pEWr6GiyM64p4V6R/vvQFV+fK00eXA7T4gdFdX87jibylvf+p+qxVhzl/6l7Xef4b8io 5nuEpV6CR66menLtPA1RT34lNq1iqrh8IbiCZwXUTu6CE9xAgxA2lo1NzQ4oPIiTm0EB A8yw== X-Forwarded-Encrypted: i=1; AJvYcCW+srlafaoCsvAUbxP0Q8jj7UzfQe8qY4KbAvyy8sDXys3laSucho+DQevhR6/ml0DV5d4GICG3QZCe7qN+bRQGAfRtVL03r9eozTP3 X-Gm-Message-State: AOJu0Yz/wg2Fyj75COm4I8169jMMPpyinGLLkWRU0SWCxRJL2Rg8lCMm 6QaleiuViNKtfrln1GM3zdMIoHLJ/5JGZd9tP/0z/LnwrFzNL8ntkQBrTTONpJ0= X-Google-Smtp-Source: AGHT+IGZv8gS1+I6ldBjfQ4fdMF7NlgFickAepkyUrui9xQnT8bZE+QnGQ4UWGjz1h6JNkW6Y5A7vw== X-Received: by 2002:a17:907:a587:b0:a6f:bf0f:4209 with SMTP id a640c23a62f3a-a6fbf0f42f2mr378145566b.42.1718969019378; Fri, 21 Jun 2024 04:23:39 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:39 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 11/12] arm64: dts: renesas: rzg3s-smarc: Enable i2c0 node Date: Fri, 21 Jun 2024 14:23:02 +0300 Message-Id: <20240621112303.1607621-12-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Enable i2c0 node. Signed-off-by: Claudiu Beznea --- arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot= /dts/renesas/rzg3s-smarc.dtsi index deb2ad37bb2e..7945d44e6ee1 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi @@ -11,6 +11,7 @@ =20 / { aliases { + i2c0 =3D &i2c0; serial0 =3D &scif0; mmc1 =3D &sdhi1; }; @@ -66,6 +67,12 @@ vccq_sdhi1: regulator-vccq-sdhi1 { }; }; =20 +&i2c0 { + status =3D "okay"; + + clock-frequency =3D <1000000>; +}; + &pinctrl { key-1-gpio-hog { gpio-hog; --=20 2.39.2 From nobody Mon Feb 9 15:15:17 2026 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3745817B439 for ; Fri, 21 Jun 2024 11:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969024; cv=none; b=H6EysfG5RTX9RmGjwSaE87jeiY1LDP3w6WAm5wa7g9ZOAi2vXxWlLnWMEXNl3FGd42nbrcCEvciqOnf/WdBFCvcOsl3opQTgntQe/sJmpJ8QRpwbrtf7h1l2x8pIR1bIJBTkc85U41FUf4suWU3X0yuqs3XD0ZduQ+Q2ZkCqLZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969024; c=relaxed/simple; bh=n02VnI1z3Lo/vCVvdYX3gNJ/na1w3LKQu6cqOd+GMII=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cxMqy4NeIH81GQZUu5Vz6YgiaibWDztA5S4tUgkuoZD4BDdaGvL9cOg4P9nwKYspe+3UtEqkE4ikpwdqUUurke31V4cNbHXJ+Cyp745VV8mRrmOO4JLKWgRQh0M+PWbg/cuOORjB87f658YA0uUJ4q6orzzBbP0My02nRHWGUE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=e8GGMkk+; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="e8GGMkk+" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a6f7720e6e8so226089566b.3 for ; Fri, 21 Jun 2024 04:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1718969021; x=1719573821; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=veIrjSKIW0msyP1BPKwCOv7rRYyO3ebgm2ScapHwacw=; b=e8GGMkk+MEXMMx8ecWdrmUcnfitLVwhwuDlqjvGYpUyGhaWvRXyN5hdsYkLxR7tuV1 IuxOuTN7n8C/W6q8+nERUdyT7V/jcGADm4gRzAneS+IkzEAxyJSSciw2rwOxAi3LmpzY ajVubbLI+apSF3iG7ocIzwYsbcVXO9EB1er0xxTY/3JmfhNZQYeGC5yEUZGQJffmVGI4 3Ymvez3WGcJ1juZQ0TVoJI/ywBLAmc508wv2kQE0naQuF1ni/bTnnCRYx+NcpnGHaHj6 AlqSrHwEmsKSxrXxk+caxlBNtZAO8qJPJgJL5mKPq9kypOiiK7xqbY2H5MVCSy43L9NN cOaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718969021; x=1719573821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=veIrjSKIW0msyP1BPKwCOv7rRYyO3ebgm2ScapHwacw=; b=mKqea3y7fe19/OJRiy8KpGDjGn9dCAMV1IM6h4sl484CmuLuu0MnCwMch72JF+e6rL 09DSoIXZEIudMkox8oXBfaF4zMl5qRJ2rEvcqZsMHvX/oeXAPheyP3+7SAL6TyI1Hh9U uBEfHm81UDD88AekkJ+UM2FCQoiCex7ldrICHtDGAdNKCdhNhi27ceCV5NiYjRJ3yEGI ss9pKUtUfqdDIlDeuHbXd96zapD/lfgzUwF71GnAGotUOMfvBKZy8K7CLSixAvXQW4xo caDOpFZ5Rd7NrhnSv+n2VK3K/ay0PgwVlMyBu2tS9dTmgnLYPs8F8Ct7oXF4e4C8Wet+ v/MQ== X-Forwarded-Encrypted: i=1; AJvYcCWYnQI0VbX2DHbkPp32EnahTVlKeZ4k4Kmr4btg0id+oMxjuuS+Lga0sZHX3PJm/AqeItoElxO9U2NmgPi8/+JkhD5k+WBIicxlvenA X-Gm-Message-State: AOJu0YwO+Tav7WAT/xqRmyHh8yy98rAgQcEdBM7KRFXe/Yy0bP8OmHDK YuE5T0jyajcHeP8Hu+q+bwyQlciqeinmkE2ToDW0KJQNAWuMzvb+wcfGv7FATsg= X-Google-Smtp-Source: AGHT+IEEH1uXQ9SWBQpZ3LT5PHwfn4wvDC947Dj2o3fom2F9AP5MXqF9KQPaa6c5ngH5rqOd6vpGow== X-Received: by 2002:a17:907:ca1b:b0:a63:49d3:e1c5 with SMTP id a640c23a62f3a-a6fab7d6a8emr476914666b.64.1718969021696; Fri, 21 Jun 2024 04:23:41 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.70]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd0838345sm64498466b.99.2024.06.21.04.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 04:23:41 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: chris.brandt@renesas.com, andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, geert+renesas@glider.be, magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH 12/12] arm64: dts: renesas: rzg3s-smarc-som: Enable i2c1 node Date: Fri, 21 Jun 2024 14:23:03 +0300 Message-Id: <20240621112303.1607621-13-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> References: <20240621112303.1607621-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Enable i2c1 node. Signed-off-by: Claudiu Beznea --- arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/= boot/dts/renesas/rzg3s-smarc-som.dtsi index 8a3d302f1535..21bfa4e03972 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -32,6 +32,7 @@ / { compatible =3D "renesas,rzg3s-smarcm", "renesas,r9a08g045s33", "renesas,r= 9a08g045"; =20 aliases { + i2c1 =3D &i2c1; mmc0 =3D &sdhi0; #if SW_CONFIG3 =3D=3D SW_OFF mmc2 =3D &sdhi2; @@ -150,6 +151,10 @@ &extal_clk { clock-frequency =3D <24000000>; }; =20 +&i2c1 { + status =3D "okay"; +}; + #if SW_CONFIG2 =3D=3D SW_ON /* SD0 slot */ &sdhi0 { --=20 2.39.2