From patchwork Thu Feb 1 04:46:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aahil Awatramani X-Patchwork-Id: 195157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp209090dyc; Wed, 31 Jan 2024 20:47:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4H/884nRvD8JCKqjZ0qECLbcH7jIxnea+O2M9KoId4ZjWX/QUz+m8taLu3D2Q2RhvS44N X-Received: by 2002:aa7:c3cc:0:b0:55f:43f4:9ba with SMTP id l12-20020aa7c3cc000000b0055f43f409bamr2269356edr.34.1706762858090; Wed, 31 Jan 2024 20:47:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706762858; cv=pass; d=google.com; s=arc-20160816; b=TNIGHEUCEx3Io+82HPon4RGXWogW0rb6zMmpK0VGaesriJnV/ihm0mvj23jBeb27fL qbQBBJibQ5kD7JZzaqEr0EBvaPgQvaYCVsfhYe3eYYrPCtH5S49sXO+hz+6z5eDFmhGM YV4W3yCTz6bEP7TL37YNBgFRQZk1rMscc7fdxQbg3ZCjprYUsea509EnBf8jrzKkqZsB DXxRRuPkaSWwklhv5zw3A45fQge/Z+Q4HNzZrtIUPFobTEJ6bSNfsMlMXJhcortbvVQv VJ7W0Y7b1K7dLDyhkuw0ZpjpPjmZ50lXsRR/fBVQCox/zlncmuCsUbm2Y1YYdXdFZIwT HKXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=uYSo7dLHiN39LMct+TvOkaek+OHlhRLiZBJ+JHrrHE0=; fh=YLsW+5qzeK23MjHZdqmITfNSBmJXtD5RArrXcFu7ix4=; b=KGWLg/CQV7eWnReysjNCptLK2td1zHHNTiMIAYsTn7Y2a43BRKeot9omk53FcC63Fj c5IxziZg3ud4mPeW9WMuLnczep3hqKqUvHZJxlM+sQODxqNJa1P2ql1oC20M4ad3dKkg lnVxXowbBSiKcZQKKSyUYnYfav5IvTnoCi7jFuoWYADOw0hZry0t5Zta8iFy8Ga8GrbH 1AroWDzQP14FKxgFgOiB09DebI5UmcUva50FXCi0++IjeQjDaaTVSu+qQX8ZhvpPmLfx KReklueOIuX8YsYco81sOS+/1V0tGuPRJLk9p9tVXOIRuRo5KG6dpqi0ucR7F3Q9wr6L VK9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="MtSY0Pj/"; arc=pass (i=1 spf=pass spfdomain=flex--aahila.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47629-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47629-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCUNtiyPZ+7IP2GNgf906Z9q0bAlzXYypUWZw8IaYdVHlISnliTmbHcWZUxKiLqc8ojf2Q9FqNvYzJ/oO2R2D28ZTGS6Vg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fk4-20020a056402398400b0055f986fe347si879489edb.96.2024.01.31.20.47.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 20:47:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47629-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="MtSY0Pj/"; arc=pass (i=1 spf=pass spfdomain=flex--aahila.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47629-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47629-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D103F1F22D86 for ; Thu, 1 Feb 2024 04:47:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 837C03CF76; Thu, 1 Feb 2024 04:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MtSY0Pj/" Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 4CCFF3CF52 for ; Thu, 1 Feb 2024 04:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706762807; cv=none; b=RESyq6LlH+dudOJ2kcyHyHJdM7W0Xj7Lc8OaWBoLVS49e/79WNMmFwzc/tatFDKW+5qakwhryNF/GzV53UIhCTia7BrW7h5YRedVqeWFiKvQIu+/HT0ckaB7O3Yw+mc02Ma6ClcK/2hiVyvC7FajdV5tkFMJc6COdQr4r+YeqTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706762807; c=relaxed/simple; bh=4VGGGcaYk35HxXgdSmdu935kGFSoAd32AIvMtmVqZPQ=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=MGZADbCS1bW7K5jBbwQ46siHlfCcA0NAOFofRWBm0MoFKmg6yDv6UDsxT25eRUvg+YmyFK7H7prrFuvsJz5zVNcVBAbsvcPwX+V3/qpYlmqSqh5Ikufd2lx9yc65MOZLv87ZhWkV9sxjcleF5+Im+TNRL6vUGy9g1nW9BgWGipE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aahila.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MtSY0Pj/; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aahila.bounces.google.com Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-5d8c924c8bbso589575a12.3 for ; Wed, 31 Jan 2024 20:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706762805; x=1707367605; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=uYSo7dLHiN39LMct+TvOkaek+OHlhRLiZBJ+JHrrHE0=; b=MtSY0Pj/cyrsCH8V6NyW1kLO7ySRKjHc0+PYyqlrfa3mmN4mkUPx8Gsn9OutO007t+ Rmxg1nesn9bkf5/O2Zn8/gWqYKmqel1mWZvD/Xn5iNeHtAz2bD5TicAYAXBXMKpYrnyg z1IEcHUH5hvlCv0c/W7en6F8ktGwJAjpqaNZQMbhz7cxDLI1L58+boETjp76buNcqoNN dwd2+0y1ya7F6UQHncWBpY0P4csOZmCHzRlGWdD9Anno/YCi8rNzM9AjvShzVIFZH5dz 4LVlljbCzZPQj2zC5ypFH4FqjKkmW+x7G2vEj9OPllsxAHkQTbdqX2bNNf4L7BMUEk7q aIJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706762805; x=1707367605; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uYSo7dLHiN39LMct+TvOkaek+OHlhRLiZBJ+JHrrHE0=; b=taUeyTV7DUsjIKxOtVHvwZBGHLFX6xuMUwANzkIn2LAEfk2VSIcKm5K9eftJdKLN5m +EBgxdIWkMqFtRln4ODHOvvx34i5SHtTVyPjivNVnBuCoH7WjMRbCgLIJKTCr71amoWi dhOAR0WRxmAxOz4aTBOUbORZx5woNKdi+hjQUoRTjM1y7rpCZcue7z9jV9IYY3b1MyiC Y9Vq4zQGBRoPgZPE57spD8XmqmsbvZY+99AZrFCupJ/T0+llbW3w215XLceZSMeSnvzR Z0REIEbQuvtfYRpISlSjFUKDbQ+uKrVNNjK+VbzfuhB3/eq8zEXuqzOwYXqWAGAChza1 TD0w== X-Gm-Message-State: AOJu0Yzm8fPqdGTyreJIDXIIdB1CqqfxJRKuSUvE1dj42l6+zaekqC+a 2gLoTinrO9Etmqs6r6Wf9sF43dm202VY0arTh6QfhxI6veYRk/9AGlzPsbEOo+FUsiy6GRHugI+ yWg== X-Received: from aahila.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2f3]) (user=aahila job=sendgmr) by 2002:a65:6115:0:b0:5d4:e18a:1e5 with SMTP id z21-20020a656115000000b005d4e18a01e5mr88518pgu.5.1706762805440; Wed, 31 Jan 2024 20:46:45 -0800 (PST) Date: Thu, 1 Feb 2024 04:46:22 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240201044623.374389-1-aahila@google.com> Subject: [PATCH 1/2] dt-bindings: i2c: designware: allow fine tuning tuning waveform from device tree From: Aahil Awatramani To: Aahil Awatramani , David Dillow , Wolfram Sang , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789670570576277960 X-GMAIL-MSGID: 1789670570576277960 The Synopsys i2c driver allows a user to override the parameters controlling the waveform using ACPI; this is useful for fine tuning when needed to make spec compliance. Extend this support to the device tree to allow non-ACPI platforms the same capabilities. Signed-off-by: Aahil Awatramani --- Documentation/devicetree/bindings/i2c/i2c.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt index fc3dd7ec0445..3c33c36571f9 100644 --- a/Documentation/devicetree/bindings/i2c/i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c.txt @@ -45,6 +45,24 @@ wants to support one of the below features, it should adapt these bindings. Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C specification. +- i2c-scl-ss-hcnt + HCNT value for standard speed mode in I2C Controller. + +- i2c-scl-ss-lcnt + LCNT value for standard speed mode in I2C Controller. + +- i2c-scl-fs-hcnt + HCNT value for fast speed mode in I2C Controller. + +- i2c-scl-fs-lcnt + LCNT value for fast speed mode in I2C Controller. + +- i2c-scl-hs-hcnt + HCNT value for high speed mode in I2C Controller. + +- i2c-scl-hs-lcnt + LCNT value for high speed mode in I2C Controller. + - i2c-sda-falling-time-ns Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C specification. From patchwork Thu Feb 1 04:46:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aahil Awatramani X-Patchwork-Id: 195158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp209123dyc; Wed, 31 Jan 2024 20:47:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoeztSRDS7p900BH4unMIIG8JqnVMt86vsEUO8aK9LM2eyxgFGzBNC8ka+cH+u2lum0Sq9 X-Received: by 2002:aa7:d386:0:b0:55f:64ca:5a6e with SMTP id x6-20020aa7d386000000b0055f64ca5a6emr2233493edq.12.1706762864118; Wed, 31 Jan 2024 20:47:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706762864; cv=pass; d=google.com; s=arc-20160816; b=HvxWdovdE5bg4briZqzqZXAxGR8RdP2kQ4Yq2rJT55aMGeSwDEyCG7ehqQj5FtFM4N w8WpPutql74mSYOh3xl1IKkooftxEWqnvvIVyItFePUzSoNw3qjP5IGIkaw2ldGoFftu D1/bd4hFSV1ki4envS17ECUlHBYpq4BtD8AKXh+FwzJt+TSEPfEJTSiE0qlVIkOpAK9e 4eta+1ffw10/LjB9NHb5HuoeoA05asH8+D9cn4XJJOUwDCPjSCwv7mJIKh5neuHLm1kB RNT361VboyaiQSpiKrd/hDA1FtxKdrhFOoyr8Ls/qc6Nabp9p2zS6tifkn5BCTZmBxAx bWcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:in-reply-to:date:dkim-signature; bh=8c691bs4raW5tl1fD8/M9N6DqO7UPyEHeitm4Vwh450=; fh=RY0QezBbJVOqEtsVVvFqFwqZ38g8ef/9+8exrmQfU5A=; b=np0uq2bv8/Qzc3gsQ2ILzK61bByDVxx4OjFexVuNVnZZW0y9aYko4A2xerihC6jtYO IIDOUOuJCrlUxEUZ4sLEdjtOhg92Kv4OSKTfig3o3hxdn7LJxjvd6nGtQKbj3bq6SekB mTplKutKEgzQ63NmiJo9hpJDKVwr2U1OJc+91TUZt6OOHD8DqYGtZ4R7nQb50+oajEdz aqj6awoYdw4muJxM9MGR8kyurAF5Ih/cvADkr3sGNB+nHY8dUJoz+JS3G1aHejW4AQNy EThnISFZ2DHYF1lITC8ntGJjo6zB91+hm+w5xCKi9rJLgzcfRSzNgvPVE/JP3ObHkFdV cTTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="N8kvZ/ir"; arc=pass (i=1 spf=pass spfdomain=flex--aahila.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47630-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCUQf0IGEJNdCMaNqzXBh7sl6TsXze5pi2W3TgWpKZI7M/WFlp+8QbraxVmC+FfyjSgH4A6n+KiUFb+bkXZr7rSMBErpqQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h13-20020a056402280d00b0055fb80240d3si173999ede.140.2024.01.31.20.47.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 20:47:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="N8kvZ/ir"; arc=pass (i=1 spf=pass spfdomain=flex--aahila.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47630-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47630-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EA2EC1F22635 for ; Thu, 1 Feb 2024 04:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 587133EA6B; Thu, 1 Feb 2024 04:46:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="N8kvZ/ir" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 1141F3CF6C for ; Thu, 1 Feb 2024 04:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706762811; cv=none; b=ilgRxnoyisxr/sMhgbWf7ElB3jSqytCpTsGaQSTnaueWHActVhGjKpPVsrgdEFaNETb/6gLzRkoKKAXGefhM41ZUV3msSPA9vOQMeKziuOUaNIU80kcaTOuNwp8sad5BcRDRlGPbEZYt2VD20NnBsaPOXQLE+Y9BJX7aG7jn6BY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706762811; c=relaxed/simple; bh=Twt8VpGAnLnDknK+2mkdxRc9XEHSq6p2WMav1kEzpAw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=tkQbSBPv4JgLO/NnhIWq5bwR0Uau3IZb9l5QGQuy+qZkbeOHYyZ8UZMCr4wh1WHJ1u+Sx7fq10iAZSTL792Fo7DEH6XGz5N3zXR87I6T4Lr33MEa44/xdRNFz261l//MEqM8yVeQJEigGzEX/c64AUqwPHT3Axtr0+33TadcwW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aahila.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=N8kvZ/ir; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aahila.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-604127be0a0so10952937b3.1 for ; Wed, 31 Jan 2024 20:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706762809; x=1707367609; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=8c691bs4raW5tl1fD8/M9N6DqO7UPyEHeitm4Vwh450=; b=N8kvZ/irzYvcuRYBw0Ut78xk7XwlNAtgF9N5BGOaTXIjxMZre/TZb/nyjnvb504t0P aeBELdHdqmSd10ai3mPQ2E/YoACMofobbkxoQQCHFUuV15LHlzqHhjh/ihB0HQwCS/fG D5aMjpE8EA7c5zpsepMW/nT+KS54+YoaVRXDNHNYi2FWBHCFyf0Swu01tYZmXdZBp87y D09pf+yqRVhcyO2jX6YvRC+nPLaV2mCBxvt00qs+n1DhwI2uW+HqSksFHL8dDEHHo3tD iiO/nRI4VkplJJ69tUGaeoC/Y9aXf9+ksQR4DakdR0IF7sYxE4Pg8/76SrMedq1zROyJ zdSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706762809; x=1707367609; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8c691bs4raW5tl1fD8/M9N6DqO7UPyEHeitm4Vwh450=; b=CcV+DSkTvvfvRVeDac/fI4TB8pTbFIRKdY4QMt02MGg0UPI2JHVQfQLKJBtuDrEvc0 2FJdqHPbC40uS4uHl5R64I0NBXu+RmYKfnpAe9cQoplkIcNPCLqhqG75pUUJ9vV7OX6P DVvcJpC2h7YWAQ8gTSiRLoY+QOcEgQJJ1ireKL6D9mhNrRbwrdvi37wElOUFeYM0sX3s tNxTihlWQRqQqf+XSG3JrtAvCg0Bn4eseaWPTb0b4wJvrNVpQJe9hHwzk4zU2EHThfp2 o/0f5OTHtFYdP9L/DPutKkonXYotlv84WnPDplAPnjD8V91ufr9fJaR2b1HeqVAU1Fmi pvrA== X-Gm-Message-State: AOJu0Yz8r13Gu2LKs9fR0jtm6d73pOdFQFFxfFkdGJklPhCLIuVA7gPb wcBYxhWoRHrPq8O7FO8plewf+kOFndU1zkzz2qegKlLeD8dWM7zpiDaykkhZ9/IgZjWksH3JkSJ rlg== X-Received: from aahila.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2f3]) (user=aahila job=sendgmr) by 2002:a05:690c:f85:b0:5ff:9eb1:29a6 with SMTP id df5-20020a05690c0f8500b005ff9eb129a6mr796091ywb.2.1706762809133; Wed, 31 Jan 2024 20:46:49 -0800 (PST) Date: Thu, 1 Feb 2024 04:46:23 +0000 In-Reply-To: <20240201044623.374389-1-aahila@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240201044623.374389-1-aahila@google.com> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240201044623.374389-2-aahila@google.com> Subject: [PATCH 2/2] i2c: designware: allow fine tuning tuning waveform from device tree From: Aahil Awatramani To: Aahil Awatramani , David Dillow , Wolfram Sang , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789670576710426904 X-GMAIL-MSGID: 1789670576710426904 The Synopsys i2c driver allows a user to override the parameters controlling the waveform using ACPI; this is useful for fine tuning when needed to make spec compliance. Extend this support to the device tree to allow non-ACPI platforms the same capabilities. Signed-off-by: Aahil Awatramani --- drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 855b698e99c0..09c464874fdb 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -132,6 +132,17 @@ static int mscc_twi_set_sda_hold_time(struct dw_i2c_dev *dev) return 0; } +static void i2c_parse_cnt(struct device *dev, char *prop_name, u16 *cnt) +{ + u32 tmp_cnt; + int ret; + + ret = device_property_read_u32(dev, prop_name, &tmp_cnt); + if (ret) + return; + *cnt = tmp_cnt; +} + static int dw_i2c_of_configure(struct platform_device *pdev) { struct dw_i2c_dev *dev = platform_get_drvdata(pdev); @@ -146,6 +157,15 @@ static int dw_i2c_of_configure(struct platform_device *pdev) break; } + i2c_parse_cnt(&pdev->dev, "i2c-scl-ss-hcnt", &dev->ss_hcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-ss-lcnt", &dev->ss_lcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-fs-hcnt", &dev->fs_hcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-fs-lcnt", &dev->fs_lcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-fp-hcnt", &dev->fp_hcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-fp-lcnt", &dev->fp_lcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-hs-hcnt", &dev->hs_hcnt); + i2c_parse_cnt(&pdev->dev, "i2c-scl-hs-lcnt", &dev->hs_lcnt); + return 0; }