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=-8.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 99698C33CB3 for ; Fri, 17 Jan 2020 13:40:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63C6920728 for ; Fri, 17 Jan 2020 13:40:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="poWzvnim" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727243AbgAQNkR (ORCPT ); Fri, 17 Jan 2020 08:40:17 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40197 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbgAQNkO (ORCPT ); Fri, 17 Jan 2020 08:40:14 -0500 Received: by mail-wm1-f67.google.com with SMTP id t14so7639794wmi.5 for ; Fri, 17 Jan 2020 05:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=x0v+Cpelm9h83Fd8YoEOutozcn/2jODQn8Ym6ta3pDI=; b=poWzvnimT8QTMy+z+ojdYjNwWKCfVW89Yxmci6IP1hOwVnknCtXaCr8i8dPxqfj1c6 6NHh9Vy22UuVjsdvRslMJxmzZ2r72OldpIzBGyTPzKMTdk2Z9oSf67RccUHaMNaQhd+k lm/c63jSCsXUx2RU7tiHMS5C5Y2FizJpTWV+bQFZk8UuOie9JPNvsSkh5+vGRPhAp0aq HK0OQ1Srf/D3qXPwbVceBBawRHCIp88uRHmu2HP+uHbb1PD3am4Blq1K6Lz24AmMxi2p OWYnjJ/q+UHi4g8eny5q5ITFQpVAiYSQZTcj7rH44ZY1d2LCEmOKY9qNl6Wk1issBSPO JpLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=x0v+Cpelm9h83Fd8YoEOutozcn/2jODQn8Ym6ta3pDI=; b=ahgOaw9diRSfmshxUVtFmXB3hnQVF9Yy2/9+1fyuALZjMC9KlgPnDhlDp4fCvOlVhY LW/rB5vS7NSQypE+voajqO/JL2vzaHIDJIdsaELGKxIvK72vloIwqTrp0Bqi5hqZL7oM q5eQ5YSZkLFbFwrGBcKPwDhmtwhLEcVtE0MQRw3Fm/hmAID49Qy5DQbewjm0bw/1tusk qr+o7XgJ5q+WgkwJb8LSW9RUyZglbhWYKphuxiOd06qP2MKXlsd98AJG4MJ7ze0Teezm qa3dalaChPJ8gQ/wYHWMaEGFK896Ftvc27a54oyJe5uz8NuajN3zK2tkGWHEpvCDv3e7 ZDWw== X-Gm-Message-State: APjAAAVBFRyixVP+SxjFO0N5JFKCfCf+YX9WrguEl2AfwPN6jAMoGJ1y YD6rImY5S64XWLc3aqBYEL+l3w== X-Google-Smtp-Source: APXvYqxGyR41SDvj5mCeLz1WXPpVshSUQyPXa3ccVTn3jG4GO+EYu0SQxB8cs1Dtg2CXlW/4Esj78Q== X-Received: by 2002:a7b:c764:: with SMTP id x4mr4598002wmk.116.1579268411354; Fri, 17 Jan 2020 05:40:11 -0800 (PST) Received: from dell ([2.27.35.221]) by smtp.gmail.com with ESMTPSA id s8sm32993260wrt.57.2020.01.17.05.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:40:10 -0800 (PST) Date: Fri, 17 Jan 2020 13:40:26 +0000 From: Lee Jones To: "Vaittinen, Matti" Cc: "linux-leds@vger.kernel.org" , "dmurphy@ti.com" , "linux-rtc@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "alexandre.belloni@bootlin.com" , "linux-kernel@vger.kernel.org" , "mturquette@baylibre.com" , "mazziesaccount@gmail.com" , "devicetree@vger.kernel.org" , "jacek.anaszewski@gmail.com" , "a.zummo@towertech.it" , "linus.walleij@linaro.org" , "lgirdwood@gmail.com" , "mark.rutland@arm.com" , "robh+dt@kernel.org" , "bgolaszewski@baylibre.com" , "linux-clk@vger.kernel.org" , "sboyd@kernel.org" , "pavel@ucw.cz" , "broonie@kernel.org" Subject: Re: [PATCH v10 08/13] regulator: bd718x7: Split driver to common and bd718x7 specific parts Message-ID: <20200117134026.GM15507@dell> References: <20200117102854.GF15507@dell> <4bd035fb2c78e96f18006f06c5d8d9d2f1a1b70d.camel@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4bd035fb2c78e96f18006f06c5d8d9d2f1a1b70d.camel@fi.rohmeurope.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On Fri, 17 Jan 2020, Vaittinen, Matti wrote: > Hello Lee, > > On Fri, 2020-01-17 at 10:28 +0000, Lee Jones wrote: > > On Fri, 17 Jan 2020, Matti Vaittinen wrote: > > > > > Few ROHM PMICs allow setting the voltage states for different > > > system states > > > like RUN, IDLE, SUSPEND and LPSR. States are then changed via SoC > > > specific > > > mechanisms. bd718x7 driver implemented device-tree parsing > > > functions for > > > these state specific voltages. The parsing functions can be re-used > > > by > > > other ROHM chip drivers like bd71828. Split the generic functions > > > from > > > bd718x7-regulator.c to rohm-regulator.c and export them for other > > > modules > > > to use. > > > > > > Signed-off-by: Matti Vaittinen > > > Acked-by: Mark Brown > > > --- > > > no changes since v9 > > > > > > drivers/regulator/Kconfig | 4 + > > > drivers/regulator/Makefile | 1 + > > > drivers/regulator/bd718x7-regulator.c | 183 ++++++++------------ > > > ------ > > > drivers/regulator/rohm-regulator.c | 95 +++++++++++++ > > > include/linux/mfd/rohm-generic.h | 66 ++++++++++ > > > 5 files changed, 221 insertions(+), 128 deletions(-) > > > create mode 100644 drivers/regulator/rohm-regulator.c > > > > [...] > > > > > diff --git a/include/linux/mfd/rohm-generic.h > > > b/include/linux/mfd/rohm-generic.h > > > index ff3dd7578fd3..6cc5a0819959 100644 > > > --- a/include/linux/mfd/rohm-generic.h > > > +++ b/include/linux/mfd/rohm-generic.h > > > @@ -4,6 +4,9 @@ > > > #ifndef __LINUX_MFD_ROHM_H__ > > > #define __LINUX_MFD_ROHM_H__ > > > > > > +#include > > > +#include > > > + > > > enum rohm_chip_type { > > > ROHM_CHIP_TYPE_BD71837 = 0, > > > ROHM_CHIP_TYPE_BD71847, > > > @@ -17,4 +20,67 @@ struct rohm_regmap_dev { > > > struct regmap *regmap; > > > }; > > > > > > +enum { > > > + ROHM_DVS_LEVEL_UNKNOWN, > > > + ROHM_DVS_LEVEL_RUN, > > > + ROHM_DVS_LEVEL_IDLE, > > > + ROHM_DVS_LEVEL_SUSPEND, > > > + ROHM_DVS_LEVEL_LPSR, > > > +#define ROHM_DVS_LEVEL_MAX ROHM_DVS_LEVEL_LPSR > > > > Haven't seen this before. Is it legit? > > > > I don't know why it wouldn't be :) I kind of grew used to that when I > still did some networking stuff. Networking it not a good example. It's full of odd little quirks to the standard styling. > It doesn't really matter in this case but for example the netlink > headers do: > > enum { > foo, > #define foo foo > bar, > #define bar bar > ... > }; > > https://elixir.bootlin.com/linux/v5.5-rc6/source/include/uapi/linux/rtnetlink.h > > What is the good here is that this allows one to nicely exclude > unsupported stuff using preprocessor: > > #include > > #ifdef foo > use_foo(foo); > #endif > > What about: > > > > ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR > > Anyways, I don't see why define wouldn't be Ok here - but sure it can > be changed if you insist ;) Just let me know if you can accept the > define or not :) Let's go for not in this instance. :D -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog