From zaneta.kedzierska at fontri.pl Fri Nov 7 01:06:11 2025 From: zaneta.kedzierska at fontri.pl (=?UTF-8?Q? =C5=BBaneta_K=C4=99dzierska ?=) Date: Fri, 7 Nov 2025 09:06:11 GMT Subject: =?UTF-8?Q?Odbi=C3=B3r_w_paczkomacie_?= Message-ID: <20251107084500-0.1.sa.5yiuc.0.g0jffai9fu@fontri.pl> Dzie? dobry, jako lider w us?ugach kurierskich w Polsce przygotowali?my elastyczne rozwi?zanie dla przedsi?biorc?w. Stworzyli?my abonament ??cz?cy dostawy do Paczkomat 24/7 oraz obs?ug? kuriersk? - jeden dostawca, jedna faktura i przewidywalne, sta?e koszty. Czy mog? przedstawi?, co mo?emy zaproponowa? wzgl?dem Pa?stwa potrzeb? Pozdrawiam ?aneta K?dzierska From u.kleine-koenig at baylibre.com Tue Nov 18 09:43:02 2025 From: u.kleine-koenig at baylibre.com (=?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?=) Date: Tue, 18 Nov 2025 18:43:02 +0100 Subject: [PATCH] pwm: bcm2835: Make sure the channel is enabled after pwm_request() Message-ID: <20251118174303.1761577-2-u.kleine-koenig@baylibre.com> The .free callback cleared among others the enable bit PWENx in the control register. When the PWM is requested later again this bit isn't restored but the core assumes the PWM is enabled and thus skips a request to configure the same state as before. To fix that don't touch the hardware configuration in .free(). For symmetry also drop .request() and configure the mode completely in .apply(). Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver") Signed-off-by: Uwe Kleine-K?nig --- drivers/pwm/pwm-bcm2835.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c index 578e95e0296c..532903da521f 100644 --- a/drivers/pwm/pwm-bcm2835.c +++ b/drivers/pwm/pwm-bcm2835.c @@ -34,29 +34,6 @@ static inline struct bcm2835_pwm *to_bcm2835_pwm(struct pwm_chip *chip) return pwmchip_get_drvdata(chip); } -static int bcm2835_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) -{ - struct bcm2835_pwm *pc = to_bcm2835_pwm(chip); - u32 value; - - value = readl(pc->base + PWM_CONTROL); - value &= ~(PWM_CONTROL_MASK << PWM_CONTROL_SHIFT(pwm->hwpwm)); - value |= (PWM_MODE << PWM_CONTROL_SHIFT(pwm->hwpwm)); - writel(value, pc->base + PWM_CONTROL); - - return 0; -} - -static void bcm2835_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) -{ - struct bcm2835_pwm *pc = to_bcm2835_pwm(chip); - u32 value; - - value = readl(pc->base + PWM_CONTROL); - value &= ~(PWM_CONTROL_MASK << PWM_CONTROL_SHIFT(pwm->hwpwm)); - writel(value, pc->base + PWM_CONTROL); -} - static int bcm2835_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, const struct pwm_state *state) { @@ -102,6 +79,9 @@ static int bcm2835_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, /* set polarity */ val = readl(pc->base + PWM_CONTROL); + val &= ~(PWM_CONTROL_MASK << PWM_CONTROL_SHIFT(pwm->hwpwm)); + val |= PWM_MODE << PWM_CONTROL_SHIFT(pwm->hwpwm); + if (state->polarity == PWM_POLARITY_NORMAL) val &= ~(PWM_POLARITY << PWM_CONTROL_SHIFT(pwm->hwpwm)); else @@ -119,8 +99,6 @@ static int bcm2835_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, } static const struct pwm_ops bcm2835_pwm_ops = { - .request = bcm2835_pwm_request, - .free = bcm2835_pwm_free, .apply = bcm2835_pwm_apply, }; base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787 -- 2.47.3 From florian.fainelli at broadcom.com Tue Nov 18 10:33:25 2025 From: florian.fainelli at broadcom.com (Florian Fainelli) Date: Tue, 18 Nov 2025 10:33:25 -0800 Subject: [PATCH] pwm: bcm2835: Make sure the channel is enabled after pwm_request() In-Reply-To: <20251118174303.1761577-2-u.kleine-koenig@baylibre.com> References: <20251118174303.1761577-2-u.kleine-koenig@baylibre.com> Message-ID: <719eeea2-4338-4caf-ba95-ded99d40da5e@broadcom.com> On 11/18/2025 9:43 AM, Uwe Kleine-K?nig wrote: > The .free callback cleared among others the enable bit PWENx in the > control register. When the PWM is requested later again this bit isn't > restored but the core assumes the PWM is enabled and thus skips a > request to configure the same state as before. > > To fix that don't touch the hardware configuration in .free(). For > symmetry also drop .request() and configure the mode completely in > .apply(). > > Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver") > Signed-off-by: Uwe Kleine-K?nig Reviewed-by: Florian Fainelli -- Florian From u.kleine-koenig at baylibre.com Wed Nov 19 03:19:37 2025 From: u.kleine-koenig at baylibre.com (Uwe =?utf-8?Q?Kleine-K=C3=B6nig?=) Date: Wed, 19 Nov 2025 12:19:37 +0100 Subject: [PATCH] pwm: bcm2835: Make sure the channel is enabled after pwm_request() In-Reply-To: <719eeea2-4338-4caf-ba95-ded99d40da5e@broadcom.com> References: <20251118174303.1761577-2-u.kleine-koenig@baylibre.com> <719eeea2-4338-4caf-ba95-ded99d40da5e@broadcom.com> Message-ID: Hello, On Tue, Nov 18, 2025 at 10:33:25AM -0800, Florian Fainelli wrote: > On 11/18/2025 9:43 AM, Uwe Kleine-K?nig wrote: > > The .free callback cleared among others the enable bit PWENx in the > > control register. When the PWM is requested later again this bit isn't > > restored but the core assumes the PWM is enabled and thus skips a > > request to configure the same state as before. > > > > To fix that don't touch the hardware configuration in .free(). For > > symmetry also drop .request() and configure the mode completely in > > .apply(). > > > > Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver") > > Signed-off-by: Uwe Kleine-K?nig > > Reviewed-by: Florian Fainelli Thanks for your review. I decided to not include it in my fixes PR for 6.18 that I just sent out and so applied this patch on https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next for the next merge window. The problem is so old---it was introduced in v3.19-rc1 more than 10 years ago when the driver was created---and the change is not trivial enough for me to be completely confident to be suitable that late in the development cycle. Best regards Uwe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: