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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5080CA9EC1 for ; Mon, 28 Oct 2019 23:33:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8423D21835 for ; Mon, 28 Oct 2019 23:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572305580; bh=A8fQbfzf/xn3KTHLUrgLxT6h14rtw3yrGoE4tKSOE1o=; h=In-Reply-To:References:From:Subject:To:Cc:Date:List-ID:From; b=KVd7fsjkfSe41fv6xIHQJp+FWK6tOe7tcMHncke1FsNnILJpPYaOIty/Q01T5+GTs huylWWpuxhcfznzl2iMHdePR9PkblFJmQkYaVQBtBZgGMzaaT8Q0Xjaw5BeYGDCb3p n/4y3XU7DwRtGTqdjI4zrt9LVFyPWnW2/p5ZWRcU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730632AbfJ1Xc5 (ORCPT ); Mon, 28 Oct 2019 19:32:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:42126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbfJ1Xc5 (ORCPT ); Mon, 28 Oct 2019 19:32:57 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 798AD21479; Mon, 28 Oct 2019 23:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572305576; bh=A8fQbfzf/xn3KTHLUrgLxT6h14rtw3yrGoE4tKSOE1o=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=njFeY8jNMr17taXW5n7D7B1TbGRLyNZ1WuddS1sYMF3NHzWMDVtqgydnxwj9HK2hN h8D27nclgyaTCLpKiEsFtPOmT9TaRaE7lmEvAUh4Fz3xRavU/zAoVCYfICBqqa/wvF z75fwRjEAFXlQn3DQY9/k5yiROqOKhHaxttIpfFc= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <5c66ac7d43ae1f57c335b6e565553fe1df703a83.1571915550.git.matti.vaittinen@fi.rohmeurope.com> References: <5c66ac7d43ae1f57c335b6e565553fe1df703a83.1571915550.git.matti.vaittinen@fi.rohmeurope.com> From: Stephen Boyd Subject: Re: [RFC PATCH v2 05/13] clk: bd718x7: Support ROHM BD71828 clk block To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Lee Jones , Rob Herring , Mark Rutland , Liam Girdwood , Mark Brown , Michael Turquette , Linus Walleij , Bartosz Golaszewski , Jacek Anaszewski , Pavel Machek , Dan Murphy , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-leds@vger.kernel.org, linux-rtc@vger.kernel.org User-Agent: alot/0.8.1 Date: Mon, 28 Oct 2019 16:32:55 -0700 Message-Id: <20191028233256.798AD21479@mail.kernel.org> Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Quoting Matti Vaittinen (2019-10-24 04:44:40) > diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c > index ae6e5baee330..d17a19e04592 100644 > --- a/drivers/clk/clk-bd718x7.c > +++ b/drivers/clk/clk-bd718x7.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > #include It would be really great to not need to include these random header files in this driver and just use raw numbers somehow. Looks like maybe it can be done by populating a different device name from the mfd driver depending on the version of the clk controller desired? Then that can be matched in this clk driver and we can just put the register info in this file? > #include > #include > @@ -21,10 +22,8 @@ struct bd718xx_clk { > struct rohm_regmap_dev *mfd; > }; > =20 > -static int bd71837_clk_set(struct clk_hw *hw, int status) > +static int bd71837_clk_set(struct bd718xx_clk *c, int status) should it be unsigned int status? Or maybe u32? > { > - struct bd718xx_clk *c =3D container_of(hw, struct bd718xx_clk, hw= ); > - > return regmap_update_bits(c->mfd->regmap, c->reg, c->mask, status= ); > } > =20 > @@ -33,14 +32,16 @@ static void bd71837_clk_disable(struct clk_hw *hw) > int rv; > struct bd718xx_clk *c =3D container_of(hw, struct bd718xx_clk, hw= ); > =20 > - rv =3D bd71837_clk_set(hw, 0); > + rv =3D bd71837_clk_set(c, 0); > if (rv) > dev_dbg(&c->pdev->dev, "Failed to disable 32K clk (%d)\n"= , rv); > } > =20 > static int bd71837_clk_enable(struct clk_hw *hw) > { > - return bd71837_clk_set(hw, 1); > + struct bd718xx_clk *c =3D container_of(hw, struct bd718xx_clk, hw= ); > + > + return bd71837_clk_set(c, 0xffffffff); Because now this is passing -1 to unsigned int taking regmap_update_bits()?