Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp229897iof; Mon, 6 Jun 2022 02:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw36GBugTMEAas+ZnIhzAk2rLDPEgq14lHkXXShkvzqD8RxKRyIJV+kTQP4MWdoQbGFMs+0 X-Received: by 2002:a17:902:9b8a:b0:163:d0ad:f9e8 with SMTP id y10-20020a1709029b8a00b00163d0adf9e8mr22879575plp.79.1654506612423; Mon, 06 Jun 2022 02:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654506612; cv=none; d=google.com; s=arc-20160816; b=c381GhoTJ9knnBEwqCMboFfpHp75RJ3PEb8CIotuK4vZSP8P2BKoJZf6Z0dCMBKx3F JcwuJU9E10tKA+y0vsPeln6ig40InsyvWmt4G3z4NVUNuHkvpfF0I6cWUy0/9iF2tkIP 7Og4zvYzrtHJjD3XalPZeHYCTw4lkkodoRcTjJAPaaRBprfnUBCC7Za4Jr0KYFUqzpfW zrWsE+K6TW6BlxaTilyLaZS4+qubbBD5OpaYmwcMaxtmhq7u0F++vlAL7S/IjtgV0BNI XWYdD+1vfHbDtStsGWyQIKzYBhWGeeFt90C0elar/swi62hmEGg/6nIO2Lr6hIg8R8lw YGyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=9jt8S5U1f1kOACj8Cd91MdGJdCEtZCqF+0G+U8Im1w0=; b=gReiLwiYnNRLEwbqqGYK77yRUk+5JEJbpIHFdkPXkdk9ZUzQBMaJobATssfp8wi/fb tMqX62hzJ2rmcqLpkG6tBpvpOfHtw/iRdRUEZZQW/DShEE1uHiSckAQ9Qw96udQZIs45 EbJHEbb99+o+up6RIwy4tlz6A7aoC+vXXlP9xgltJnUZc1Ux5iRNNi1bQEd15LuJ/DQ5 BlB8yGAy6S4mUi8OvZkrHA3jFyy6MqOC7f4JUyZBNJFPqKv+KlZmCkkw3gTJvaEe8uIZ bTylS+Xl94xHjfsECM/y1krbhKz83eIMkYAcuyiFeDbHkD6JLxXqza0f+IyS53Qo7DZi IWDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hvc4xds3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q144-20020a632a96000000b003fcea910b03si16274766pgq.523.2022.06.06.02.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 02:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Hvc4xds3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E2BB2150B46; Mon, 6 Jun 2022 01:43:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbiFFIlr (ORCPT + 99 others); Mon, 6 Jun 2022 04:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbiFFIjW (ORCPT ); Mon, 6 Jun 2022 04:39:22 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A6F433E95; Mon, 6 Jun 2022 01:39:11 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id u12-20020a17090a1d4c00b001df78c7c209so17304410pju.1; Mon, 06 Jun 2022 01:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=9jt8S5U1f1kOACj8Cd91MdGJdCEtZCqF+0G+U8Im1w0=; b=Hvc4xds3Ld7nAJoFdHYgv6+UFN82CWncpDasinypvWoPemToMat6BoFjtJTCdNtruy xpm0n7Ecsr9mqwIrgfF6+2JuLkB3pkqNOk1gdBx7tWSUfOB5WPreDXz1YV6TSZRLoC53 dkWeL14FRfZQh4I1nArWCy/RtcNe0rKjqYoxPtMhAp33eQF7bjyYyjYnAQOM727//P0X 28z86ae0g4jemj+bzT0QCHanlHnlKulad53O8aID3XjFS1PKnLAT0Iu/1J6achDaY+3j 02GXlT31Eykn1GX/23JF98/HAjrkTcbX+pi/6tzzrI28/c6rajgm1qIHBD1B9BvvCBxm AU+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=9jt8S5U1f1kOACj8Cd91MdGJdCEtZCqF+0G+U8Im1w0=; b=eLt0rZz49MSXFtbN9FpW6MOBCIeME/zyR1NHjbRsY5ejk32I76z49TONdYHlAp5Nfo wnwEvqZmnkEO3/J4frOXWO+VP2Z6TFjzo4xEoOLMDolJmtJzvCEsSsIKybXXZOR8upK9 3+76H9Id3egSMtVkTVf7Y1V566enn4H10nh2yDUXZjmciZS4bNwW4ifQt5FyxxaNhzCd 8UExUzpEZ8TAxav35M0rgEZHWbJeO6aTju7hzhkgk9wjDzAjF597jscxr993koEsxCbY 2THkLewzaWAKheBk9itCPyblhuZ/aRFtg5OfXfbgcD1pMGnw1F5aoWtQniz3esoQD9E9 asdg== X-Gm-Message-State: AOAM532/Gm5LOaISX03xbrv6Fs2gUJo9oG1JK+mVtK+vusjSwvEClEsi JGzOqR4jd0V4VueWUCoyHde5Ebr5gWgHow== X-Received: by 2002:a17:903:186:b0:167:62b0:a556 with SMTP id z6-20020a170903018600b0016762b0a556mr10753955plg.122.1654504750423; Mon, 06 Jun 2022 01:39:10 -0700 (PDT) Received: from [10.10.12.193] (125-228-123-29.hinet-ip.hinet.net. [125.228.123.29]) by smtp.gmail.com with ESMTPSA id 3-20020a17090a1a4300b001e2f53e1042sm11948045pjl.7.2022.06.06.01.39.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jun 2022 01:39:10 -0700 (PDT) Message-ID: Date: Mon, 6 Jun 2022 16:39:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Potin Lai Subject: Re: [PATCH v2 2/2] dt-bindings: aspeed-i2c: add properties for manual clock setting To: Rob Herring Cc: Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , Rayn Chen , Patrick Williams , Potin Lai , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20220601041512.21484-1-potin.lai.pt@gmail.com> <20220601041512.21484-3-potin.lai.pt@gmail.com> <20220605214700.GA3558088-robh@kernel.org> Content-Language: en-US In-Reply-To: <20220605214700.GA3558088-robh@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rob Herring 於 2022/6/6 上午 05:47 寫道: > On Wed, Jun 01, 2022 at 12:15:12PM +0800, Potin Lai wrote: >> Add following properties for manual tuning clock divisor and cycle of >> hign/low pulse witdh. >> >> * aspeed,i2c-manual-clk: Enable aspeed i2c clock manual setting >> * aspeed,i2c-base-clk-div: Base Clock divisor (tBaseClk) >> * aspeed,i2c-clk-high-cycle: Cycles of clock-high pulse (tClkHigh) >> * aspeed,i2c-clk-low-cycle: Cycles of clock-low pulse (tClkLow) >> >> Signed-off-by: Potin Lai >> --- >> .../devicetree/bindings/i2c/aspeed,i2c.yaml | 44 +++++++++++++++++++ >> 1 file changed, 44 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml b/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml >> index ea643e6c3ef5..e2f67fe2aa0c 100644 >> --- a/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml >> +++ b/Documentation/devicetree/bindings/i2c/aspeed,i2c.yaml >> @@ -12,6 +12,28 @@ maintainers: >> allOf: >> - $ref: /schemas/i2c/i2c-controller.yaml# >> >> + - if: >> + properties: >> + compatible: >> + const: st,stm32-uart > stm32 uart? Sorry, I will remove it. >> + >> + then: >> + properties: >> + aspeed,i2c-clk-high-cycle: >> + maximum: 8 >> + aspeed,i2c-clk-low-cycle: >> + maximum: 8 >> + >> + - if: >> + required: >> + - aspeed,i2c-manual-clk >> + >> + then: >> + required: >> + - aspeed,i2c-base-clk-div >> + - aspeed,i2c-clk-high-cycle >> + - aspeed,i2c-clk-low-cycle > 'dependencies' can better express this than an if/then. > > However, I think this should all be done in a common way. > >> + >> properties: >> compatible: >> enum: >> @@ -49,6 +71,28 @@ properties: >> description: >> states that there is another master active on this bus >> >> + aspeed,i2c-manual-clk: >> + type: boolean >> + description: enable manual clock setting > No need for this as presence of the other properties can determine this. > >> + >> + aspeed,i2c-base-clk-div: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + enum: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, >> + 16384, 32768] >> + description: base clock divisor > Specify the i2c bus frequency and calculate the divider. > >> + >> + aspeed,i2c-clk-high-cycle: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + minimum: 1 >> + maximum: 16 >> + description: cycles of master clock-high pulse width >> + >> + aspeed,i2c-clk-low-cycle: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + minimum: 1 >> + maximum: 16 >> + description: cycles of master clock-low pulse width > These 2 should be common. I think you just need a single property > expressing duty cycle. > > Rob Got it, thank you for the suggestion of duty cycle. I will use duty cycle for next version. Potin