From patchwork Tue Jun 7 16:37:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Potin Lai X-Patchwork-Id: 12872133 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 EA5B4C433EF for ; Tue, 7 Jun 2022 16:40:50 +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=qyvjz+023YcogSWoA8Uk2PqOPePfQTP3XZ2RkmVLm9M=; b=n0X/Uu1dJg/zCx Om1qjlXwilWT2SRBhXlg9Rbhvg7R9iuAyZAqutkJy+Xb6EskbzVWq0aVQhLE7Zv4zDQtCxSqDBytN HfvhLqV4jvlnSROtMaCawGd/jsZ5jnNY2QME79LFgOBRPsTWkOFuAs0J3eCfS8zsgrbypM7CeJm1f PpGygd20w+Hww0I7ib+Y1qLfPZ6VgAMX3LFi/JnuezIvPxMJMIZZ7bByWY+czLXuhpSkM1V7kUFuJ a2P2hEipEVIOvpSZJ+lN9n5ga1kfnrgcJkD+VLGax1FlUxW93T1nHoTvYp+6Gh7ijxrounxf31Fdn ms2p0FVgNyR1Qx9ABeJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nycF4-008RWi-4U; Tue, 07 Jun 2022 16:39:42 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nycF0-008RUb-HB for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 16:39:39 +0000 Received: by mail-pl1-x62f.google.com with SMTP id b5so15246439plx.10 for ; Tue, 07 Jun 2022 09:39:34 -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=MMsXwp0wncXVlQhEOdDSIGnh/k5pLZa/8LV3fqGCk4Y=; b=KIKbOB4wieeuMpPaO4+32G+4O/nY09/u19Hqx4jPcpRklBIHv2pGAdhO1sQC919tqD NDH4+9zXCSW0mRmdCh/7PSXshbx4o0PDMEieI3ug6oYly+Y6IHZoreB1ONVcYCRJhWvF SR6PP+uhXWFry/W5JVfWBl5xTF6wXJcMIt76Nt3bkIKvt8VBhN29upjxcjONcAn9QLE+ lWjCZ1G826QU7OO3kpgh8vE/sigSZehnXmu/DXLREfk1V5buNv4/PBT35ez61pRAom3D RteKFqjdRcjWzcMLhx2XeHk656GOqb+/22zVFV4ZOfAL82uPf+DTqpzmWMjV7cMNI9p2 LJGA== 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=MMsXwp0wncXVlQhEOdDSIGnh/k5pLZa/8LV3fqGCk4Y=; b=u7jcvHnzsB6wYotCT+Ac1v4rnRjLC08b7hnhl/43TO2lT3YFu8WuSe0P7G3K9IK1Pj qAgciEsCMHwLy9cUr/aWAfjIT9j8EVSlrD1ormRI/HB8fQ1puTEMai6azXoNX2GJO+9R Ix74StUOP8qU/7o+SvuL+duBIiUGbRVCrYs/zhapa3eOwnNmTknynn3TBbxMDTis+9fF xQUKzri5O7pTyZU2TE/6tUcJtQ/FjVQGnsShxIGnqJQOYdLjt3ySYqHUFOYKZqn72bOv uuKZqRePUw7kndg5cmhUnrI7LB+pfi+Obik7sKQQ+POE2Za9SV+mRj+4EUeAU3AuB/cc mp+w== X-Gm-Message-State: AOAM530dTirMP6ANDsz2/QP0LzCSnnM6GSe+WzFru0LaqOM2WvwdfdTc fkvdQ100Ax8qiFbQnqIsfVA8dY7DgWzOzCXf X-Google-Smtp-Source: ABdhPJwNz5IykOxSZ49GvZQ67utgu7Sq19F/1tUevm/gmcskQusvlJdzF1E9V8CoEor0rp7A6HBZsQ== X-Received: by 2002:a17:90b:2247:b0:1e8:9f24:269a with SMTP id hk7-20020a17090b224700b001e89f24269amr5405690pjb.14.1654619974077; Tue, 07 Jun 2022 09:39:34 -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 d15-20020aa797af000000b0051bbc198f3fsm12560272pfq.13.2022.06.07.09.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 09:39:33 -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 v3 0/2] Add i2c clock duty cycle property for setting minimum persentage of clock high Date: Wed, 8 Jun 2022 00:37:01 +0800 Message-Id: <20220607163703.26355-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-20220607_093938_611861_7C319530 X-CRM114-Status: GOOD ( 10.19 ) 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-duty-cycle-min 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/ 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 | 8 +++ drivers/i2c/busses/i2c-aspeed.c | 56 +++++++++++++++---- 2 files changed, 53 insertions(+), 11 deletions(-)