Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2756836rdb; Tue, 12 Sep 2023 11:04:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHb7u3Zn6xrtUdll78f0RgUZoYKc7OXK72irolC4s4/ktwx2/03+v+c2GnVjRCjS4RKHv4r X-Received: by 2002:a05:6a20:e125:b0:128:ffb7:dcfe with SMTP id kr37-20020a056a20e12500b00128ffb7dcfemr604583pzb.1.1694541862192; Tue, 12 Sep 2023 11:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694541862; cv=none; d=google.com; s=arc-20160816; b=mxalZ8ul4OTPPeCqYErUYhZfDHazWl3dQjA6miTTbrI9A500GXtDwKVWg0c+CUSo7R nhmsPVYmQ9PykNfsKUuFkk7EJABWKpi6QK/TzyWHuGj+nke/f9SI4+Z6RfF3YUuNs5xm hSC39c2EB7Un3SLX5wi9wUUBxXlqyygF0BWbPF7pidqSmcUD7yTwVjd14UPAA8aawoge 0d1ttSfQnRNivm72nfNO/MVhjLFfA/4BWZcFyHh588/kbStLz1TWOrBp0e6IKtlVup+7 kRoHimJXA7YKhb75VHkDHDo3c12qbhPqsjChBYr/Ua22AVQ90Vovsgm+WZZjVjH1g7I3 DAMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=rY3fyBFKXhbUgtnAPbQbSgRvGL9HvbSM8XTOjuLswco=; fh=BVaSn1lXeKOuRKzuJMgYz3NPt+QXZSXwGyjRxYQvilw=; b=A6CIEBUno2L4IRvPzlTMVmC86r0b3jW7ZFdzD5pAsMJjCpiKVaKMe4XJfnweOJtt+E w/MIYVGs+plpbrMGfopcXtUlQClORHEOdxExfIJb86DH+v5MpgaVOVex0v/xNu/MtmDi hG8U34CDng2VYlJDlCzYb99IbuvsEKaOw3RkZT+lc2yqT/9gc/N1OuoJJAFsdP1ohHHK R7BTWPXXIzis+tjNhy7zSDhSeYiUSvNyQ7ksG2xaa51850AxLlPLUlfyMPg/ID/JTQt+ 0AA7A3UZPr8GCDte6w+aL6poFXxzz7xOuixKneX5eMYJOLAUsiy9AfCQJP/Acl6YwfI1 ULrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MzlPWkKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k19-20020aa788d3000000b0068be710ee8bsi8457148pff.188.2023.09.12.11.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 11:04:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MzlPWkKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D234780740C3; Tue, 12 Sep 2023 11:04:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237189AbjILSEK (ORCPT + 99 others); Tue, 12 Sep 2023 14:04:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233127AbjILSEJ (ORCPT ); Tue, 12 Sep 2023 14:04:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386A4E59; Tue, 12 Sep 2023 11:04:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBB86C433C8; Tue, 12 Sep 2023 18:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694541844; bh=C413WTTl+XcEFmSRmh21k8Ec3xNKfPk06vrSk2SqD9k=; h=In-Reply-To:References:Subject:From:To:Date:From; b=MzlPWkKkjcVGHwy1XBAtpP7d58dXjyJJW1mVltmpZmndjsuiKQ0533gUJwbpBesiS Z5BkDrEk/2i4RrWuaAFtZQ9YGxRlkK0rPIoBaLjo6M/ZXbSE7cZWAHokkkJe29iiL0 a+3xSTpIe0i/Pfq/lSVK3dN3KbGdgE09bO9phIrQ28F+CO3nHg3JdVxqgYPAfXNP5Q 3vzWh0z6zaqOpgcT86Jy8myvBQXIUzc/JzMz4MfvvMylkDpuE/vDUfV63cPer1248D l58hxDlB08f8zhLaWLQ3xdtcW+jKTO6kUO0N4VIWd+VdWq5XvU6QFJDEPIb56e/tZq UoA8j/ft69Zyw== Message-ID: <9a8476b92ab656387fa7dcf54a0713a3.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230911221346.1484543-5-andreas@kemnade.info> References: <20230911221346.1484543-1-andreas@kemnade.info> <20230911221346.1484543-5-andreas@kemnade.info> Subject: Re: [PATCH v3 4/5] clk: twl: add clock driver for TWL6032 From: Stephen Boyd To: andreas@kemnade.info, bcousson@baylibre.com, conor+dt@kernel.org, devicetree@vger.kernel.org, dmitry.torokhov@gmail.com, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, linux-clk@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, mturquette@baylibre.com, robh+dt@kernel.org, tony@atomide.com Date: Tue, 12 Sep 2023 11:04:02 -0700 User-Agent: alot/0.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Sep 2023 11:04:15 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Quoting Andreas Kemnade (2023-09-11 15:13:45) > diff --git a/drivers/clk/clk-twl.c b/drivers/clk/clk-twl.c > new file mode 100644 > index 0000000000000..09006e53a32ec > --- /dev/null > +++ b/drivers/clk/clk-twl.c > @@ -0,0 +1,197 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Clock driver for twl device. > + * > + * inspired by the driver for the Palmas device > + */ > + > +#include Please drop this include unless it is used. > +#include > +#include > +#include > +#include > +#include > + > +#define VREG_STATE 2 > +#define TWL6030_CFG_STATE_OFF 0x00 > +#define TWL6030_CFG_STATE_ON 0x01 > +#define TWL6030_CFG_STATE_MASK 0x03 > + > +struct twl_clock_info { > + struct device *dev; > + u8 base; > + struct clk_hw hw; > +}; [...] > + > +static int twl_clks_probe(struct platform_device *pdev) > +{ > + struct clk_hw_onecell_data *clk_data; > + const struct twl_clks_data *hw_data; > + > + struct twl_clock_info *cinfo; > + int ret; > + int i; > + int count; > + > + hw_data =3D twl6032_clks; > + for (count =3D 0; hw_data[count].init.name; count++) > + ; > + > + clk_data =3D devm_kzalloc(&pdev->dev, > + struct_size(clk_data, hws, count), > + GFP_KERNEL); > + if (!clk_data) > + return -ENOMEM; > + > + clk_data->num =3D count; > + cinfo =3D devm_kcalloc(&pdev->dev, count, sizeof(*cinfo), GFP_KER= NEL); > + if (!cinfo) > + return -ENOMEM; > + > + for (i =3D 0; i < count; i++) { > + cinfo[i].base =3D hw_data[i].base; > + cinfo[i].dev =3D &pdev->dev; > + cinfo[i].hw.init =3D &hw_data[i].init; > + ret =3D devm_clk_hw_register(&pdev->dev, &cinfo[i].hw); > + if (ret) { > + dev_err(&pdev->dev, "Fail to register clock %s, %= d\n", Use dev_err_probe() > + hw_data[i].init.name, ret); > + return ret; > + } > + clk_data->hws[i] =3D &cinfo[i].hw; > + } > + > + ret =3D devm_of_clk_add_hw_provider(&pdev->dev, > + of_clk_hw_onecell_get, clk_data= ); > + if (ret < 0) > + dev_err(&pdev->dev, "Fail to add clock driver, %d\n", ret= ); Use dev_err_probe() > + > + return ret;