From patchwork Fri Jun 10 05:47:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Potin Lai X-Patchwork-Id: 12876461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48FD2C433EF for ; Fri, 10 Jun 2022 05:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SJxDSMVIEyKcxn8zHlzcfbUIBpSxQ6OaI3EqYrcjUZc=; b=0hI3xagkI+Otve UFppan8nD4uway1zspgStse0L3s3SUgvUDVIQ1d1hMj41oqR7eHJkMSOKnbnRucJYgjPRFbWdz4pe WKKY7JgTVCUAkP4VsY753KGmXybCyby1xGOAiaEMWKjbaWPUPlH81vmk7I+vqGO8SFBLKh2oIPM5f WB3qxm6z6u5A0H4qoAlZcxINrqTYGJGqTY57wAxIhk3f2+72DRIk2yLvJv0/7yi8VHAdKnCyJ72SC 2XXeBFn7l+hml7mH7L3Da1VDJp7zH/RGGc3t+AyngS5isENt/xFbN5lMFd3q3lMaELpEMTpBoViJr j7I+YdAHEgh7BrnDefHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzXXO-0062SF-1J; Fri, 10 Jun 2022 05:50:26 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzXXC-0062OL-76 for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2022 05:50:15 +0000 Received: by mail-pl1-x62e.google.com with SMTP id i15so5219348plr.1 for ; Thu, 09 Jun 2022 22:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=CyWSAedHHH8WOxnS1FteZqFj5RO4XNsT/w2yY6pNZrc=; b=jHR51n/rBZXorS4PRtas+KNzJoLw6JfmAVpo03Uz8XvakGqSmLngXbqd9fTuRdA9Mr SUJiTBmkgQqspCzny5lDbppvFmIb4xmVCwdwq4KaC4L8VKtAHugPVxQVarHYSjtI2h7A 4zPxthNNKz5glgSA0Wv3fIbM3s1VdBIoWclgU+TE9GX1SYQ+PF1Psu/S0FetKS5t47zH RccexJgGc1JV5kSPLo1qn9xb1M+u21KSVNu6OiwNN4z3twy3whbFGeX5SEo568BRRVnZ yRNqshxv8YKAsFL1nKnoUsDOh58GMLwJ1edKiLjpMXlXvsxUJMM337c29gyT52dlRehf T1kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CyWSAedHHH8WOxnS1FteZqFj5RO4XNsT/w2yY6pNZrc=; b=LB6xklJWuCOIgA/NrXWbmwvb6BW8Fu9foP23xAv4pPRqLnxzCOFJ14fsQTHBT5I1ul xbQkVhS6r5/q/gA+dB8p7wPegQyB7Im/QkFU9OEA84B/1s8vQUk/+MEszgAx6/ggXmNI 0x0RX9bz+fwfpDpJkyilJjO7fDsUijOS1+44DxJitHFBwa9rNgG4Zer+Aa1e6DIAR5CW 4eYus8GAfI//h6knyc+w4N1UbPZgQB2XmOhXzvAEyYcV92XSej87zE8lPU59Md5fyQQd LBhPcahbu1aiv0hkl3SE6oHyaZhFmuehjwwD31MeuHPL545tSb/O9onBTY7RbabDN8bU JoNw== X-Gm-Message-State: AOAM533rH7iWxnof7xyZ5HFl5MronLfWVHhyvyZadFxcsGlyB3Yewz4d p6cXxkWKZl8bkaMB+x065G9CoInJY3kw8LKK X-Google-Smtp-Source: ABdhPJxVzUr7NUgjQryDfxWm2iEgiYJMjWQvXvaoZfjKjxdgdkHJ5HjzaHdIlY3E5Izq5281au1t4w== X-Received: by 2002:a17:90b:4b0a:b0:1e8:6ff0:7ec1 with SMTP id lx10-20020a17090b4b0a00b001e86ff07ec1mr7096038pjb.212.1654840207358; Thu, 09 Jun 2022 22:50:07 -0700 (PDT) Received: from potin-quanta.dhcpserver.local (125-228-123-29.hinet-ip.hinet.net. [125.228.123.29]) by smtp.gmail.com with ESMTPSA id f11-20020aa7968b000000b0051b90ac6c15sm18553977pfk.125.2022.06.09.22.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 22:50:07 -0700 (PDT) From: Potin Lai To: Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , Rob Herring , Rayn Chen Cc: 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, Potin Lai Subject: [PATCH v4 0/2] Add a property for setting minimum persentage of i2c clock high Date: Fri, 10 Jun 2022 13:47:20 +0800 Message-Id: <20220610054722.32229-1-potin.lai.pt@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_225014_295092_872913FD X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Introducing i2c-clk-high-min-percent property for setting minimum persentage of clock high. This driver will go through base clock divisor and calculate a set of high/low clock with duty cycle applied. if driver could not find a suit high/low clock set, then it will use default duty cycle (50%) recalculate. LINK: [v1] https://lore.kernel.org/all/20220530114056.8722-1-potin.lai.pt@gmail.com/ LINK: [v2] https://lore.kernel.org/all/20220601041512.21484-1-potin.lai.pt@gmail.com/ LINK: [v3] https://lore.kernel.org/all/20220607163703.26355-1-potin.lai.pt@gmail.com/ changes v3 --> v4: * rename property to i2c-clk-high-min-percent changes v2 --> v3: * discard the properties for manual setting, use duty cycle to calculate high/low clock. changes v1 --> v2: * update bt-bindings documentation * use meaningful values for properties instead of acture value in register Potin Lai (2): aspeed: i2c: add clock duty cycle property dt-bindings: aspeed-i2c: add properties for setting i2c clock duty cycle .../devicetree/bindings/i2c/aspeed,i2c.yaml | 7 +++ drivers/i2c/busses/i2c-aspeed.c | 56 +++++++++++++++---- 2 files changed, 52 insertions(+), 11 deletions(-)