The macros for the unit conversion for frequency are duplicated in different places. Provide these macros in the 'units' header, so they can be reused. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Christian Eggers <ceggers@arri.de> Reviewed-by: Andy Shevchenko <Andy.Shevchenko@gmail.com> --- include/linux/units.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/units.h b/include/linux/units.h index dcc30a53fa93..218ec0d314b6 100644 --- a/include/linux/units.h +++ b/include/linux/units.h @@ -4,6 +4,10 @@ #include <linux/math.h> +#define HZ_PER_KHZ 1000L +#define KHZ_PER_MHZ 1000L +#define HZ_PER_MHZ 1000000L + #define MILLIWATT_PER_WATT 1000L #define MICROWATT_PER_MILLIWATT 1000L #define MICROWATT_PER_WATT 1000000L -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Christian Eggers <ceggers@arri.de> --- drivers/thermal/devfreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index fed3121ff2a1..fa5b8b0c7604 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -19,10 +19,10 @@ #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/thermal.h> +#include <linux/units.h> #include <trace/events/thermal.h> -#define HZ_PER_KHZ 1000 #define SCALE_ERROR_MITIGATION 100 static DEFINE_IDA(devfreq_ida); -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Christian Eggers <ceggers@arri.de> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index bf3047896e41..b6d63f02d293 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -26,6 +26,7 @@ #include <linux/hrtimer.h> #include <linux/of.h> #include <linux/pm_qos.h> +#include <linux/units.h> #include "governor.h" #define CREATE_TRACE_POINTS @@ -33,7 +34,6 @@ #define IS_SUPPORTED_FLAG(f, name) ((f & DEVFREQ_GOV_FLAG_##name) ? true : false) #define IS_SUPPORTED_ATTR(f, name) ((f & DEVFREQ_GOV_ATTR_##name) ? true : false) -#define HZ_PER_KHZ 1000 static struct class *devfreq_class; static struct dentry *devfreq_debugfs; -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Christian Eggers <ceggers@arri.de> --- drivers/iio/light/as73211.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c index 7b32dfaee9b3..3ba2378df3dd 100644 --- a/drivers/iio/light/as73211.c +++ b/drivers/iio/light/as73211.c @@ -24,8 +24,7 @@ #include <linux/module.h> #include <linux/mutex.h> #include <linux/pm.h> - -#define HZ_PER_KHZ 1000 +#include <linux/units.h> #define AS73211_DRV_NAME "as73211" -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Christian Eggers <ceggers@arri.de> --- drivers/hwmon/mr75203.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c index 18da5a25e89a..868243dba1ee 100644 --- a/drivers/hwmon/mr75203.c +++ b/drivers/hwmon/mr75203.c @@ -17,6 +17,7 @@ #include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> +#include <linux/units.h> /* PVT Common register */ #define PVT_IP_CONFIG 0x04 @@ -37,7 +38,6 @@ #define CLK_SYNTH_EN BIT(24) #define CLK_SYS_CYCLES_MAX 514 #define CLK_SYS_CYCLES_MIN 2 -#define HZ_PER_MHZ 1000000L #define SDIF_DISABLE 0x04 -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 442ff787f7af..dda3b67e494f 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c @@ -11,13 +11,12 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/time.h> +#include <linux/units.h> #include <linux/hid-sensor-hub.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> -#define HZ_PER_MHZ 1000000L - static struct { u32 usage_id; int unit; /* 0 for default others from HID sensor spec */ -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/media/i2c/ov02a10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov02a10.c b/drivers/media/i2c/ov02a10.c index 8683ffd3287a..59a34e59774e 100644 --- a/drivers/media/i2c/ov02a10.c +++ b/drivers/media/i2c/ov02a10.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/units.h> #include <media/media-entity.h> #include <media/v4l2-async.h> #include <media/v4l2-ctrls.h> @@ -64,7 +65,6 @@ /* Test pattern control */ #define OV02A10_REG_TEST_PATTERN 0xb6 -#define HZ_PER_MHZ 1000000L #define OV02A10_LINK_FREQ_390MHZ (390 * HZ_PER_MHZ) #define OV02A10_ECLK_FREQ (24 * HZ_PER_MHZ) -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/mtd/nand/raw/intel-nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index a304fda5d1fa..8d00191a4815 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -20,6 +20,7 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/types.h> +#include <linux/units.h> #include <asm/unaligned.h> #define EBU_CLC 0x000 @@ -102,7 +103,6 @@ #define MAX_CS 2 -#define HZ_PER_MHZ 1000000L #define USEC_PER_SEC 1000000L struct ebu_nand_cs { -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/mtd/nand/raw/intel-nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index a304fda5d1fa..8d00191a4815 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -20,6 +20,7 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/types.h> +#include <linux/units.h> #include <asm/unaligned.h> #define EBU_CLC 0x000 @@ -102,7 +103,6 @@ #define MAX_CS 2 -#define HZ_PER_MHZ 1000000L #define USEC_PER_SEC 1000000L struct ebu_nand_cs { -- 2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/phy/st/phy-stm32-usbphyc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c index a54317e96c41..02dd12bb4692 100644 --- a/drivers/phy/st/phy-stm32-usbphyc.c +++ b/drivers/phy/st/phy-stm32-usbphyc.c @@ -14,6 +14,7 @@ #include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/reset.h> +#include <linux/units.h> #define STM32_USBPHYC_PLL 0x0 #define STM32_USBPHYC_MISC 0x8 @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { #define PLL_FVCO_MHZ 2880 #define PLL_INFF_MIN_RATE_HZ 19200000 #define PLL_INFF_MAX_RATE_HZ 38400000 -#define HZ_PER_MHZ 1000000L struct pll_params { u8 ndiv; -- 2.17.1
HZ unit conversion macros are available in units.h, use them and remove the duplicate definition. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/phy/st/phy-stm32-usbphyc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c index a54317e96c41..02dd12bb4692 100644 --- a/drivers/phy/st/phy-stm32-usbphyc.c +++ b/drivers/phy/st/phy-stm32-usbphyc.c @@ -14,6 +14,7 @@ #include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/reset.h> +#include <linux/units.h> #define STM32_USBPHYC_PLL 0x0 #define STM32_USBPHYC_MISC 0x8 @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { #define PLL_FVCO_MHZ 2880 #define PLL_INFF_MIN_RATE_HZ 19200000 #define PLL_INFF_MAX_RATE_HZ 38400000 -#define HZ_PER_MHZ 1000000L struct pll_params { u8 ndiv; -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote: > The macros for the unit conversion for frequency are duplicated in > different places. > > Provide these macros in the 'units' header, so they can be reused. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > Reviewed-by: Christian Eggers <ceggers@arri.de> > Reviewed-by: Andy Shevchenko <Andy.Shevchenko@gmail.com> > --- Is it possible to have these patches merged through the linux-pm tree ? -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote: > The macros for the unit conversion for frequency are duplicated in > different places. > > Provide these macros in the 'units' header, so they can be reused. For the all that have not been tagged: Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Thanks! > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > Reviewed-by: Christian Eggers <ceggers@arri.de> > Reviewed-by: Andy Shevchenko <Andy.Shevchenko@gmail.com> > --- > include/linux/units.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/units.h b/include/linux/units.h > index dcc30a53fa93..218ec0d314b6 100644 > --- a/include/linux/units.h > +++ b/include/linux/units.h > @@ -4,6 +4,10 @@ > > #include <linux/math.h> > > +#define HZ_PER_KHZ 1000L > +#define KHZ_PER_MHZ 1000L > +#define HZ_PER_MHZ 1000000L > + > #define MILLIWATT_PER_WATT 1000L > #define MICROWATT_PER_MILLIWATT 1000L > #define MICROWATT_PER_WATT 1000000L > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko
On 21. 2. 24. 오후 11:42, Daniel Lezcano wrote:
> HZ unit conversion macros are available in units.h, use them and
> remove the duplicate definition.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Reviewed-by: Christian Eggers <ceggers@arri.de>
> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
> drivers/devfreq/devfreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index bf3047896e41..b6d63f02d293 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -26,6 +26,7 @@
> #include <linux/hrtimer.h>
> #include <linux/of.h>
> #include <linux/pm_qos.h>
> +#include <linux/units.h>
> #include "governor.h"
>
> #define CREATE_TRACE_POINTS
> @@ -33,7 +34,6 @@
>
> #define IS_SUPPORTED_FLAG(f, name) ((f & DEVFREQ_GOV_FLAG_##name) ? true : false)
> #define IS_SUPPORTED_ATTR(f, name) ((f & DEVFREQ_GOV_ATTR_##name) ? true : false)
> -#define HZ_PER_KHZ 1000
>
> static struct class *devfreq_class;
> static struct dentry *devfreq_debugfs;
>
I changed the patch title with 'PM /' prefix as following
in order to keep the consistent patch style if there are no any special
objection.
- PM / devfreq: Use HZ macros
Applied it.
Thanks,
Chanwoo Choi
On 26/02/2021 07:08, Chanwoo Choi wrote: > > > On 21. 2. 24. 오후 11:42, Daniel Lezcano wrote: >> HZ unit conversion macros are available in units.h, use them and >> remove the duplicate definition. >> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >> Reviewed-by: Christian Eggers <ceggers@arri.de> >> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> >> --- >> drivers/devfreq/devfreq.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c >> index bf3047896e41..b6d63f02d293 100644 >> --- a/drivers/devfreq/devfreq.c >> +++ b/drivers/devfreq/devfreq.c >> @@ -26,6 +26,7 @@ >> #include <linux/hrtimer.h> >> #include <linux/of.h> >> #include <linux/pm_qos.h> >> +#include <linux/units.h> >> #include "governor.h" >> #define CREATE_TRACE_POINTS >> @@ -33,7 +34,6 @@ >> #define IS_SUPPORTED_FLAG(f, name) ((f & DEVFREQ_GOV_FLAG_##name) >> ? true : false) >> #define IS_SUPPORTED_ATTR(f, name) ((f & DEVFREQ_GOV_ATTR_##name) ? >> true : false) >> -#define HZ_PER_KHZ 1000 >> static struct class *devfreq_class; >> static struct dentry *devfreq_debugfs; >> > > I changed the patch title with 'PM /' prefix as following > in order to keep the consistent patch style if there are no any special > objection. > - PM / devfreq: Use HZ macros > > Applied it. It should not compile. This patch and others depend on 1/9. It would make sense to merge all of them through linux-pm. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 21. 2. 26. 오후 5:51, Daniel Lezcano wrote:
> On 26/02/2021 07:08, Chanwoo Choi wrote:
>>
>>
>> On 21. 2. 24. 오후 11:42, Daniel Lezcano wrote:
>>> HZ unit conversion macros are available in units.h, use them and
>>> remove the duplicate definition.
>>>
>>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>>> Reviewed-by: Christian Eggers <ceggers@arri.de>
>>> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> ---
>>> drivers/devfreq/devfreq.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>> index bf3047896e41..b6d63f02d293 100644
>>> --- a/drivers/devfreq/devfreq.c
>>> +++ b/drivers/devfreq/devfreq.c
>>> @@ -26,6 +26,7 @@
>>> #include <linux/hrtimer.h>
>>> #include <linux/of.h>
>>> #include <linux/pm_qos.h>
>>> +#include <linux/units.h>
>>> #include "governor.h"
>>> #define CREATE_TRACE_POINTS
>>> @@ -33,7 +34,6 @@
>>> #define IS_SUPPORTED_FLAG(f, name) ((f & DEVFREQ_GOV_FLAG_##name)
>>> ? true : false)
>>> #define IS_SUPPORTED_ATTR(f, name) ((f & DEVFREQ_GOV_ATTR_##name) ?
>>> true : false)
>>> -#define HZ_PER_KHZ 1000
>>> static struct class *devfreq_class;
>>> static struct dentry *devfreq_debugfs;
>>>
>>
>> I changed the patch title with 'PM /' prefix as following
>> in order to keep the consistent patch style if there are no any special
>> objection.
>> - PM / devfreq: Use HZ macros
>>
>> Applied it.
>
> It should not compile. This patch and others depend on 1/9.
>
> It would make sense to merge all of them through linux-pm.
OK. I'm OK to apply it to linux-pm.
Thanks,
Chanwoo Choi
On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel
On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
On 24-02-21, 15:42, Daniel Lezcano wrote:
> HZ unit conversion macros are available in units.h, use them and
> remove the duplicate definition.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/phy/st/phy-stm32-usbphyc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
> index a54317e96c41..02dd12bb4692 100644
> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> @@ -14,6 +14,7 @@
> #include <linux/of_platform.h>
> #include <linux/phy/phy.h>
> #include <linux/reset.h>
> +#include <linux/units.h>
>
> #define STM32_USBPHYC_PLL 0x0
> #define STM32_USBPHYC_MISC 0x8
> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = {
> #define PLL_FVCO_MHZ 2880
> #define PLL_INFF_MIN_RATE_HZ 19200000
> #define PLL_INFF_MAX_RATE_HZ 38400000
> -#define HZ_PER_MHZ 1000000L
I dont see this in units.h, can you send this once it is merged upstream
--
~Vinod
On 24-02-21, 15:42, Daniel Lezcano wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > --- > drivers/phy/st/phy-stm32-usbphyc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c > index a54317e96c41..02dd12bb4692 100644 > --- a/drivers/phy/st/phy-stm32-usbphyc.c > +++ b/drivers/phy/st/phy-stm32-usbphyc.c > @@ -14,6 +14,7 @@ > #include <linux/of_platform.h> > #include <linux/phy/phy.h> > #include <linux/reset.h> > +#include <linux/units.h> > > #define STM32_USBPHYC_PLL 0x0 > #define STM32_USBPHYC_MISC 0x8 > @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { > #define PLL_FVCO_MHZ 2880 > #define PLL_INFF_MIN_RATE_HZ 19200000 > #define PLL_INFF_MAX_RATE_HZ 38400000 > -#define HZ_PER_MHZ 1000000L I dont see this in units.h, can you send this once it is merged upstream -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On 02/03/2021 17:31, Miquel Raynal wrote: > On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote: >> HZ unit conversion macros are available in units.h, use them and >> remove the duplicate definition. >> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Actually, I was expecting to have it merged through linux-pm as this patch depends on 1/9 -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 02/03/2021 17:31, Miquel Raynal wrote: > On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote: >> HZ unit conversion macros are available in units.h, use them and >> remove the duplicate definition. >> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Actually, I was expecting to have it merged through linux-pm as this patch depends on 1/9 -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
On 02/03/2021 17:32, Vinod Koul wrote: > On 24-02-21, 15:42, Daniel Lezcano wrote: >> HZ unit conversion macros are available in units.h, use them and >> remove the duplicate definition. >> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >> --- >> drivers/phy/st/phy-stm32-usbphyc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c >> index a54317e96c41..02dd12bb4692 100644 >> --- a/drivers/phy/st/phy-stm32-usbphyc.c >> +++ b/drivers/phy/st/phy-stm32-usbphyc.c >> @@ -14,6 +14,7 @@ >> #include <linux/of_platform.h> >> #include <linux/phy/phy.h> >> #include <linux/reset.h> >> +#include <linux/units.h> >> >> #define STM32_USBPHYC_PLL 0x0 >> #define STM32_USBPHYC_MISC 0x8 >> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { >> #define PLL_FVCO_MHZ 2880 >> #define PLL_INFF_MIN_RATE_HZ 19200000 >> #define PLL_INFF_MAX_RATE_HZ 38400000 >> -#define HZ_PER_MHZ 1000000L > > I dont see this in units.h, can you send this once it is merged upstream Actually, it is the first patch of the series. I asked Rafael if he can merge the entire series. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 02/03/2021 17:32, Vinod Koul wrote: > On 24-02-21, 15:42, Daniel Lezcano wrote: >> HZ unit conversion macros are available in units.h, use them and >> remove the duplicate definition. >> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >> --- >> drivers/phy/st/phy-stm32-usbphyc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c >> index a54317e96c41..02dd12bb4692 100644 >> --- a/drivers/phy/st/phy-stm32-usbphyc.c >> +++ b/drivers/phy/st/phy-stm32-usbphyc.c >> @@ -14,6 +14,7 @@ >> #include <linux/of_platform.h> >> #include <linux/phy/phy.h> >> #include <linux/reset.h> >> +#include <linux/units.h> >> >> #define STM32_USBPHYC_PLL 0x0 >> #define STM32_USBPHYC_MISC 0x8 >> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { >> #define PLL_FVCO_MHZ 2880 >> #define PLL_INFF_MIN_RATE_HZ 19200000 >> #define PLL_INFF_MAX_RATE_HZ 38400000 >> -#define HZ_PER_MHZ 1000000L > > I dont see this in units.h, can you send this once it is merged upstream Actually, it is the first patch of the series. I asked Rafael if he can merge the entire series. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Daniel,
Daniel Lezcano <daniel.lezcano@linaro.org> wrote on Tue, 2 Mar 2021
18:03:12 +0100:
> On 02/03/2021 17:31, Miquel Raynal wrote:
> > On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote:
> >> HZ unit conversion macros are available in units.h, use them and
> >> remove the duplicate definition.
> >>
> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> >
> > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
>
> Actually, I was expecting to have it merged through linux-pm as this
> patch depends on 1/9
>
>
>
No problem, I just removed it from my tree. However in this case
please fix the subject prefix to "mtd: rawnand: intel:". With this nit
fixed,
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
Hi Daniel, Daniel Lezcano <daniel.lezcano@linaro.org> wrote on Tue, 2 Mar 2021 18:03:12 +0100: > On 02/03/2021 17:31, Miquel Raynal wrote: > > On Wed, 2021-02-24 at 14:42:18 UTC, Daniel Lezcano wrote: > >> HZ unit conversion macros are available in units.h, use them and > >> remove the duplicate definition. > >> > >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > > > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. > > Actually, I was expecting to have it merged through linux-pm as this > patch depends on 1/9 > > > No problem, I just removed it from my tree. However in this case please fix the subject prefix to "mtd: rawnand: intel:". With this nit fixed, Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> Thanks, Miquèl ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
On 02-03-21, 18:03, Daniel Lezcano wrote:
> On 02/03/2021 17:32, Vinod Koul wrote:
> > On 24-02-21, 15:42, Daniel Lezcano wrote:
> >> HZ unit conversion macros are available in units.h, use them and
> >> remove the duplicate definition.
> >>
> >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> >> ---
> >> drivers/phy/st/phy-stm32-usbphyc.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
> >> index a54317e96c41..02dd12bb4692 100644
> >> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> >> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> >> @@ -14,6 +14,7 @@
> >> #include <linux/of_platform.h>
> >> #include <linux/phy/phy.h>
> >> #include <linux/reset.h>
> >> +#include <linux/units.h>
> >>
> >> #define STM32_USBPHYC_PLL 0x0
> >> #define STM32_USBPHYC_MISC 0x8
> >> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = {
> >> #define PLL_FVCO_MHZ 2880
> >> #define PLL_INFF_MIN_RATE_HZ 19200000
> >> #define PLL_INFF_MAX_RATE_HZ 38400000
> >> -#define HZ_PER_MHZ 1000000L
> >
> > I dont see this in units.h, can you send this once it is merged upstream
>
> Actually, it is the first patch of the series.
>
> I asked Rafael if he can merge the entire series.
Pls cc folks on cover at least so that they are aware.
Thanks
--
~Vinod
On 02-03-21, 18:03, Daniel Lezcano wrote: > On 02/03/2021 17:32, Vinod Koul wrote: > > On 24-02-21, 15:42, Daniel Lezcano wrote: > >> HZ unit conversion macros are available in units.h, use them and > >> remove the duplicate definition. > >> > >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > >> --- > >> drivers/phy/st/phy-stm32-usbphyc.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c > >> index a54317e96c41..02dd12bb4692 100644 > >> --- a/drivers/phy/st/phy-stm32-usbphyc.c > >> +++ b/drivers/phy/st/phy-stm32-usbphyc.c > >> @@ -14,6 +14,7 @@ > >> #include <linux/of_platform.h> > >> #include <linux/phy/phy.h> > >> #include <linux/reset.h> > >> +#include <linux/units.h> > >> > >> #define STM32_USBPHYC_PLL 0x0 > >> #define STM32_USBPHYC_MISC 0x8 > >> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { > >> #define PLL_FVCO_MHZ 2880 > >> #define PLL_INFF_MIN_RATE_HZ 19200000 > >> #define PLL_INFF_MAX_RATE_HZ 38400000 > >> -#define HZ_PER_MHZ 1000000L > > > > I dont see this in units.h, can you send this once it is merged upstream > > Actually, it is the first patch of the series. > > I asked Rafael if he can merge the entire series. Pls cc folks on cover at least so that they are aware. Thanks -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On 03/03/2021 06:40, Vinod Koul wrote: > On 02-03-21, 18:03, Daniel Lezcano wrote: >> On 02/03/2021 17:32, Vinod Koul wrote: >>> On 24-02-21, 15:42, Daniel Lezcano wrote: >>>> HZ unit conversion macros are available in units.h, use them and >>>> remove the duplicate definition. >>>> >>>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >>>> --- >>>> drivers/phy/st/phy-stm32-usbphyc.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c >>>> index a54317e96c41..02dd12bb4692 100644 >>>> --- a/drivers/phy/st/phy-stm32-usbphyc.c >>>> +++ b/drivers/phy/st/phy-stm32-usbphyc.c >>>> @@ -14,6 +14,7 @@ >>>> #include <linux/of_platform.h> >>>> #include <linux/phy/phy.h> >>>> #include <linux/reset.h> >>>> +#include <linux/units.h> >>>> >>>> #define STM32_USBPHYC_PLL 0x0 >>>> #define STM32_USBPHYC_MISC 0x8 >>>> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { >>>> #define PLL_FVCO_MHZ 2880 >>>> #define PLL_INFF_MIN_RATE_HZ 19200000 >>>> #define PLL_INFF_MAX_RATE_HZ 38400000 >>>> -#define HZ_PER_MHZ 1000000L >>> >>> I dont see this in units.h, can you send this once it is merged upstream >> >> Actually, it is the first patch of the series. >> >> I asked Rafael if he can merge the entire series. > > Pls cc folks on cover at least so that they are aware. Yeah, sorry for that. I tend to rely too much on the default 'cccmd'. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 03/03/2021 06:40, Vinod Koul wrote: > On 02-03-21, 18:03, Daniel Lezcano wrote: >> On 02/03/2021 17:32, Vinod Koul wrote: >>> On 24-02-21, 15:42, Daniel Lezcano wrote: >>>> HZ unit conversion macros are available in units.h, use them and >>>> remove the duplicate definition. >>>> >>>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >>>> --- >>>> drivers/phy/st/phy-stm32-usbphyc.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c >>>> index a54317e96c41..02dd12bb4692 100644 >>>> --- a/drivers/phy/st/phy-stm32-usbphyc.c >>>> +++ b/drivers/phy/st/phy-stm32-usbphyc.c >>>> @@ -14,6 +14,7 @@ >>>> #include <linux/of_platform.h> >>>> #include <linux/phy/phy.h> >>>> #include <linux/reset.h> >>>> +#include <linux/units.h> >>>> >>>> #define STM32_USBPHYC_PLL 0x0 >>>> #define STM32_USBPHYC_MISC 0x8 >>>> @@ -48,7 +49,6 @@ static const char * const supplies_names[] = { >>>> #define PLL_FVCO_MHZ 2880 >>>> #define PLL_INFF_MIN_RATE_HZ 19200000 >>>> #define PLL_INFF_MAX_RATE_HZ 38400000 >>>> -#define HZ_PER_MHZ 1000000L >>> >>> I dont see this in units.h, can you send this once it is merged upstream >> >> Actually, it is the first patch of the series. >> >> I asked Rafael if he can merge the entire series. > > Pls cc folks on cover at least so that they are aware. Yeah, sorry for that. I tend to rely too much on the default 'cccmd'. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Feb 24, 2021 at 03:42:15PM +0100, Daniel Lezcano wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. I assume the idea is to submit the series together, so Acked-by: Guenter Roeck <linux@roeck-us.net> Guenter > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > Reviewed-by: Christian Eggers <ceggers@arri.de> > --- > drivers/hwmon/mr75203.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c > index 18da5a25e89a..868243dba1ee 100644 > --- a/drivers/hwmon/mr75203.c > +++ b/drivers/hwmon/mr75203.c > @@ -17,6 +17,7 @@ > #include <linux/property.h> > #include <linux/regmap.h> > #include <linux/reset.h> > +#include <linux/units.h> > > /* PVT Common register */ > #define PVT_IP_CONFIG 0x04 > @@ -37,7 +38,6 @@ > #define CLK_SYNTH_EN BIT(24) > #define CLK_SYS_CYCLES_MAX 514 > #define CLK_SYS_CYCLES_MIN 2 > -#define HZ_PER_MHZ 1000000L > > #define SDIF_DISABLE 0x04 >
On Wed, 24 Feb 2021 15:42:14 +0100 Daniel Lezcano <daniel.lezcano@linaro.org> wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> > Reviewed-by: Christian Eggers <ceggers@arri.de> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > drivers/iio/light/as73211.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c > index 7b32dfaee9b3..3ba2378df3dd 100644 > --- a/drivers/iio/light/as73211.c > +++ b/drivers/iio/light/as73211.c > @@ -24,8 +24,7 @@ > #include <linux/module.h> > #include <linux/mutex.h> > #include <linux/pm.h> > - > -#define HZ_PER_KHZ 1000 > +#include <linux/units.h> > > #define AS73211_DRV_NAME "as73211" >
On Wed, 24 Feb 2021 15:42:16 +0100 Daniel Lezcano <daniel.lezcano@linaro.org> wrote: > HZ unit conversion macros are available in units.h, use them and > remove the duplicate definition. > > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c > index 442ff787f7af..dda3b67e494f 100644 > --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c > +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c > @@ -11,13 +11,12 @@ > #include <linux/kernel.h> > #include <linux/slab.h> > #include <linux/time.h> > +#include <linux/units.h> > > #include <linux/hid-sensor-hub.h> > #include <linux/iio/iio.h> > #include <linux/iio/sysfs.h> > > -#define HZ_PER_MHZ 1000000L > - > static struct { > u32 usage_id; > int unit; /* 0 for default others from HID sensor spec */
Hi Rafael, is it possible to merge this series through linux-pm ? On 25/02/2021 12:22, Andy Shevchenko wrote: > On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote: >> The macros for the unit conversion for frequency are duplicated in >> different places. >> >> Provide these macros in the 'units' header, so they can be reused. > > For the all that have not been tagged: > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Thanks! > >> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> >> Reviewed-by: Christian Eggers <ceggers@arri.de> >> Reviewed-by: Andy Shevchenko <Andy.Shevchenko@gmail.com> >> --- >> include/linux/units.h | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/include/linux/units.h b/include/linux/units.h >> index dcc30a53fa93..218ec0d314b6 100644 >> --- a/include/linux/units.h >> +++ b/include/linux/units.h >> @@ -4,6 +4,10 @@ >> >> #include <linux/math.h> >> >> +#define HZ_PER_KHZ 1000L >> +#define KHZ_PER_MHZ 1000L >> +#define HZ_PER_MHZ 1000000L >> + >> #define MILLIWATT_PER_WATT 1000L >> #define MICROWATT_PER_MILLIWATT 1000L >> #define MICROWATT_PER_WATT 1000000L >> -- >> 2.17.1 >> > -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote:
> The macros for the unit conversion for frequency are duplicated in
> different places.
>
> Provide these macros in the 'units' header, so they can be reused.
Hmm... I think you need to rebase, add cover letter and resend.
--
With Best Regards,
Andy Shevchenko
On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote:
> The macros for the unit conversion for frequency are duplicated in
> different places.
>
> Provide these macros in the 'units' header, so they can be reused.
Any progress on this? Are you planning to resubmit?
--
With Best Regards,
Andy Shevchenko
On 12/07/2021 18:34, Andy Shevchenko wrote: > On Wed, Feb 24, 2021 at 03:42:11PM +0100, Daniel Lezcano wrote: >> The macros for the unit conversion for frequency are duplicated in >> different places. >> >> Provide these macros in the 'units' header, so they can be reused. > > Any progress on this? Are you planning to resubmit? Yes, I'll resubmit a new series. -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog