Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1573967rwb; Fri, 12 Aug 2022 03:23:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yjvyeO4jwUbUL0PpOWuEAP0PU3qVq3BvPlhVTukwmWN7QXQqtT7Qo2os8lNr7RnJ3Xym3 X-Received: by 2002:a17:906:9b16:b0:730:d5f4:d46e with SMTP id eo22-20020a1709069b1600b00730d5f4d46emr2224196ejc.701.1660299793738; Fri, 12 Aug 2022 03:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660299793; cv=none; d=google.com; s=arc-20160816; b=jwwqNjcRQgfS4/11Ep6pzgoP7ld6jyaHOuv/qmS/GPNhT9bj2JortuNK6K7iaTuwSn 6Hsy6+hA6huVGXTV13gdDzz1Tq469BIvJNsFjj5wxKCVtcmX2BYWX25T+mpXWkGhrIxE w9/sIFVQQspavvNWVOqPyCdaPXMMo0Ws1g32VzFu/XbbsAqRZF1w+a9VdWPMkY4WOAmm Gwtvsl27BPWiIAc4wxgCYjYs5i0HuRGl7cOgAFuY/2HVxb8MdtN+VaKqG9DnLiV8NJHz MxPOw3EbQ/cw9lPAPcJu5hl1kseMeJga1XZf8GVGS6ap83ANR9wJmv8gJ9Y8K0WN0S+r cq7g== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8cLhmbUzxjFPeEqNnxegdJhRMYmiHcGmozP5wffiZTU=; b=ALA1tfOHLtTcCGhv5errmHNNvFZbNcE3eL6djppCqEG9TKIQebHMFZl8KT1EWGOWx2 7aonh2bPpj0R8KimWxPUUZrKlVYraR4daL5R4XNmpqD2lojtfONuHFutiUYFXF/X62vv pM/eqFjDSZ0jMBAA39bOF68JHa3Zish0S0woLoH6A8fmtj9ulKA1po1BoS0a2e90yZlt BIMNNRcF4SHPCj6qqJqWdpb5SJqchXjYF8Mv+GfIRvcDafGzTxKLLbHzoQA8TqYTLeCY 7yNpI0CMGIOXlS1obEiV4WdnPx9TflJQ6tsbdPCVJcFhihMLNcZsvuLATUqKaiyfzZza GmaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WTxdbpat; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz14-20020a1709077d8e00b0072ffe9a4a8csi1802512ejc.824.2022.08.12.03.22.47; Fri, 12 Aug 2022 03:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WTxdbpat; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238345AbiHLKO3 (ORCPT + 99 others); Fri, 12 Aug 2022 06:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238170AbiHLKOL (ORCPT ); Fri, 12 Aug 2022 06:14:11 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53B3AB4E8 for ; Fri, 12 Aug 2022 03:13:18 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id w15so507405ljw.1 for ; Fri, 12 Aug 2022 03:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=8cLhmbUzxjFPeEqNnxegdJhRMYmiHcGmozP5wffiZTU=; b=WTxdbpatl/Nddz+PTuVRR73SuOXowEQtLmLFxwXWr5GSYU+ztSACZWVLaK2vzxj6m2 3NdwSnjEIuzz6QdV1sGNd+PZwhsw0kp2vd8OV4FBs95Ubiv1gkcyN7+g+cGKDByb+dwc VQaz4lcgk7eb4C/9zl9ZYT0SHgo4br4IhFxpnqSl4UJ9dKefLYB9Ro0WwChQc7roJYiv qtr4ZjKf0hvB8pl/KDFx1/0QTUUnNrZUeTJYA9rnIsSID56uY/KMzHsCWv4uyxdt/0Z3 w+mbvhDGrfZt2gPg0v9ElyCXUE5wVb/a+Etr7VCnn3ncEwUWWctATPiZqmDsJPyv+BLB mg+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=8cLhmbUzxjFPeEqNnxegdJhRMYmiHcGmozP5wffiZTU=; b=MTZp+pZwmY+9a6r3zgy0KIw+2QiRsL9sHdkFJgp6PXZIxqMDj1GUSd3JrMwkS/+Ri6 nB+KtGlKYoW/YBXdYoYVLqXOEJrbSDkkFtZM8B13tN/h9zNKbJy3Ql2+Fp/kXo6utfm1 wgLLtCoYM7pzUFEL/waH4QDLaLMkk5ACC/EPKR9mqIKx8yP33O6wtbs4Z3qpr9h+jmjQ S/Ya+In0JWxeXOo6QLbIrtKn54IqhiuqXHxkpqA9kFljfXaBs4kiMgbp9R9OxKiLu6ed 3bCqk9o7Gh2y3frjybtS3yvpFd/GEaiQekBouN4isnB1fBojZRJa+opFrOjMankVitEK /c9g== X-Gm-Message-State: ACgBeo2Vg2hdeFkoBQQFC3HUzVbA/0JBUU1bNVsx29g0D7BwCngTniaq 0tNNuQFNkbXC+SN8QnNEpwVsWA== X-Received: by 2002:a2e:b8d3:0:b0:25f:e94d:10ae with SMTP id s19-20020a2eb8d3000000b0025fe94d10aemr897828ljp.331.1660299197072; Fri, 12 Aug 2022 03:13:17 -0700 (PDT) Received: from [192.168.1.39] ([83.146.140.105]) by smtp.gmail.com with ESMTPSA id e7-20020a05651c038700b0025df04af0f0sm305398ljp.51.2022.08.12.03.13.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Aug 2022 03:13:16 -0700 (PDT) Message-ID: Date: Fri, 12 Aug 2022 13:13:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 6/6] i2c: imx-lpi2c: handle IPG clock Content-Language: en-US To: "Peng Fan (OSS)" , aisheng.dong@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xiaoning.wang@nxp.com, Peng Fan References: <20220812043424.4078034-1-peng.fan@oss.nxp.com> <20220812043424.4078034-7-peng.fan@oss.nxp.com> From: Krzysztof Kozlowski In-Reply-To: <20220812043424.4078034-7-peng.fan@oss.nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 On 12/08/2022 07:34, Peng Fan (OSS) wrote: > From: Peng Fan > > The LPI2C controller needs both PER and IPG clock to work, but current > driver only supports PER clock. This patch add IPG clock. > > Signed-off-by: Peng Fan > --- > drivers/i2c/busses/i2c-imx-lpi2c.c | 41 ++++++++++++++++++++++-------- > 1 file changed, 31 insertions(+), 10 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c > index 8b9ba055c418..f43ad1ae8627 100644 > --- a/drivers/i2c/busses/i2c-imx-lpi2c.c > +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c > @@ -94,7 +94,8 @@ enum lpi2c_imx_pincfg { > > struct lpi2c_imx_struct { > struct i2c_adapter adapter; > - struct clk *clk; > + struct clk *clk_per; > + struct clk *clk_ipg; > void __iomem *base; > __u8 *rx_buf; > __u8 *tx_buf; > @@ -207,7 +208,7 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx) > > lpi2c_imx_set_mode(lpi2c_imx); > > - clk_rate = clk_get_rate(lpi2c_imx->clk); > + clk_rate = clk_get_rate(lpi2c_imx->clk_per); > if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST) > filt = 0; > else > @@ -561,10 +562,16 @@ static int lpi2c_imx_probe(struct platform_device *pdev) > strlcpy(lpi2c_imx->adapter.name, pdev->name, > sizeof(lpi2c_imx->adapter.name)); > > - lpi2c_imx->clk = devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(lpi2c_imx->clk)) { > + lpi2c_imx->clk_per = devm_clk_get(&pdev->dev, "per"); > + if (IS_ERR(lpi2c_imx->clk_per)) { > dev_err(&pdev->dev, "can't get I2C peripheral clock\n"); > - return PTR_ERR(lpi2c_imx->clk); > + return PTR_ERR(lpi2c_imx->clk_per); > + } > + > + lpi2c_imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); > + if (IS_ERR(lpi2c_imx->clk_ipg)) { > + dev_err(&pdev->dev, "can't get I2C ipg clock\n"); > + return PTR_ERR(lpi2c_imx->clk_ipg); > } You just broke all DTS... Best regards, Krzysztof