From patchwork Fri Mar 8 17:27:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 778970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 B001A4C627; Fri, 8 Mar 2024 17:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918894; cv=none; b=n+0waCucP+a3hfW8uH2X0cjGeb6CzzUnur27vk2zdEOylwXmRpX6FmjYrypFwa+v/BiVEsED7txoLOBNGlmDCogalL+cq6I/4HEKb5yuVDfZ/6UZU8gogh7ay71vUiuGte+TI72Wg98zGHbFdbplmb4kk+XmrPfEsEiUnX7pIjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918894; c=relaxed/simple; bh=q/GUb55IkyG4qoMcRVLxKhTyKVmh1LUM8fkvsCNl65A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q4ul0F3N5/4zrTKqkrelOpXQzxWo/aaKRsgL2+1OUbPY+bOWI+QkBUX4V20R/Cu9a7f1nCfpkz9n9LZQNfiCE91/hvo3mQdOogHGfQRrKrdlrzv942TVJ2bucVwJ65yS062RqCHoyR+fIxFPPePjq1cuOGw9X1i84lncfgUBb8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UCzNHgIS; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UCzNHgIS" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4131804e695so5515415e9.0; Fri, 08 Mar 2024 09:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709918891; x=1710523691; 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=IFSPC0+9XUKCrz4oj5rscpxZLJOGUPY8MqqR495Uv2Q=; b=UCzNHgISnQexQjNsvF2JjL8ugTMNDhC8yc2m/YiVPy1zcNyIzpagZy9uTvGb6xzJls xJmZTVzo4ow3lwhFVGZ+LxOdl8rbOnWOeo4B2Lf848U5whxCeiWIwfo+EcwvRtyDpGzr CS//LC9meZPCJ3C80pVinyNFax0hw9+2iwdlkG9DuDmzb8QkeyCM2PQZhaWU5Z1RuHGl 3QHT6KXrkkHBSCCp6+gAcvN4EggXiJMaIdGbqLBAWzE3e6AQkI4bPn+VaT3TzjTBw2IL ZI52Pi9+VaQokbKBh6JjvMK5j9e3nqeSEHcqlCqUHmxkw9p2qSUj+BbWZKuOFf+WJMZ7 6LDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918891; x=1710523691; 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=IFSPC0+9XUKCrz4oj5rscpxZLJOGUPY8MqqR495Uv2Q=; b=UCUKFOU9fhi3NmZFem/5VnLkMCnJexT/quRH5TIC8vimrKtFSkGGzT5CJV7rlI8HjX Y5yG8mnbAJug8ylr4Ls71ZAUzzR6ORyNJfM29y7Xr6/FOnyPiT7VdBUT7BXqyDig3+lF 3mmPQl0lAt69sItqi+Gi9c0hLQx43VgxM2Dnae8Ovs6h5KSYvGT1d04NF11IqvvXzIDQ U83LIFf8/5PIW5t1qMKb4rXtkeg84Nnia2EgTROChtwWM5M2UzSYBfzekrnts8qQVQnU MSvKywVOOJFmSEMiyAKjw/5vh1pHVxphwGUDKL0/z+TTmQLkH8B0KyJXHses70LAd+5+ JwFQ== X-Forwarded-Encrypted: i=1; AJvYcCW/Fqvv58kWtpg9lcKZk3eOzlePaSTqc5zqPTdvgNFOhtKCnhpryl/GcwPOA4YwElO8xeTuF3NGQuGhTRP/v/UXsqWoRbAW8PPt8OfmzHk5dEamuV8CDPAUtgxWnyfNFXgEasNmX+CpWkR9UkFsnWVzmECWTvwIrhDCV+iV10eq7v5Q7w== X-Gm-Message-State: AOJu0Ywxvv3MHFE87AaPv66UywUxSGrirrdGOSr4KH1H2OUhqXl+Zuo0 gwHK8fnjukIz+/X8oMFG7gX6/kn3xil0ph8OSONpomMuDs1aq7dy X-Google-Smtp-Source: AGHT+IHxg8PW/lt2DWsxTiUXTXbdh694MbxHMGuryEAQETkhR+VngBzgx5omErapHeUpnXPJxbolpA== X-Received: by 2002:a05:600c:19d0:b0:412:ee33:db93 with SMTP id u16-20020a05600c19d000b00412ee33db93mr877248wmq.3.1709918890916; Fri, 08 Mar 2024 09:28:10 -0800 (PST) Received: from prasmi.home ([2a00:23c8:2500:a01:3c2e:cd45:f50f:f083]) by smtp.gmail.com with ESMTPSA id jh3-20020a05600ca08300b0041304100fa9sm6445317wmb.45.2024.03.08.09.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:28:10 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Chris Brandt , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 1/5] dt-bindings: i2c: renesas,riic: Update comment for fallback string Date: Fri, 8 Mar 2024 17:27:22 +0000 Message-Id: <20240308172726.225357-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar With the fallback string being utilized by multiple other SoCs, this patch updates the comment for the generic compatible string. Signed-off-by: Lad Prabhakar Reviewed-by: Fabrizio Castro --- Documentation/devicetree/bindings/i2c/renesas,riic.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml index 2291a7cd619b..63ac5fe3208d 100644 --- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml +++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml @@ -22,7 +22,7 @@ properties: - renesas,riic-r9a07g043 # RZ/G2UL and RZ/Five - renesas,riic-r9a07g044 # RZ/G2{L,LC} - renesas,riic-r9a07g054 # RZ/V2L - - const: renesas,riic-rz # RZ/A or RZ/G2L + - const: renesas,riic-rz # generic RIIC compatible reg: maxItems: 1 From patchwork Fri Mar 8 17:27:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 779256 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.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 44AAB54792; Fri, 8 Mar 2024 17:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918896; cv=none; b=BpTRD0alF1ahCnREbdMW7crJhbJtF1+Je6KmMG5x6wDrzdq8a4xCT2gJjFHyxDOPiVN+ITnF9afMO8vpqmN2jo+/eUx9HLMu5OPiCDDU2Rv234LiNzgnWzMTLqRT3G0L3deKRNViL5R04cNh2A9CVpKXuHaI3iGP/ZUQDFXvpiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918896; c=relaxed/simple; bh=xSi4yRdhzZG+j4Jyhvt+RdbV1T6CUerO+DzKvX05jAg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gQpoqKwPe1P3GVpB0zBX2YldGpT+d6OaZDbH50r+yyKr/+OaYcUN3J4UsZyPLD/rN3afNo8f1VJouhYJCBNvbrdHRfO15c8nfk3HCsatn4VY9JZq1zxosy4mvcKFQxlPkwK3N+rluZsZ4LhXaG23cWeVvznbB+q/435uZaDDJRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Oyny9bHm; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oyny9bHm" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-412ee276dc9so7883985e9.1; Fri, 08 Mar 2024 09:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709918893; x=1710523693; 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=MWwOmRTSg2gxti2ppNCLdSJCkn4Agg5qb+fjrt7Ni0c=; b=Oyny9bHmSfcL8QXmUQJotHX65QwP1VBMMfBprVAt6PJBSTCqwRXreIsVPDp5drrEqY jIh6FJeAWbYAVSGYdRQ+8wlYiv1gS+7IngFS9K1pyhQotmBidlAJ5Gdcu0RNV4jHm821 Y2jdtT3GgTf3J5DLStS8vP5ythVtp1L6nHut6Du8mi/+5vhUmyV2tbsM3PL3RKyISXzZ WcmQ3q/QG15Utfhu6rs7K0PxWxyA7oNOE64WxGP6xdC3sRZbQZRNmA1tirLhaZDvTDHU nE3rMdqX4A8to7qTX+XrUG2ghadYeyqGSaE2Hl90jHhhA1JXnsScjV/voviD8q4Gt2N5 HPNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918893; x=1710523693; 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=MWwOmRTSg2gxti2ppNCLdSJCkn4Agg5qb+fjrt7Ni0c=; b=RMH7eYoYXBm3wm820HjgfkOWhZ+ZPw+YanfzORhFRm/LeNx22UOEt8v/zWzVZOwBzp rtOpkBVBMLX8YOTftmXhfUGSMHdWC3s7A0RPWJz1Ioijf+D7uc/tafRhMwxDPOqHc8md RxqNiNSnOlAiAfqD9axLKTp6COJnvxFElybuOZF4EONer3kIyzFtboHbeqq9nzRqFDp7 5G/iUGNUz0K2Vwfq/5f38lmV54MLzT9sTkRY56bnq0Q/FPzLKdYXXYgaBQ70m7f+sZfY nwVHBCf8NONwEWAXPQFvvDw8Tdg/Ne0oN5yxiEtTwQfxa4/zEGAdEc4MEcrb/7+2sRUD E6Ag== X-Forwarded-Encrypted: i=1; AJvYcCU5aWU52JxYNRcfSR4nipOI7DFiKAdCwwBZAeEk39QvvGp9NzD+xEuxOrCWtop3w/tKFlHDomOLwFPs4mAxUt798s2mB8PTobL4MWTUWJ8wfXLSDJNIMmo0ALFd26zSohj3JQPYimi6VDgiFsRCIO3i2uswiU8vLEnpcSA0bs8pNvhbag== X-Gm-Message-State: AOJu0Yzen40dK07Wkmur9km8qIX4Pe619AMS3edf68+4o5A8uDNWyQ6o oq6uZuNYeF4SKJHRBeHlEUdBgyY5bO+HYwM82m/g3suwIpPHTrbX X-Google-Smtp-Source: AGHT+IHI8/qbHKCqz66RwWR9MqlbbVAzHtjtfiFY+x4cnGUA114FUitp2k639eLrpKnRZdgh9o8znQ== X-Received: by 2002:a05:600c:3c86:b0:412:8d98:78a with SMTP id bg6-20020a05600c3c8600b004128d98078amr17449379wmb.13.1709918892467; Fri, 08 Mar 2024 09:28:12 -0800 (PST) Received: from prasmi.home ([2a00:23c8:2500:a01:3c2e:cd45:f50f:f083]) by smtp.gmail.com with ESMTPSA id jh3-20020a05600ca08300b0041304100fa9sm6445317wmb.45.2024.03.08.09.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:28:11 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Chris Brandt , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 2/5] dt-bindings: i2c: renesas,riic: Document R9A09G057 support Date: Fri, 8 Mar 2024 17:27:23 +0000 Message-Id: <20240308172726.225357-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Document support for the I2C Bus Interface (RIIC) available in the Renesas RZ/V2H (R9A09G057) SoC. The RIIC interface in the Renesas RZ/V2H differs from RZ/A in a couple of ways: - Register offsets for the RZ/V2H SoC differ from those of the RZ/A SoC. - RZ/V2H register access is 8-bit, whereas RZ/A supports 8/16/32-bit. - RZ/V2H has some bit differences in the slave address register. To accommodate these differences in the existing driver, a new compatible string "renesas,riic-r9a09g057" is added. Signed-off-by: Lad Prabhakar Reviewed-by: Fabrizio Castro --- .../devicetree/bindings/i2c/renesas,riic.yaml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml index 63ac5fe3208d..2a7125688647 100644 --- a/Documentation/devicetree/bindings/i2c/renesas,riic.yaml +++ b/Documentation/devicetree/bindings/i2c/renesas,riic.yaml @@ -15,14 +15,19 @@ allOf: properties: compatible: - items: - - enum: - - renesas,riic-r7s72100 # RZ/A1H - - renesas,riic-r7s9210 # RZ/A2M - - renesas,riic-r9a07g043 # RZ/G2UL and RZ/Five - - renesas,riic-r9a07g044 # RZ/G2{L,LC} - - renesas,riic-r9a07g054 # RZ/V2L - - const: renesas,riic-rz # generic RIIC compatible + oneOf: + - items: + - enum: + - renesas,riic-r7s72100 # RZ/A1H + - renesas,riic-r7s9210 # RZ/A2M + - renesas,riic-r9a07g043 # RZ/G2UL and RZ/Five + - renesas,riic-r9a07g044 # RZ/G2{L,LC} + - renesas,riic-r9a07g054 # RZ/V2L + - const: renesas,riic-rz # generic RIIC compatible + + - items: + - enum: + - renesas,riic-r9a09g057 # RZ/V2H(P) reg: maxItems: 1 From patchwork Fri Mar 8 17:27:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 778969 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 EE1B157336; Fri, 8 Mar 2024 17:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918898; cv=none; b=lScy7ZdB80r1UHKjiFgdXxx+2fbMZg8DLoWRKh0IcsNen1QBrkf2XDZr2IZItxCs4UI2qcXMJu+z0lNcEg+UUgLeUe/bqFO4f2sz23q5d//sb/Lr60S4VnjAiknu/qqGndmkkAuCVRKs92Mqk+0SJdYK3VdQTpJ7yGedK1stYsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918898; c=relaxed/simple; bh=Pht7E0DhC6qlBxoiNrZ2ax48AgGAs6UlSMBS8H9oE3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vEBrN1lgGLoxXzul4dBtZAmJWiuQOhT7fjeWzWTT0aXgy6FP79MkeG1qia/quC165ynifik5HeX4LJjrpg865TwiKdv815aEzYtBTMABSOjoR6rKqwTH/e29tu3zxzNdGBtJUTjE+sESCwXkWFq1e9r5fg+aj/uTufBXUnleNEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FGTzEk4/; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FGTzEk4/" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5131316693cso2984176e87.0; Fri, 08 Mar 2024 09:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709918894; x=1710523694; 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=9EETxBX6gd6azB5EobpuUqQWG5+8tb2ohej+sR8fJFc=; b=FGTzEk4/4VUv+iBqbGj+rxVgZUuN61PL6Bxfr0uITFfGgAb8+qzzk9xAWJ8PdY0XIr dwVCCvWc1aDhmkP/Dxn1gMzVjfNrxr8L5gjmMtPvyohFGTuUczeEz29+4ALZeAStkX58 +J5oXJvWwZZSmzCV38yJ4GlzX2sqmwgC1w7Mz13rxQGCDUZS+T5/STtEcwMaQTUoUSnj W1I7PoiKvcMsbrNRhOkmgwGzyYrPn8y0fMocOiLNuoOT9qOD4KRGx9JmAlx/KWeZnO3g Acbm9EQ2tIXfeNa6ib9aWUBxf1uFVjX7vCoBNGPh7NxTe+xp9egfWUTWWVk6SZvoSL1l YrTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918894; x=1710523694; 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=9EETxBX6gd6azB5EobpuUqQWG5+8tb2ohej+sR8fJFc=; b=beZ2mFuArbD8AAr0KvV3bJAmWI6yKrN59n0jw0AtF33ich9FpoEq4SBjvpPrm6eiUb fzjgp7xaASBqOLIQJPvKMl/5Xwzf6OQ9gRn9Wdb4Va9ZJveVqsXmueebSynAW79J6vKk jm+JSZsoQwGIIMCXNztlXHN4JORO4il9C+6/HYz1t11k6DBuIsmrjhl21m93Wurl0CaG EdqZ5Qn7N7SpiCB++eK+7RgJm8lZBL14JHo0vZ+R1yWG4BXp9bvUodfIJ29R7huo3xUG 6IRPmyXUHU2DFW1IBDYljeP62QRV86kcr3iSLBm6W/PyWzrv2niBmBUbI5ZrW5zHgKMl 2Rvg== X-Forwarded-Encrypted: i=1; AJvYcCX5SOUVtxKOoEj5JiwrH9ii3iyloPPUPIoz9iFw7+v0o7IggciEZFSuFfjYlJHFiLHnHL2r9VC+9zyP5HCMJpOxtQsF2cIs+GRDov4CtO+J6qX5ZaDRQZj646uo2QnFD6qmwtElBQ3cvT7X27F14fHLFW9zfzr7+A5PVsIAZ7VtcLxpEw== X-Gm-Message-State: AOJu0YwXThde06NncJ2XDd9p/uZAP7LFQtIHUd3kYTofmmlwHj5tE+sQ YIdYhTVVp3Kl8AT0LGfQk95EgRXM5NL2vCBuGX0rJkmYShKC/mNyXPdjiyrN X-Google-Smtp-Source: AGHT+IHuwSYYhl8CDQ5vJdqRCx985el4ByCrxULN7HKbxC4Fr0hx2D4V4hbMbbiw/lLXhtTjK1Q7Fw== X-Received: by 2002:a05:6512:4892:b0:513:426e:618 with SMTP id eq18-20020a056512489200b00513426e0618mr3894414lfb.48.1709918894007; Fri, 08 Mar 2024 09:28:14 -0800 (PST) Received: from prasmi.home ([2a00:23c8:2500:a01:3c2e:cd45:f50f:f083]) by smtp.gmail.com with ESMTPSA id jh3-20020a05600ca08300b0041304100fa9sm6445317wmb.45.2024.03.08.09.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:28:12 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Chris Brandt , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 3/5] i2c: riic: Introduce helper functions for I2C read/write operations Date: Fri, 8 Mar 2024 17:27:24 +0000 Message-Id: <20240308172726.225357-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Introduce helper functions for performing I2C read and write operations in the RIIC driver. These helper functions lay the groundwork for adding support for the RZ/V2H SoC. This is essential because the register offsets for the RZ/V2H SoC differ from those of the RZ/A SoC. By abstracting the read and write operations, we can seamlessly adapt the driver to support different SoC variants without extensive modifications. This patch is part of the preparation process for integrating support for the RZ/V2H SoC into the RIIC driver. Signed-off-by: Lad Prabhakar Reviewed-by: Fabrizio Castro --- drivers/i2c/busses/i2c-riic.c | 56 +++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index e43ff483c56e..49a12f1ecdf9 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -105,9 +105,19 @@ struct riic_irq_desc { char *name; }; +static inline void riic_writeb_reg(u8 val, struct riic_dev *riic, u8 offset) +{ + writeb(val, riic->base + offset); +} + +static inline u8 riic_readb_reg(struct riic_dev *riic, u8 offset) +{ + return readb(riic->base + offset); +} + static inline void riic_clear_set_bit(struct riic_dev *riic, u8 clear, u8 set, u8 reg) { - writeb((readb(riic->base + reg) & ~clear) | set, riic->base + reg); + riic_writeb_reg((riic_readb_reg(riic, reg) & ~clear) | set, riic, reg); } static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) @@ -119,7 +129,7 @@ static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) pm_runtime_get_sync(adap->dev.parent); - if (readb(riic->base + RIIC_ICCR2) & ICCR2_BBSY) { + if (riic_readb_reg(riic, RIIC_ICCR2) & ICCR2_BBSY) { riic->err = -EBUSY; goto out; } @@ -127,7 +137,7 @@ static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) reinit_completion(&riic->msg_done); riic->err = 0; - writeb(0, riic->base + RIIC_ICSR2); + riic_writeb_reg(0, riic, RIIC_ICSR2); for (i = 0, start_bit = ICCR2_ST; i < num; i++) { riic->bytes_left = RIIC_INIT_MSG; @@ -135,9 +145,9 @@ static int riic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) riic->msg = &msgs[i]; riic->is_last = (i == num - 1); - writeb(ICIER_NAKIE | ICIER_TIE, riic->base + RIIC_ICIER); + riic_writeb_reg(ICIER_NAKIE | ICIER_TIE, riic, RIIC_ICIER); - writeb(start_bit, riic->base + RIIC_ICCR2); + riic_writeb_reg(start_bit, riic, RIIC_ICCR2); time_left = wait_for_completion_timeout(&riic->msg_done, riic->adapter.timeout); if (time_left == 0) @@ -191,7 +201,7 @@ static irqreturn_t riic_tdre_isr(int irq, void *data) * value could be moved to the shadow shift register right away. So * this must be after updates to ICIER (where we want to disable TIE)! */ - writeb(val, riic->base + RIIC_ICDRT); + riic_writeb_reg(val, riic, RIIC_ICDRT); return IRQ_HANDLED; } @@ -200,9 +210,9 @@ static irqreturn_t riic_tend_isr(int irq, void *data) { struct riic_dev *riic = data; - if (readb(riic->base + RIIC_ICSR2) & ICSR2_NACKF) { + if (riic_readb_reg(riic, RIIC_ICSR2) & ICSR2_NACKF) { /* We got a NACKIE */ - readb(riic->base + RIIC_ICDRR); /* dummy read */ + riic_readb_reg(riic, RIIC_ICDRR); /* dummy read */ riic_clear_set_bit(riic, ICSR2_NACKF, 0, RIIC_ICSR2); riic->err = -ENXIO; } else if (riic->bytes_left) { @@ -211,7 +221,7 @@ static irqreturn_t riic_tend_isr(int irq, void *data) if (riic->is_last || riic->err) { riic_clear_set_bit(riic, ICIER_TEIE, ICIER_SPIE, RIIC_ICIER); - writeb(ICCR2_SP, riic->base + RIIC_ICCR2); + riic_writeb_reg(ICCR2_SP, riic, RIIC_ICCR2); } else { /* Transfer is complete, but do not send STOP */ riic_clear_set_bit(riic, ICIER_TEIE, 0, RIIC_ICIER); @@ -230,7 +240,7 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data) if (riic->bytes_left == RIIC_INIT_MSG) { riic->bytes_left = riic->msg->len; - readb(riic->base + RIIC_ICDRR); /* dummy read */ + riic_readb_reg(riic, RIIC_ICDRR); /* dummy read */ return IRQ_HANDLED; } @@ -238,7 +248,7 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data) /* STOP must come before we set ACKBT! */ if (riic->is_last) { riic_clear_set_bit(riic, 0, ICIER_SPIE, RIIC_ICIER); - writeb(ICCR2_SP, riic->base + RIIC_ICCR2); + riic_writeb_reg(ICCR2_SP, riic, RIIC_ICCR2); } riic_clear_set_bit(riic, 0, ICMR3_ACKBT, RIIC_ICMR3); @@ -248,7 +258,7 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data) } /* Reading acks the RIE interrupt */ - *riic->buf = readb(riic->base + RIIC_ICDRR); + *riic->buf = riic_readb_reg(riic, RIIC_ICDRR); riic->buf++; riic->bytes_left--; @@ -260,10 +270,10 @@ static irqreturn_t riic_stop_isr(int irq, void *data) struct riic_dev *riic = data; /* read back registers to confirm writes have fully propagated */ - writeb(0, riic->base + RIIC_ICSR2); - readb(riic->base + RIIC_ICSR2); - writeb(0, riic->base + RIIC_ICIER); - readb(riic->base + RIIC_ICIER); + riic_writeb_reg(0, riic, RIIC_ICSR2); + riic_readb_reg(riic, RIIC_ICSR2); + riic_writeb_reg(0, riic, RIIC_ICIER); + riic_readb_reg(riic, RIIC_ICIER); complete(&riic->msg_done); @@ -365,15 +375,15 @@ static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t) t->scl_rise_ns / (1000000000 / rate), cks, brl, brh); /* Changing the order of accessing IICRST and ICE may break things! */ - writeb(ICCR1_IICRST | ICCR1_SOWP, riic->base + RIIC_ICCR1); + riic_writeb_reg(ICCR1_IICRST | ICCR1_SOWP, riic, RIIC_ICCR1); riic_clear_set_bit(riic, 0, ICCR1_ICE, RIIC_ICCR1); - writeb(ICMR1_CKS(cks), riic->base + RIIC_ICMR1); - writeb(brh | ICBR_RESERVED, riic->base + RIIC_ICBRH); - writeb(brl | ICBR_RESERVED, riic->base + RIIC_ICBRL); + riic_writeb_reg(ICMR1_CKS(cks), riic, RIIC_ICMR1); + riic_writeb_reg(brh | ICBR_RESERVED, riic, RIIC_ICBRH); + riic_writeb_reg(brl | ICBR_RESERVED, riic, RIIC_ICBRL); - writeb(0, riic->base + RIIC_ICSER); - writeb(ICMR3_ACKWP | ICMR3_RDRFS, riic->base + RIIC_ICMR3); + riic_writeb_reg(0, riic, RIIC_ICSER); + riic_writeb_reg(ICMR3_ACKWP | ICMR3_RDRFS, riic, RIIC_ICMR3); riic_clear_set_bit(riic, ICCR1_IICRST, 0, RIIC_ICCR1); @@ -481,7 +491,7 @@ static void riic_i2c_remove(struct platform_device *pdev) struct riic_dev *riic = platform_get_drvdata(pdev); pm_runtime_get_sync(&pdev->dev); - writeb(0, riic->base + RIIC_ICIER); + riic_writeb_reg(0, riic, RIIC_ICIER); pm_runtime_put(&pdev->dev); i2c_del_adapter(&riic->adapter); pm_runtime_disable(&pdev->dev); From patchwork Fri Mar 8 17:27:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 779255 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 7340B58ACD; Fri, 8 Mar 2024 17:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918899; cv=none; b=ROxUDcW0tnNlZPV2/Jk4k4LLbQ1oVUn3+Ciu4f1Rrmem50i+ilN/mync9hDgWGipgnWW2IltFx9VF71j/I2r0wSMgO/lIyY+eXOMGwvTIVDym3Op+9+ZpUwornsFTjFUpViVwFiabH98pE0vM1BX4hcBpOCO5jKmFstJSgHfqkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918899; c=relaxed/simple; bh=VPUXj8lUVBV77ku3j8NnkMTcjvT8xw3EyO5Zcbm4HSI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bWGC/QIULSeWVf6KWlntDG/+3R9sfEaXxdzvxne44mL4MvO30Xs/brFFXF3faG+ia6YiiSKG4uFIupupKOtLkAt2vpzaQ6okkJJb5p6XqyxX65vf3F+Zov/Ja55tEiZtQ0Drvcn6aFbEP3awBKNzkLKMohL1nBHmS4M09+mdpkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KPxwE51A; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KPxwE51A" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-41312c3ab40so8451505e9.3; Fri, 08 Mar 2024 09:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709918896; x=1710523696; 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=HELb3zjw5jb9Ic+GGtg7OU5GPKfa8XgzqXk9WLQP09A=; b=KPxwE51AiLLYcBVQrHQzX5Dg3FwgWbS42bI8V797QANz/aFg54pIy8buXLKxyXKkwe nUamQ/mPHyO85wWDSFvEUgAf8ftzFqLFHR1eBvRsPbVfFzV0D+D36kdP92fjcrvKGCk+ PHuzCeMaeHz5jtqrGxBJHuDvB+8KEZTYZrf/hRBjrxeBf7uI693oRny41ukKaHJxwh4P JbBkwRRlk5bu2zipjVtB1UFM/06UL2NH4nSanTuxk2QwvnHxzmJmMEMOKEhdRpGdJkRb oLs47m43oRMFm5Sy8OglV152W3wzoJyUQkfNgJyMB7ftMKR3NaHrJ8CdO1ddfXf+CJf2 YspA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918896; x=1710523696; 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=HELb3zjw5jb9Ic+GGtg7OU5GPKfa8XgzqXk9WLQP09A=; b=wFAOMCmvbKcJHA1Gu5Oao3HrrgYe2tNo80dugj4BXv4Ewe7ICd0ytFQhKnvBpBqnyg zHZCs3nMyih6/lfRt3Y8ypTgyjXsSXUIySRpBQUOxOaGFdtUUUdCsgk5UR1evIHYzn3V zawqOkTiWhHK37JNjzjCxNNP2AVgOfyJ52p4bwVPQiSRmuuj1V4lOcOoJwh4wtecxHyK Prd1jqUwFF6gaF41/vLH7/UL9F+MWwaWr1uT6qp4vqdjRXKtNfdN6kMZRyZhtXDNmEIK qfv+LcPphM5iYvSPB25Ak40c3ozXkOcmQxYTDwm0O5SATdNFtG64Gne8DCcN33UbKbBq qSGg== X-Forwarded-Encrypted: i=1; AJvYcCXCtZjjxCQbsNJsEuOWwSvIhAKY0odJYcpSK8eENwfijygYDEbiiTQeF7BceIF67jl+4iqKUoarJCAzA87aog622GwbL8XskKPch7hUoXcmAR080GlLqpy66bnNDLBy9b2xlOBgTDhlqR2zj2CNNI/Fwlqd5wzYmZC53dH1C6HiU3CVVA== X-Gm-Message-State: AOJu0YzGW0zE/A39Sx18O+WEpplTt2p71z32Lu68hWz6qa/+8AySrc3K vyxrjGveBwLxUKwvjgMtOOgITjkL0dBjp3zBZ9IuppZP2skf9Qar X-Google-Smtp-Source: AGHT+IHWKwkSK1ytiAW1r2Ov5xRhiZaGIAHS2Hpi1bSuABqHSin/KKYSUQ9lqorzsn903tMnQwJgPA== X-Received: by 2002:a05:600c:3109:b0:412:f007:639d with SMTP id g9-20020a05600c310900b00412f007639dmr7399171wmo.23.1709918895600; Fri, 08 Mar 2024 09:28:15 -0800 (PST) Received: from prasmi.home ([2a00:23c8:2500:a01:3c2e:cd45:f50f:f083]) by smtp.gmail.com with ESMTPSA id jh3-20020a05600ca08300b0041304100fa9sm6445317wmb.45.2024.03.08.09.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:28:14 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Chris Brandt , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 4/5] i2c: riic: Pass register offsets and chip details as OF data Date: Fri, 8 Mar 2024 17:27:25 +0000 Message-Id: <20240308172726.225357-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar With an increasing number of SoCs reusing this driver, each with slight variations in the RIIC IP, it becomes necessary to support passing these details as OF data. This approach simplifies the extension of the driver for other SoCs. This patch lays the groundwork for adding support for the Renesas RZ/V2H SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Fabrizio Castro --- drivers/i2c/busses/i2c-riic.c | 59 ++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 49a12f1ecdf9..3398d639b754 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -46,18 +46,6 @@ #include #include -#define RIIC_ICCR1 0x00 -#define RIIC_ICCR2 0x04 -#define RIIC_ICMR1 0x08 -#define RIIC_ICMR3 0x10 -#define RIIC_ICSER 0x18 -#define RIIC_ICIER 0x1c -#define RIIC_ICSR2 0x24 -#define RIIC_ICBRL 0x34 -#define RIIC_ICBRH 0x38 -#define RIIC_ICDRT 0x3c -#define RIIC_ICDRR 0x40 - #define ICCR1_ICE 0x80 #define ICCR1_IICRST 0x40 #define ICCR1_SOWP 0x10 @@ -87,6 +75,13 @@ #define RIIC_INIT_MSG -1 +#define RIIC_RZ_A_TYPE 0 + +struct riic_of_data { + u8 family; + u8 regs[]; +}; + struct riic_dev { void __iomem *base; u8 *buf; @@ -94,6 +89,7 @@ struct riic_dev { int bytes_left; int err; int is_last; + const struct riic_of_data *info; struct completion msg_done; struct i2c_adapter adapter; struct clk *clk; @@ -105,14 +101,28 @@ struct riic_irq_desc { char *name; }; +enum riic_reg_list { + RIIC_ICCR1 = 0, + RIIC_ICCR2, + RIIC_ICMR1, + RIIC_ICMR3, + RIIC_ICSER, + RIIC_ICIER, + RIIC_ICSR2, + RIIC_ICBRL, + RIIC_ICBRH, + RIIC_ICDRT, + RIIC_ICDRR, +}; + static inline void riic_writeb_reg(u8 val, struct riic_dev *riic, u8 offset) { - writeb(val, riic->base + offset); + writeb(val, riic->base + riic->info->regs[offset]); } static inline u8 riic_readb_reg(struct riic_dev *riic, u8 offset) { - return readb(riic->base + offset); + return readb(riic->base + riic->info->regs[offset]); } static inline void riic_clear_set_bit(struct riic_dev *riic, u8 clear, u8 set, u8 reg) @@ -453,6 +463,8 @@ static int riic_i2c_probe(struct platform_device *pdev) } } + riic->info = of_device_get_match_data(&pdev->dev); + adap = &riic->adapter; i2c_set_adapdata(adap, riic); strscpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name)); @@ -497,8 +509,25 @@ static void riic_i2c_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } +static const struct riic_of_data riic_rz_a_info = { + .family = RIIC_RZ_A_TYPE, + .regs = { + [RIIC_ICCR1] = 0x00, + [RIIC_ICCR2] = 0x04, + [RIIC_ICMR1] = 0x08, + [RIIC_ICMR3] = 0x10, + [RIIC_ICSER] = 0x18, + [RIIC_ICIER] = 0x1c, + [RIIC_ICSR2] = 0x24, + [RIIC_ICBRL] = 0x34, + [RIIC_ICBRH] = 0x38, + [RIIC_ICDRT] = 0x3c, + [RIIC_ICDRR] = 0x40, + }, +}; + static const struct of_device_id riic_i2c_dt_ids[] = { - { .compatible = "renesas,riic-rz", }, + { .compatible = "renesas,riic-rz", .data = &riic_rz_a_info }, { /* Sentinel */ }, }; From patchwork Fri Mar 8 17:27:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 778968 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 A496C5A4D3; Fri, 8 Mar 2024 17:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918900; cv=none; b=WoGmOOSxya3LNWkP2xRMj34QO7v8/66bY6CWb2qRmH2c7ey92ZTlwAmyWJSghzWg7BVWty2J3svF36GjxTlVXOv5NXP2ew7TR01CDyll8L66832zAvJWKcMsyZ4++co/Vts0MFJXwR6hWs2HIEDPk9UI+1jMFjCv6/89FDCVwGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709918900; c=relaxed/simple; bh=ZFyhMebXncZKG1nTfAjv5cXd0xT6hnBUMy6tl1hDMYQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qDrPsPea35abehZiED9vnzBj9ydVUWXpyx6sYLtPWfHe5ZrjifztlokrvvbbcqjbOIxKzRLI46OwlLKrhxlbtn/4PXU4nhY/R7HY7/oFLfwxx3bdlAA2TMfSnOaR7O3Kieh+0cypuqlqwSgUlS9zFkKAkZmyv3CUM9kcgJxhaOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OPJtjOFX; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OPJtjOFX" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-41312232c7aso11223755e9.0; Fri, 08 Mar 2024 09:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709918897; x=1710523697; 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=2Ein8NH1oPEXg+kxZrqFMKuNKb3lh44GWcHeiabOaFY=; b=OPJtjOFXMGjaSHWgwGKjm59g+E+OmmrCBedEiOUZbwchawX/e8JJgotWRLHwkPo5q/ wDWm8iME31gA+4oK+aRtAcVycpDXacLHXpvhNSVpZq0IPTPes2O/B0aGEZJzunUlSurI laAqcuXjNlKYsx76D7zCC7u9rDLfYSgFE289GsGOlVkVz4UnNZdL0VKBPRKvUW3TMdSh KcOpc7DjQq8V8+SIeaEgu/QP76I5EcqtNhvnHLJOpzBNzw7eyd7o+aO0y/bfBZzAGpQm AmPXapYCoshfU6WKv0+tVe2oqr6K/SVd4H7VGU6EqS12iSlekWJRHrn1vHJYDTb8OvSD cNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918897; x=1710523697; 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=2Ein8NH1oPEXg+kxZrqFMKuNKb3lh44GWcHeiabOaFY=; b=vcJgPcG5+xBPDql9bID2Ej2QirtxY7fqvbQmwXBQwojyOF0dMemggmrp/Q/2jnSgqY QDhdh6kbxlEauhQ7FlTXil9LiFaOKdtzvBpHg7t3SryqR7OSvDhfyd7/w8w/UZjXXXKS 3/5BQcXS/5aFteuvMWDUAlCHgB9lWRfXUmqp9YYBaNdGRb6Hmv0NUklsqEs9qqswtS32 xrAoCDI/XcD1tqNVcOQtykwNdohsAzHc/xlhk30jutgojRTzgfSbaJiJt+PH64zU/DRt UV1S0Xd+td30608h6NsGa48owWfpbUUqGqtJf0tnAOhynoUdpm3qZ6s9xc9rin1O6SmT 65SQ== X-Forwarded-Encrypted: i=1; AJvYcCVO2iq1bfn4Pu3iUaDq8REAGZXPlpXnxvvAb8JkJ5rp1wd7mFSi+qLwwEjwy3HagRwKo+86IK5CCF6cad+oaqxkyuu+fCLEarnfsS3BDUyA6/i07nyOsXEEeBYrwN8KonOu6VuPsctSW8gn8uufGg5xNU1aEPEk/iXx5vIBs9aYoBTgcQ== X-Gm-Message-State: AOJu0YzAWgkeHFVPnnPGGaROQHr4FLtw0IKXZB3sEXjZWscuS/ebcAvD NUVhObobKKRJxpZddjqqA5sZEdmvvnBlTYHOleQHDEWYWxiASSE0 X-Google-Smtp-Source: AGHT+IHEA1lBo+eZJhir2sUKspEOmBhZljzrcl/86cQKA5oYV1dWULlrO77zDuKum9uYDWzQPnayRw== X-Received: by 2002:adf:9589:0:b0:33e:1de4:59bb with SMTP id p9-20020adf9589000000b0033e1de459bbmr949192wrp.23.1709918896984; Fri, 08 Mar 2024 09:28:16 -0800 (PST) Received: from prasmi.home ([2a00:23c8:2500:a01:3c2e:cd45:f50f:f083]) by smtp.gmail.com with ESMTPSA id jh3-20020a05600ca08300b0041304100fa9sm6445317wmb.45.2024.03.08.09.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:28:16 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Chris Brandt , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 5/5] i2c: riic: Add support for R9A09G057 SoC Date: Fri, 8 Mar 2024 17:27:26 +0000 Message-Id: <20240308172726.225357-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240308172726.225357-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Extend the RIIC driver to support the RZ/V2H ("R9A09G057") SoC. It accomplishes this by appending the compatible string list and passing the RZ/V2H-specific OF data. Additionally, this patch introduces an riic_family enum for SoC variants, replacing macro previously used. Signed-off-by: Lad Prabhakar Reviewed-by: Fabrizio Castro --- drivers/i2c/busses/i2c-riic.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c index 3398d639b754..fc814a4f06a6 100644 --- a/drivers/i2c/busses/i2c-riic.c +++ b/drivers/i2c/busses/i2c-riic.c @@ -75,7 +75,10 @@ #define RIIC_INIT_MSG -1 -#define RIIC_RZ_A_TYPE 0 +enum riic_family { + RIIC_RZ_A_TYPE = 0, + RIIC_RZ_V2H_TYPE, +}; struct riic_of_data { u8 family; @@ -526,8 +529,26 @@ static const struct riic_of_data riic_rz_a_info = { }, }; +static const struct riic_of_data riic_rz_v2h_info = { + .family = RIIC_RZ_V2H_TYPE, + .regs = { + [RIIC_ICCR1] = 0x00, + [RIIC_ICCR2] = 0x01, + [RIIC_ICMR1] = 0x02, + [RIIC_ICMR3] = 0x04, + [RIIC_ICSER] = 0x06, + [RIIC_ICIER] = 0x07, + [RIIC_ICSR2] = 0x09, + [RIIC_ICBRL] = 0x10, + [RIIC_ICBRH] = 0x11, + [RIIC_ICDRT] = 0x12, + [RIIC_ICDRR] = 0x13, + }, +}; + static const struct of_device_id riic_i2c_dt_ids[] = { { .compatible = "renesas,riic-rz", .data = &riic_rz_a_info }, + { .compatible = "renesas,riic-r9a09g057", .data = &riic_rz_v2h_info }, { /* Sentinel */ }, };