Re: [PATCH] pwm: Make info in traces about affected pwm more useful

2024-07-30 Thread Uwe Kleine-König
On Tue, Jul 30, 2024 at 10:39:10AM -0400, Steven Rostedt wrote: > On Tue, 30 Jul 2024 09:22:53 +0200 > Uwe Kleine-König wrote: > > > I think the patch is obvious enough to be ok even without the tracing > > maintainer's blessing. I applied it to > > https://git

Re: [PATCH] pwm: Make info in traces about affected pwm more useful

2024-07-30 Thread Uwe Kleine-König
Hello, On Fri, Jul 05, 2024 at 11:14:51PM +0200, Uwe Kleine-König wrote: > The hashed pointer isn't useful to identify the pwm device. Instead > store and emit chipid and hwpwm. > > Signed-off-by: Uwe Kleine-König > --- > include/trace/events/pwm.h | 10 ++--

Re: [PATCH v3] init: staging: Fix missing warning/taint on builtin code

2024-07-08 Thread Uwe Kleine-König
e at all, I think they > would apply for most regular macros but initcall macros are just way > different. > > Fixes: 061b1bd394ca ("Staging: add TAINT_CRAP for all drivers/staging code") > Signed-off-by: Ágatha Isabelle Chris Moreira Guedes I didn't grok

[PATCH] pwm: Make info in traces about affected pwm more useful

2024-07-05 Thread Uwe Kleine-König
The hashed pointer isn't useful to identify the pwm device. Instead store and emit chipid and hwpwm. Signed-off-by: Uwe Kleine-König --- include/trace/events/pwm.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/trace/events/pwm.h b/include/trace/e

Re: [PATCH] staging: Fix missing warning/taint on builtin code

2024-07-02 Thread Uwe Kleine-König
Hello Ágatha, On Tue, Jul 02, 2024 at 02:44:31AM -0300, Ágatha Isabelle Chris Moreira Guedes wrote: > ACKNOWLEDGEMENTS > Thanks for Jookia, heat and ukleinek for the important comments & > suggestions on this patch prior to submission. FTR: That happend in the #kernelnewbies irc channel. > dri

Re: [PATCH v5 2/2] leds: add ktd202x driver

2023-10-01 Thread Uwe Kleine-König
ut if you can restrict both variables to the for loop, that's nicer. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v6 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-18 Thread Uwe Kleine-König
On Mon, Apr 19, 2021 at 09:00:07AM +0900, Nobuhiro Iwamatsu wrote: > Add driver for the PWM controller on Toshiba Visconti ARM SoC. > > Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Uwe Kleine-König Thanks for your endurance to improve the driver Uwe -- Pengut

Re: [PATCH v5 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-18 Thread Uwe Kleine-König
writel(pwmc0, priv->base + PIPGM_PWMC(pwm->hwpwm)); > + writel(duty_cycle, priv->base + PIPGM_PDUT(pwm->hwpwm)); > + writel(period, priv->base + PIPGM_PCSR(pwm->hwpwm)); > + > + return 0; > +} Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-18 Thread Uwe Kleine-König
Hello Thierry, On Fri, Apr 16, 2021 at 12:45:10PM +0200, Thierry Reding wrote: > On Fri, Apr 16, 2021 at 11:32:12AM +0200, Uwe Kleine-König wrote: > > On Thu, Apr 15, 2021 at 06:27:02PM +0200, Thierry Reding wrote: > > > On Tue, Apr 13, 2021 at 07:56:31PM +0200, Uwe

Re: [PATCH v9 8/8] pwm: pca9685: Add error messages for failed regmap calls

2021-04-17 Thread Uwe Kleine-König
il if the first regmap_read or the first regmap_write fails. > > Signed-off-by: Clemens Gruber Acked-by: Uwe Kleine-König Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.

Re: [PATCH v9 7/8] pwm: pca9685: Restrict period change for enabled PWMs

2021-04-17 Thread Uwe Kleine-König
ale setting. If there is more than one channel in use, > the prescale settings resulting from the chosen periods must match. > > GPIOs do not count as enabled PWMs as they are not using the prescaler > and can't change it. > > Signed-off-by: Clemens Gruber Acked-by: Uwe Klei

Re: [PATCH v9 2/8] pwm: pca9685: Support hardware readout

2021-04-17 Thread Uwe Kleine-König
t; --- > Changes since v8: > - As we left the math in apply as-is, use DIV_ROUND_DOWN in get_state I first thought this was wrong, because .apply uses ROUND_CLOSEST for period and ROUND_UP for duty. But as the calculation for period is exact this doesn't matter and round-down is inde

Re: [PATCH v9 1/8] pwm: pca9685: Switch to atomic API

2021-04-17 Thread Uwe Kleine-König
R default (full OFF) > > Signed-off-by: Clemens Gruber (I sent my ack to v8 before, but indeed this was the version I intended to ack) Acked-by: Uwe Kleine-König -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions |

Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-17 Thread Uwe Kleine-König
e by PWM is not output. A PWM that is currently configured with .enabled = true and .duty_cycle = 0 doesn't have a pulse, so this is fine. > However, I think this means that the device is working as this driver. I don't understand this sentence. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v8 8/8] pwm: pca9685: Add error messages for failed regmap calls

2021-04-17 Thread Uwe Kleine-König
il if the first regmap_read or the first regmap_write fails. > > Signed-off-by: Clemens Gruber Acked-by: Uwe Kleine-König Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.

Re: [PATCH v8 7/8] pwm: pca9685: Restrict period change for enabled PWMs

2021-04-17 Thread Uwe Kleine-König
patch could be a tad simpler (by just counting the number of enabled channels instead of maintaining a bitmap). Still this is beneficial, so: Acked-by: Uwe Kleine-König Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-17 Thread Uwe Kleine-König
tches 4 to 8 can probably wait for 5.13 and > have some time in linux-next. I'm ok in getting those into next now and than into the upcoming merge window. That won't make them part of 5.12 however, but 5.13-rc1. IMHO patches 7 and 8 can go in, too. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-17 Thread Uwe Kleine-König
efault (full OFF) I didn't recheck all details, but the patch is definitively an improvement, so: Acked-by: Uwe Kleine-König Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengut

Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-16 Thread Uwe Kleine-König
Hello Nobuhiro, On Fri, Apr 16, 2021 at 05:07:21PM +0900, Nobuhiro Iwamatsu wrote: > On Mon, Apr 12, 2021 at 09:02:32AM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 11:55:36AM +0900, Nobuhiro Iwamatsu wrote: > > > On Sat, Apr 10, 2021 at 03:53:21PM +0200, Uwe

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-16 Thread Uwe Kleine-König
Hello Thierry, On Thu, Apr 15, 2021 at 06:27:02PM +0200, Thierry Reding wrote: > On Tue, Apr 13, 2021 at 07:56:31PM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 13, 2021 at 01:51:15PM +0200, Thierry Reding wrote: > > > On Mon, Apr 12, 2021 at 06:27:23PM +0200, Uwe Kleine-König

Re: [PATCH] pwm: mediatek: remove unused function

2021-04-15 Thread Uwe Kleine-König
ng Looks right, even though I would prefer to see a patch implementing .get_state instead (which probably would make use of this function). Acked-by: Uwe Kleine-König Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux So

Re: [PATCH 55/57] staging: comedi: drivers: ni_mio_common: Move 'range_ni_E_ao_ext' to where it is used

2021-04-14 Thread Uwe Kleine-König
ah-Hartman > Cc: Thierry Reding > Cc: "Uwe Kleine-König" > Cc: Lee Jones > Cc: "David A. Schleef" > Cc: Mori Hess > Cc: Truxton Fulton > Cc: linux-stag...@lists.linux.dev > Cc: linux-...@vger.kernel.org > Signed-off-by: Lee Jones > --- > dri

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-14 Thread Uwe Kleine-König
On Wed, Apr 14, 2021 at 09:45:32PM +0200, Clemens Gruber wrote: > On Wed, Apr 14, 2021 at 09:21:31PM +0200, Uwe Kleine-König wrote: > > On Wed, Apr 14, 2021 at 02:09:14PM +0200, Clemens Gruber wrote: > > > Hi Uwe, > > > > > > On Tue, Apr 13, 2021 at 09:3

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-14 Thread Uwe Kleine-König
On Wed, Apr 14, 2021 at 02:09:14PM +0200, Clemens Gruber wrote: > Hi Uwe, > > On Tue, Apr 13, 2021 at 09:38:18PM +0200, Uwe Kleine-König wrote: > > Hello Clemens, > > > > On Tue, Apr 13, 2021 at 02:11:38PM +0200, Clemens Gruber wrote: > > > On Mon, Apr 12,

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-13 Thread Uwe Kleine-König
Hello Clemens, On Tue, Apr 13, 2021 at 02:11:38PM +0200, Clemens Gruber wrote: > On Mon, Apr 12, 2021 at 10:10:19PM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 06:39:28PM +0200, Clemens Gruber wrote: > > > On Mon, Apr 12, 2021 at 06:18:08PM +0200, Uwe Kleine-König

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-13 Thread Uwe Kleine-König
On Tue, Apr 13, 2021 at 01:51:15PM +0200, Thierry Reding wrote: > On Mon, Apr 12, 2021 at 06:27:23PM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 03:27:41PM +0200, Clemens Gruber wrote: > > > Add the flag and corresponding documentation for PWM_USAGE_POWER. > &

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-13 Thread Uwe Kleine-König
Hello, On Mon, Apr 12, 2021 at 06:46:51PM +0200, Clemens Gruber wrote: > On Mon, Apr 12, 2021 at 06:27:23PM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 03:27:41PM +0200, Clemens Gruber wrote: > > > Add the flag and corresponding documentation for PWM_USAGE_

Re: [PATCH v8 6/8] pwm: pca9685: Support new PWM_USAGE_POWER flag

2021-04-13 Thread Uwe Kleine-König
Hi Clemens, On Mon, Apr 12, 2021 at 07:11:58PM +0200, Clemens Gruber wrote: > On Mon, Apr 12, 2021 at 06:30:45PM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 03:27:43PM +0200, Clemens Gruber wrote: > > > static unsigned int pca9685_pwm_get_duty(struct

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-12 Thread Uwe Kleine-König
Hello Clemens, On Mon, Apr 12, 2021 at 06:39:28PM +0200, Clemens Gruber wrote: > On Mon, Apr 12, 2021 at 06:18:08PM +0200, Uwe Kleine-König wrote: > > On Mon, Apr 12, 2021 at 03:27:38PM +0200, Clemens Gruber wrote: > > > The switch to the atomic API goes hand in hand w

Re: [PATCH v8 6/8] pwm: pca9685: Support new PWM_USAGE_POWER flag

2021-04-12 Thread Uwe Kleine-König
+ /* Reset OFF/ON registers to POR default */ > regmap_write(pca->regmap, PCA9685_ALL_LED_OFF_L, LED_FULL); > regmap_write(pca->regmap, PCA9685_ALL_LED_OFF_H, LED_FULL); > + regmap_write(pca->regmap, PCA9685_ALL_LED_ON_L, 0); > + regmap_write(pca->regmap,

Re: [PATCH v8 4/8] dt-bindings: pwm: Support new PWM_USAGE_POWER flag

2021-04-12 Thread Uwe Kleine-König
there already is. This is a NAck. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v8 2/8] pwm: pca9685: Support hardware readout

2021-04-12 Thread Uwe Kleine-König
prescale and > counter register values. > > Also note that although the datasheet mentions 200 Hz as default > frequency when using the internal 25 MHz oscillator, the calculated > period from the default prescaler register setting of 30 is 5079040ns. > > Signed-off-by: Clemens Grube

Re: [PATCH v8 1/8] pwm: pca9685: Switch to atomic API

2021-04-12 Thread Uwe Kleine-König
ap_write(pca->regmap, PCA9685_PRESCALE, prescale); > > - regmap_update_bits(pca->regmap, reg, LED_FULL, 0x0); > + /* Wake the chip up */ > + pca9685_set_sleep_mode(pca, false); > + } > > + duty = PCA9685_COUNTER_RANGE * state->duty_c

Re: [PATCH 1/4] dt-bindings: Add bindings for aspeed pwm-tach.

2021-04-12 Thread Uwe Kleine-König
Hello, On Mon, Apr 12, 2021 at 05:54:54PM +0800, Billy Tsai wrote: > + - Billy Tsai I object because the MTA at aspeedtech.com doesn't know this email address. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux S

Re: [PATCH 3/4] pwm: Add Aspeed ast2600 PWM support

2021-04-12 Thread Uwe Kleine-König
priv->chip.dev = dev; > + priv->chip.ops = &aspeed_pwm_ops; > + priv->chip.base = -1; This isn't necessary since f9a8ee8c8bcd118e800d88772c6457381db45224, please drop the assignment to base. > + priv->chip.npwm = ASPEED_NR_PWMS; > + priv->chip.of_xlate = of_pwm_xlate_with_flags; > + priv->chip.of_pwm_n_cells = 3; > + > + ret = pwmchip_add(&priv->chip); > + if (ret < 0) { > + dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret); Please use %pe to make the error messages better readable. > + return ret; > + } > + dev_set_drvdata(dev, priv); > + return ret; > +} > + > +static const struct of_device_id of_pwm_match_table[] = { > + { > + .compatible = "aspeed,ast2600-pwm", > + }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, of_pwm_match_table); > + > +static struct platform_driver aspeed_pwm_driver = { > + .probe = aspeed_pwm_probe, Please implement a .remove callback. > + .driver = { > + .name = "aspeed_pwm", > + .of_match_table = of_pwm_match_table, > + }, > +}; Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH 4/4] pwm: Add support for aspeed pwm controller

2021-04-12 Thread Uwe Kleine-König
SPEEDG6 PWM support" No depends? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-12 Thread Uwe Kleine-König
On Mon, Apr 12, 2021 at 11:55:36AM +0900, Nobuhiro Iwamatsu wrote: > Hi Uwe, > > Thanks for your review. > > On Sat, Apr 10, 2021 at 03:53:21PM +0200, Uwe Kleine-König wrote: > > Hello, > > > > just a few small details left to criticize ... > > >

Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-10 Thread Uwe Kleine-König
on prefix and so you could rename this function to visconti_pwm_from_chip or similar. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v7 4/8] dt-bindings: pwm: Support new PWM_STAGGERING_ALLOWED flag

