From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29AECC3F6B0 for ; Fri, 12 Aug 2022 10:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238179AbiHLKO2 (ORCPT ); Fri, 12 Aug 2022 06:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238137AbiHLKOK (ORCPT ); Fri, 12 Aug 2022 06:14:10 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3AAAAB4E7 for ; Fri, 12 Aug 2022 03:13:18 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id y23so470498ljh.12 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=IBI/9K0UEoazkMNiA5bYEXJDwAzTaeAKhklqQpyu6i6Hfi6+AvG33PIupmUpOOk0lT /S+E3yZSdOfggbnfBohoTlpu07onMr8lR4r0X+XRX0niW44OQTD52EoL8/cwwpiV61Qx JZSMc/qMpUZG93F/GMMyVse7zewPVKCirFSKhzt2NgVPWhc9pj47if8M+DOSv842OfZz yGdTcsignaSU2SZITqVs8ZNriOGT3NBIP+a/+hpdE9E1mW7dfMZxpfZCAqWARveqeOsE ZQ0EvLu1c0z/ewEI9HPAXr7yJ+O1/BVqqDfr9iNrYFItIytpNf84fu7S//aV0WZ5QZeQ w8Lg== X-Gm-Message-State: ACgBeo3hQa8BfVZX1TFXU6H4tVsEaUu/B5LZ4ioW2h1/YzvKPOqgErrJ vyNaxPBajRWEYiLCUsdG0KY9Gw== X-Google-Smtp-Source: AA6agR7naJ9emf9TqWnh8kwp04vlKy5jAdUnOcyWakfGln360Wqaak0cNUSE0V2nXvLtaxyZjCuJ0Q== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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