2021-04-10 Thread Uwe Kleine-König
ag. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v7 4/8] dt-bindings: pwm: Support new PWM_STAGGERING_ALLOWED flag

2021-04-10 Thread Uwe Kleine-König
Hello Thierry, On Fri, Apr 09, 2021 at 02:27:34PM +0200, Thierry Reding wrote: > On Wed, Apr 07, 2021 at 07:33:57AM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 06, 2021 at 06:41:36PM +0200, Clemens Gruber wrote: > > > Add the flag and corresponding documentation for the

Re: [PATCH v3 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-10 Thread Uwe Kleine-König
pwmchip_remove will always return 0 since b2c200e3f2fd which is in v5.3. So Thierry's suggestion is safe and indeed welcome. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v4 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-10 Thread Uwe Kleine-König
m = 4; > + > + ret = pwmchip_add(&priv->chip); > + if (ret < 0) > + return dev_err_probe(&pdev->dev, ret, "Cannot register visconti > PWM\n"); Thierry told to have picked up my patch to add the function devm_pwmchip_add. I just double checked and it didn't made it into his for-next branch yet. When you respin this series please check if the patch landed in the mean time and then make use of it. > + return 0; > +} Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [v3,PATCH 3/3] pwm: mtk_disp: implement .get_state()

2021-04-09 Thread Uwe Kleine-König
On Fri, Apr 09, 2021 at 02:24:43PM +0200, Thierry Reding wrote: > On Tue, Apr 06, 2021 at 12:27:56PM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 06, 2021 at 05:57:42PM +0800, Rex-BC Chen wrote: > > > implement get_state function for pwm-mtk-disp > > > >

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-09 Thread Uwe Kleine-König
Hello Thierry, On Fri, Apr 09, 2021 at 01:25:36PM +0200, Thierry Reding wrote: > On Thu, Apr 08, 2021 at 07:36:37PM +0200, Uwe Kleine-König wrote: > > On Thu, Apr 08, 2021 at 05:51:36PM +0200, Clemens Gruber wrote: > > > On Thu, Apr 08, 2021 at 02:50:40PM +0200, Thierry Reding

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-08 Thread Uwe Kleine-König
han .period = 20 .duty_cycle = 5 would also be an allowed response for the request .period = 200 .duty_cycle = 50 and this is not what is in the focus here. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v2 2/2] pwm: visconti: Add Toshiba Visconti SoC PWM support

2021-04-08 Thread Uwe Kleine-König
aracters per line has been changed to > 100 characters. Does the pwm driver recommend 80 characters? For free-text comments I'd still recommend 80, yes. For code lines I'd be indeed more lax, as a line break in function calls reduces readability. Best regards Uwe -- Pengutronix e.K.

Re: [PATCH v7 8/8] pwm: pca9685: Add error messages for failed regmap calls

2021-04-07 Thread Uwe Kleine-König
Hello Clemens, On Wed, Apr 07, 2021 at 10:47:45PM +0200, Clemens Gruber wrote: > On Wed, Apr 07, 2021 at 08:16:19AM +0200, Uwe Kleine-König wrote: > > You didn't check all return codes? How did you select the calls to > > check? > > No, because it would become a bi

Re: [PATCH v7 7/8] pwm: pca9685: Restrict period change for enabled PWMs

2021-04-07 Thread Uwe Kleine-König
On Wed, Apr 07, 2021 at 10:41:27PM +0200, Clemens Gruber wrote: > On Wed, Apr 07, 2021 at 08:12:29AM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 06, 2021 at 06:41:39PM +0200, Clemens Gruber wrote: > > > Previously, the last used PWM channel could change the global prescale &

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-07 Thread Uwe Kleine-König
On Wed, Apr 07, 2021 at 10:21:10PM +0200, Clemens Gruber wrote: > On Wed, Apr 07, 2021 at 07:46:58AM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 06, 2021 at 06:41:37PM +0200, Clemens Gruber wrote: > > > If the flag PWM_STAGGERING_ALLOWED is set on a channel, the PWM dr

Re: [PATCH v7 2/8] pwm: pca9685: Support hardware readout

2021-04-07 Thread Uwe Kleine-König
On Wed, Apr 07, 2021 at 09:33:20AM +0200, Clemens Gruber wrote: > On Wed, Apr 07, 2021 at 07:31:35AM +0200, Uwe Kleine-König wrote: > > On Tue, Apr 06, 2021 at 06:41:34PM +0200, Clemens Gruber wrote: > > > Implements .get_state to read-out the current hardware state. > &g

Re: [PATCH v7 8/8] pwm: pca9685: Add error messages for failed regmap calls

2021-04-06 Thread Uwe Kleine-König
pwm_set_duty(struct pca9685 *pca, > int channel, unsigned int > > if (duty == 0) { > /* Set the full OFF bit, which has the highest precedence */ > - regmap_write(pca->regmap, REG_OFF_H(channel), LED_FULL); > + pca9685_write_reg(pca,

Re: [PATCH v7 7/8] pwm: pca9685: Restrict period change for enabled PWMs

2021-04-06 Thread Uwe Kleine-König
channel is correct here. But given that it is messy anyhow, (e.g. because setting some state to this set-all channel doesn't influence pwm_get_state for the individual channels) I don't object if there is another problem in this corner case. IMHO just dropping this virtual channel would be nice.) Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v7 5/8] pwm: core: Support new PWM_STAGGERING_ALLOWED flag

2021-04-06 Thread Uwe Kleine-König
tive. Another objection I have is that we already have some technical debt because there are already two different types of drivers (.apply vs .config+.set_polarity+.enable+.disable) and I would like to unify this first before introducing new stuff. Best regards Uwe -- Pengutronix e.K.

Re: [PATCH v7 4/8] dt-bindings: pwm: Support new PWM_STAGGERING_ALLOWED flag

2021-04-06 Thread Uwe Kleine-König
ggering explicit for the consumer by expanding struct pwm_state with an .offset member to shift the active phase in the period. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.d

Re: [PATCH v7 2/8] pwm: pca9685: Support hardware readout

2021-04-06 Thread Uwe Kleine-König
period, PCA9685_COUNTER_RANGE); (I'm using round-up here assuming apply uses round-down to get idempotency. In the current patch set state this is wrong however.) > +} > + > static int pca9685_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) > { > struct pca9685 *pca = to_pca(chip); Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v7 1/8] pwm: pca9685: Switch to atomic API

2021-04-06 Thread Uwe Kleine-König
_ALL_LED_OFF_L; > - else > - reg = LED_N_OFF_L(pwm->hwpwm); > - > - regmap_write(pca->regmap, reg, 0x0); > -} > - > static int pca9685_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) > { > struct pca9685 *pca = to_pca(chip); > @@

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-04-06 Thread Uwe Kleine-König
Hello Thierry, On Tue, Apr 06, 2021 at 03:47:15PM +0200, Thierry Reding wrote: > On Tue, Apr 06, 2021 at 08:33:57AM +0200, Uwe Kleine-König wrote: > > On Wed, Mar 31, 2021 at 05:52:45PM +0200, Thierry Reding wrote: > > > On Wed, Mar 31, 2021 at 12:25:43PM +0200, Uwe Kleine-König

Re: [PATCH] pwm: Rename pwm_get_state() to better reflect its semantic

2021-04-06 Thread Uwe Kleine-König
Hello Thierry, On Tue, Apr 06, 2021 at 01:16:31PM +0200, Thierry Reding wrote: > On Tue, Apr 06, 2021 at 09:30:36AM +0200, Uwe Kleine-König wrote: > > Given that lowlevel drivers usually cannot implement exactly what a > > consumer requests with pwm_apply_state() there is some ro

Re: [v3,PATCH 3/3] pwm: mtk_disp: implement .get_state()

2021-04-06 Thread Uwe Kleine-König
clk_disable_unprepare(mdp->clk_mm); > + clk_disable_unprepare(mdp->clk_main); That's wrong, you enabled unconditionally so you should also disable unconditionally. If you want to prevent that clocks of a running PWM are disabled by the unused clk initc

Re: [v3,PATCH 2/3] pwm: mtk_disp: convert the driver to atomic API

2021-04-06 Thread Uwe Kleine-König
clk_div << PWM_CLKDIV_SHIFT); > + mtk_disp_pwm_update_bits(mdp, mdp->data->con0, > + PWM_POLARITY, polarity); > mtk_disp_pwm_update_bits(mdp, mdp->data->con1, >PWM_PERIOD_MASK | PWM_HIGH_WIDTH_MASK, >value); Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [v3,PATCH 1/3] pwm: mtk_disp: clear the clock operations

2021-04-06 Thread Uwe Kleine-König
ch applied? If not, please rearrange and order this patch after the conversion to the atomic API. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

[PATCH] pwm: Rename pwm_get_state() to better reflect its semantic

2021-04-06 Thread Uwe Kleine-König
in reply to the last request). To make this semantic obvious rename the function. Signed-off-by: Uwe Kleine-König --- Documentation/driver-api/pwm.rst | 6 +++- drivers/clk/clk-pwm.c | 2 +- drivers/gpu/drm/i915/display/intel_panel.c | 4 +-- drivers/input/misc

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-04-05 Thread Uwe Kleine-König
Hello Thierry, On Wed, Mar 31, 2021 at 05:52:45PM +0200, Thierry Reding wrote: > On Wed, Mar 31, 2021 at 12:25:43PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 22, 2021 at 09:34:21AM +0100, Thierry Reding wrote: > > > On Mon, Jan 11, 2021 at 09:43:50PM +0100, Uwe Kleine-König

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-04-02 Thread Uwe Kleine-König
On Wed, Mar 31, 2021 at 02:26:14PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 08:02:06PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 29, 2021 at 07:16:38PM +0200, Clemens Gruber wrote: > > > On Mon, Mar 29, 2021 at 07:03:57PM +0200, Uwe Kleine-König wrote: >

Re: [PATCH v6 5/7] dt-bindings: pwm: pca9685: Add nxp,staggered-outputs property

2021-04-02 Thread Uwe Kleine-König
h would need an ack by the dt guys, so you should Cc: them in the next round if this (or a similar) patch is still part of the series. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-04-02 Thread Uwe Kleine-König
k the end result is rechnically superior to the approach suggested in the patch under discussion. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-04-01 Thread Uwe Kleine-König
On Wed, Mar 31, 2021 at 03:55:49PM +0200, Clemens Gruber wrote: > On Wed, Mar 31, 2021 at 02:26:14PM +0200, Clemens Gruber wrote: > > On Mon, Mar 29, 2021 at 08:02:06PM +0200, Uwe Kleine-König wrote: > > > On Mon, Mar 29, 2021 at 07:16:38PM +0200, Clemens Gruber wrote: > >

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-04-01 Thread Uwe Kleine-König
Hello Clemens, On Wed, Mar 31, 2021 at 02:26:14PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 08:02:06PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 29, 2021 at 07:16:38PM +0200, Clemens Gruber wrote: > > > On Mon, Mar 29, 2021 at 07:03:57PM +0200, Uwe Kleine-König

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-03-31 Thread Uwe Kleine-König
Hello Thierry, On Mon, Mar 22, 2021 at 09:34:21AM +0100, Thierry Reding wrote: > On Mon, Jan 11, 2021 at 09:43:50PM +0100, Uwe Kleine-König wrote: > > On Sun, Jan 03, 2021 at 06:04:10PM +0100, Clemens Gruber wrote: > > > Another point is the period: Sven suggested we d

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-03-29 Thread Uwe Kleine-König
On Mon, Mar 29, 2021 at 07:16:38PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 07:03:57PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 29, 2021 at 02:57:04PM +0200, Clemens Gruber wrote: > > > The PCA9685 supports staggered LED output ON times to minimize curren

Re: [PATCH v6 6/7] pwm: pca9685: Restrict period change for prescaler users

2021-03-29 Thread Uwe Kleine-König
Hello Clemens, On Mon, Mar 29, 2021 at 07:33:56PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 07:15:59PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 29, 2021 at 02:57:06PM +0200, Clemens Gruber wrote: > > > @@ -330,14 +345,22 @@ static int pca9685_pwm_apply(str

Re: [PATCH v6 2/7] pwm: pca9685: Support hardware readout

2021-03-29 Thread Uwe Kleine-König
On Mon, Mar 29, 2021 at 07:11:53PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 06:54:29PM +0200, Uwe Kleine-König wrote: > > On Mon, Mar 29, 2021 at 02:57:02PM +0200, Clemens Gruber wrote: > > > [...] > > > + /* Calculate (chip-wide) period from prescale value

Re: [PATCH v6 6/7] pwm: pca9685: Restrict period change for prescaler users

2021-03-29 Thread Uwe Kleine-König
channel modifies the period and I won't be able to return to the initial setting. So I think it's sensible to only clear the user bit if the PWM is disabled, but not if it is configured for duty_cycle = 0. Does this make sense? Best regards Uwe -- Pengutronix e.K.

Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times

2021-03-29 Thread Uwe Kleine-König
perty. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v6 2/7] pwm: pca9685: Support hardware readout

2021-03-29 Thread Uwe Kleine-König
ounding errors. So if you feed the state returned here into .apply again, there is (as I want it) no change. The only annoyance is that if PCA9685_PRESCALE holds a value smaller than 3, .apply() will fail. Not sure there is any saner way to handle this. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v6 3/7] pwm: pca9685: Improve runtime PM behavior

2021-03-29 Thread Uwe Kleine-König
->dev); > > + if (!IS_ENABLED(CONFIG_PM)) { > + /* Wake the chip up on non-PM environments */ > + pca9685_set_sleep_mode(pca, false); I admit I didn't grasp all the PM framework details, but I wonder if it's right to first call set_sleep_m

Re: [PATCH v6 2/7] pwm: pca9685: Support hardware readout

2021-03-29 Thread Uwe Kleine-König
re that's not preventable. My requirement here is that .get_state(pwm, &state); .apply_state(pwm, &state); doesn't yield any changes. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Soluti

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-24 Thread Uwe Kleine-König
Hello Sebastian, On Tue, Mar 23, 2021 at 10:04:13AM +0100, Sebastian Andrzej Siewior wrote: > On 2021-03-23 08:34:47 [+0100], Uwe Kleine-König wrote: > > On Mon, Mar 22, 2021 at 09:48:36PM +0100, Sebastian Andrzej Siewior wrote: > > > On 2021-03-22 14:40:32 [+0100], Uwe

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-24 Thread Uwe Kleine-König
Hello Johan, On Tue, Mar 23, 2021 at 03:37:29PM +0100, Johan Hovold wrote: > On Mon, Mar 22, 2021 at 02:40:32PM +0100, Uwe Kleine-König wrote: > > On Mon, Mar 22, 2021 at 02:20:57PM +0100, Johan Hovold wrote: > > > On Mon, Mar 22, 2021 at 12:55:36PM +0100, Uwe Kleine-König wro

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-23 Thread Uwe Kleine-König
Hello Sebastian, On Mon, Mar 22, 2021 at 09:48:36PM +0100, Sebastian Andrzej Siewior wrote: > On 2021-03-22 14:40:32 [+0100], Uwe Kleine-König wrote: > > From a strictly logically point of view you indeed cannot. But if you go > > to the street and say to people there that they can

Re: [PATCH v3 0/3] clk: provide new devm helpers for prepared and enabled clocks

2021-03-22 Thread Uwe Kleine-König
Hello, On Mon, Mar 01, 2021 at 02:50:50PM +0100, Uwe Kleine-König wrote: > Uwe Kleine-König (3): > clk: generalize devm_clk_get() a bit > clk: Provide new devm_clk_helpers for prepared and enabled clocks > pwm: atmel: Simplify using devm_clk_get_prepared() > > driver

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-22 Thread Uwe Kleine-König
Hello Johan, On Mon, Mar 22, 2021 at 02:20:57PM +0100, Johan Hovold wrote: > On Mon, Mar 22, 2021 at 12:55:36PM +0100, Uwe Kleine-König wrote: > > On Mon, Mar 22, 2021 at 12:39:18PM +0100, Sebastian Andrzej Siewior wrote: > > > On 2021-03-22 12:34:02 [+0100], Uwe Kleine-König

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-03-22 Thread Uwe Kleine-König
Hello, On Mon, Mar 22, 2021 at 02:15:08PM +0200, Andy Shevchenko wrote: > On Mon, Mar 22, 2021 at 1:48 PM Uwe Kleine-König > wrote: > > On Mon, Mar 22, 2021 at 01:40:57PM +0200, Andy Shevchenko wrote: > > > On Mon, Mar 22, 2021 at 1:22 PM Uwe Kleine-König > > >

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-22 Thread Uwe Kleine-König
Hallo Sebastian, On Mon, Mar 22, 2021 at 12:39:18PM +0100, Sebastian Andrzej Siewior wrote: > On 2021-03-22 12:34:02 [+0100], Uwe Kleine-König wrote: > > On Mon, Mar 22, 2021 at 12:10:36PM +0100, Johan Hovold wrote: > > > Force-threaded interrupt handlers used to run with

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-03-22 Thread Uwe Kleine-König
On Mon, Mar 22, 2021 at 01:40:57PM +0200, Andy Shevchenko wrote: > On Mon, Mar 22, 2021 at 1:22 PM Uwe Kleine-König > wrote: > > On Mon, Mar 22, 2021 at 11:38:40AM +0200, Andy Shevchenko wrote: > > > On Monday, March 22, 2021, Thierry Reding > > > wrote: > &g

Re: [PATCH] serial: imx: drop workaround for forced irq threading

2021-03-22 Thread Uwe Kleine-König
ange. (And if RT is not affected a different wording would be good.) Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-03-22 Thread Uwe Kleine-König
make the all assumptions much easier. So I think complicating the PWM framework for this isn't the right thing to do. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v8 11/11] pwm: Add Raspberry Pi Firmware based PWM bus

2021-03-12 Thread Uwe Kleine-König
Saenz Julienne 2021? > + * For more information on Raspberry Pi's PoE hat see: > + * https://www.raspberrypi.org/products/poe-hat/ Out of personal interest: Is this hat also able to power a RPi CM4? > + * Limitations: > + * - No disable bit, so a disabled PWM is simulated by

Re: [PATCH v7 11/11] pwm: Add Raspberry Pi Firmware based PWM bus

2021-03-11 Thread Uwe Kleine-König
Hello Nicolas, On Thu, Mar 11, 2021 at 02:01:00PM +0100, Nicolas Saenz Julienne wrote: > On Wed, 2021-03-10 at 12:50 +0100, Uwe Kleine-König wrote: > > On Mon, Jan 18, 2021 at 01:32:44PM +0100, Nicolas Saenz Julienne wrote: > > [...] > > > > + /* > > > +

Re: [PATCH v7 11/11] pwm: Add Raspberry Pi Firmware based PWM bus

2021-03-10 Thread Uwe Kleine-König
as an effect for the next reboot, right? If so I wonder if it is a good idea in general. (Think: The current PWM setting enables a motor that makes a self-driving car move at 100 km/h. Consider the rpi crashes, do I want to car to pick up driving 100 km/h at power up even before Linux is up agai

Re: [GIT PULL] Immutable branch between MFD, PWM and RTC due for the v5.13 merge window

2021-03-10 Thread Uwe Kleine-König
git show -s --pretty=oneline "$c"; fi; done | nl It currently shows 37 merges. Best regards Uwe [1] git rev-list --merges --first-parent 80629611215d1c5d52ed3cf723fd6d24a5872504..next/master | while read c; do if git merge-base --is-ancestor 80629611215d1c5d52ed3cf723fd6d2

Re: [PATCH v2] can: c_can: move runtime PM enable/disable to c_can_platform

2021-03-05 Thread Uwe Kleine-König
hose pm_enable/disable code to > c_can_platform. I can confirm this makes the warning go away on a Congatec Atom board. I didn't do any further runtime tests. Tested-by: Uwe Kleine-König Thanks Uwe -- Pengutronix e.K. | Uwe Kleine-König

Re: [PATCH v3 1/2] pwm: sunxi: Add Allwinner SoC PWM controller driver

2021-03-04 Thread Uwe Kleine-König
writel(pc, clk, PWM_CLK_REG); > + > + pwm_en |= BIT_CH(PWM_EN, pwm->hwpwm); > + sun8i_pwm_writel(pc, pwm_en, PWM_ENABLE_REG); > + } else { > + pwm_en &= ~BIT_CH(PWM_EN, pwm->hwpwm); > + sun8i_pwm_writel(pc, pwm_en, PWM_ENABLE_REG); > + > + clk &= ~BIT_CH(PWM_CLK_GATING, pwm->hwpwm); > + sun8i_pwm_writel(pc, clk, PWM_CLK_REG); > + } > +} > + > +static int sun8i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, > + const struct pwm_state *state) > +{ > + struct pwm_state curstate; > + int ret; > + > + pwm_get_state(pwm, &curstate); Please don't use pwm_get_state. There is a problem in the PWM framework that might require that we add locking to these functions. Using consumer functions in a lowlevel driver would probably deadlock then. > + ret = sun8i_pwm_config(chip, pwm, state); > + > + if (state->polarity != curstate.polarity) > + sun8i_pwm_set_polarity(chip, pwm, state->polarity); > + > + if (state->enabled != curstate.enabled) > + sun8i_pwm_enable(chip, pwm, state->enabled); If your PWM is enabled and the consumer calls: pwm_apply_state(mypwm, { .enabled = false, .period = someperiod, .duty_cycle = someduty}); the hardware might emit someperiod,someduty for a moment, right? Please ensure that in this case you disable first. > + return ret; > +} > + Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH 40/44] tty: hvc, drop unneeded forward declarations

2021-03-03 Thread Uwe Kleine-König
t's easy to resolve. Other than that: Acked-by: Uwe Kleine-König Best regards Uwe > 1 file changed, 25 deletions(-) > > diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c > index c90848919644..0b89d878a108 100644 > --- a/drivers/tty/hvc/hvcs.c > +++ b/dri

Re: linux-next: build failure after merge of the powerpc-fixes tree

2021-03-02 Thread Uwe Kleine-König
Hello, On 3/2/21 3:09 AM, Michael Ellerman wrote: Stephen Rothwell writes: Hi all, After merging the powerpc-fixes tree, today's linux-next build (powerpc allyesconfig) failed like this: drivers/net/ethernet/ibm/ibmvnic.c:5399:13: error: conflicting types for 'ibmvnic_remove' 5399 | stati

Re: [PATCH 10/44] tty: imx, use ms_to_ktime

2021-03-02 Thread Uwe Kleine-König
art_tx, + ms_to_ktime(port->rs485.delay_rts_before_send), + HRTIMER_MODE_REL); return; } instead? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout

2021-03-01 Thread Uwe Kleine-König
you don't reset, the time is extended (usually) until the consumer comes along and corrects the setting. So the downside of not resetting is quite limited, but if you disable the PWM in .probe() the effect can be worse. And consistency dictates to not reset. > Removing the resets

Re: [PATCH v5 4/7] pwm: pca9685: Reset registers to POR state in probe

2021-03-01 Thread Uwe Kleine-König
t because it's already so long ago I looked into this series. I thought it was already said that taking over the configured state in probe is the nice thing to do?! Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions

Re: [PATCH v5 1/7] pwm: pca9685: Switch to atomic API

2021-03-01 Thread Uwe Kleine-König
y). Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

Re: [PATCH v5 1/7] pwm: pca9685: Switch to atomic API

2021-03-01 Thread Uwe Kleine-König
a request to modify the PWM fails because of that, the PWM consumer probably wants to know. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | https://www.pengutronix.de/ | signature.asc Description: PGP signature

  1   2   3   4   5   6   7   8   9   10   >