[PATCH v8 12/17] pwm: crc: Implement apply() method to support the new atomic PWM API

2020-08-30 Thread Hans de Goede
Replace the enable, disable and config pwm_ops with an apply op, to support the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use do_div when calculating level because pwm_state.period and .duty_cycle are now u64 Changes

[PATCH v8 17/17] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-08-30 Thread Hans de Goede
PWM_OUTPUT_ENABLE bit. This is fixed by an earlier patch in this series. After the dropping of this workaround, the usleep call, which seems unnecessary to begin with, has no useful effect anymore, so drop that too. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- Changes in v7: - Fix a

[PATCH v8 08/17] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-08-30 Thread Hans de Goede
/ duty_cycle calculations to take the extra division by 256 into account. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Use NSEC_PER_USEC instead of adding a new (non-sensical) NSEC_PER_MHZ define --- drivers/pwm/pwm-crc.c | 6 +++--- 1 file changed, 3 insertions

[PATCH v8 09/17] pwm: crc: Fix off-by-one error in the clock-divider calculations

2020-08-30 Thread Hans de Goede
setting a divider of 128 (register-value 127). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Introduce crc_pwm_calc_clk_div() here instead of later in the patch-set to reduce the amount of churn in the patch-set a bit --- drivers/pwm/pwm-crc.c | 17

[PATCH v8 16/17] drm/i915: panel: Honor the VBT PWM min setting for devs with an external PWM controller

2020-08-30 Thread Hans de Goede
minimum level. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 5a13089d2fc0

[PATCH v8 15/17] drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller

2020-08-30 Thread Hans de Goede
. Honoring the VBT specified PWM frequency will also hopefully fix the various bug reports which we have received about users perceiving the backlight to flicker after a suspend/resume cycle. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- .../drm/i915/display/intel_display_types.h| 1

[PATCH v8 07/17] pwm: lpss: Always update state and set update bit

2020-08-30 Thread Hans de Goede
eapad Miix 310 and 320 models and various Medion models. Signed-off-by: Hans de Goede --- Changes in v8: - New patch in v8 of this patch-set --- drivers/pwm/pwm-lpss.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index

[PATCH v8 13/17] pwm: crc: Implement get_state() method

2020-08-30 Thread Hans de Goede
Implement the pwm_ops.get_state() method to complete the support for the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use DIV_ROUND_UP_ULL because pwm_state.period and .duty_cycle are now u64 Changes in v5: - Fix an

[PATCH v8 14/17] drm/i915: panel: Add get_vbt_pwm_freq() helper

2020-08-30 Thread Hans de Goede
de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 27 ++ 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 4072d7062efd..df7472a3b9f8 100644 --- a/drivers/gpu/drm

[PATCH v8 11/17] pwm: crc: Enable/disable PWM output on enable/disable

2020-08-30 Thread Hans de Goede
) set it again on re-enable. Acked-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Remove paragraph about tri-stating the output from the commit message, we don't have a datasheet so this was just an unfounded guess --- drivers/pwm/pwm

[PATCH v8 05/17] pwm: lpss: Add pwm_lpss_prepare_enable() helper

2020-08-30 Thread Hans de Goede
rameter to the new pwm_lpss_prepare_enable() helper, which allows using it in that path too. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-lpss.c | 45 -- 1 file changed, 26 insertions(+)

[PATCH v8 06/17] pwm: lpss: Use pwm_lpss_restore() when restoring state on resume

2020-08-30 Thread Hans de Goede
-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v8: - Drop optimization to skip restore if current ctrl reg is the same as our saved ctrl reg value (because this causes issues on some devices) - Simplify pwm_lpss_restore_state() to not rely on the current state - Modify commit

[PATCH v8 02/17] ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation)

2020-08-30 Thread Hans de Goede
X_ONCE flag and setting that for the CHT PWM controllers. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede --- Changes in v2: - Move #define LPSS_SAVE_CTX_ONCE define to group it with LPSS_SAVE_CTX --- drivers/acpi/acpi_lpss.c | 21 + 1 file changed, 17 insertions(

[PATCH v8 03/17] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-08-30 Thread Hans de Goede
wm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Add Fixes tag - Add Reviewed-by: Andy Shevchenko tag --- drivers/pwm/pwm-lpss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v8 04/17] pwm: lpss: Add range limit check for the base_unit register value

2020-08-30 Thread Hans de Goede
- 1). Fixes: 684309e5043e ("pwm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v5: - Use clamp_val(... instead of clam_t(unsigned long long, ... Changes in v3: - Change upper limit of clamp to (base_unit_range - 1) -

[PATCH v8 00/17] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-30 Thread Hans de Goede
Hi All, Unfortunately while testing some unrelated things I found another issue with this series related to the CHT ACPI GFX0._PS3 code poking the PWM controller in unexpected ways. This new version contains a new patch: "[PATCH v8 07/17] pwm: lpss: Always update state and set update bit" fixing

[PATCH v8 01/17] ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase

2020-08-30 Thread Hans de Goede
rry Trail PWM controllers will be resumed in the no-irq phase. Together with the device-link added by the pwm-get this ensures that the PWM controller will be on when the troublesome PS0 method runs, which stops it from poking the PWM controller. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede

[PATCH v7 11/16] pwm: crc: Implement apply() method to support the new atomic PWM API

2020-08-25 Thread Hans de Goede
Replace the enable, disable and config pwm_ops with an apply op, to support the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use do_div when calculating level because pwm_state.period and .duty_cycle are now u64 Changes

[PATCH v7 12/16] pwm: crc: Implement get_state() method

2020-08-25 Thread Hans de Goede
Implement the pwm_ops.get_state() method to complete the support for the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use DIV_ROUND_UP_ULL because pwm_state.period and .duty_cycle are now u64 Changes in v5: - Fix an

[PATCH v7 15/16] drm/i915: panel: Honor the VBT PWM min setting for devs with an external PWM controller

2020-08-25 Thread Hans de Goede
minimum level. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 7fb162fac8a1

[PATCH v7 13/16] drm/i915: panel: Add get_vbt_pwm_freq() helper

2020-08-25 Thread Hans de Goede
de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 27 ++ 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index bbde3b12c311..ec6b9d704542 100644 --- a/drivers/gpu/drm

[PATCH v7 14/16] drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller

2020-08-25 Thread Hans de Goede
. Honoring the VBT specified PWM frequency will also hopefully fix the various bug reports which we have received about users perceiving the backlight to flicker after a suspend/resume cycle. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- .../drm/i915/display/intel_display_types.h| 1

[PATCH v7 16/16] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-08-25 Thread Hans de Goede
PWM_OUTPUT_ENABLE bit. This is fixed by an earlier patch in this series. After the dropping of this workaround, the usleep call, which seems unnecessary to begin with, has no useful effect anymore, so drop that too. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- Changes in v7: - Fix a

[PATCH v7 07/16] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-08-25 Thread Hans de Goede
/ duty_cycle calculations to take the extra division by 256 into account. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Use NSEC_PER_USEC instead of adding a new (non-sensical) NSEC_PER_MHZ define --- drivers/pwm/pwm-crc.c | 6 +++--- 1 file changed, 3 insertions

[PATCH v7 09/16] pwm: crc: Fix period changes not having any effect

2020-08-25 Thread Hans de Goede
ally be honored. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-crc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c index 44ec7d5b63e1..81232da0c767 100644 --- a/drivers/pwm/pwm-crc.c +++ b/driver

[PATCH v7 06/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-08-25 Thread Hans de Goede
of duplicating this inside the resume handler, this commit makes the resume handler use pwm_lpss_apply() to restore the settings when necessary. This fixes the output-freq and duty-cycle being reset to their defaults on resume. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes

[PATCH v7 10/16] pwm: crc: Enable/disable PWM output on enable/disable

2020-08-25 Thread Hans de Goede
) set it again on re-enable. Acked-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Remove paragraph about tri-stating the output from the commit message, we don't have a datasheet so this was just an unfounded guess --- drivers/pwm/pwm

[PATCH v7 08/16] pwm: crc: Fix off-by-one error in the clock-divider calculations

2020-08-25 Thread Hans de Goede
setting a divider of 128 (register-value 127). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Introduce crc_pwm_calc_clk_div() here instead of later in the patch-set to reduce the amount of churn in the patch-set a bit --- drivers/pwm/pwm-crc.c | 17

[PATCH v7 05/16] pwm: lpss: Add pwm_lpss_prepare_enable() helper

2020-08-25 Thread Hans de Goede
rameter to the new pwm_lpss_prepare_enable() helper, which allows using it in that path too. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-lpss.c | 45 -- 1 file changed, 26 insertions(+)

[PATCH v7 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-25 Thread Hans de Goede
Hi All, I missed on 64-bit divide caused by pwm_state.period and pwm_state.duty_cycle being changed to u64-s in 5.9. This new version fixes this, otherwise this is identical to v6: Here is v6 of my patch series converting the i915 driver's code for controlling the panel's backlight with an exter

[PATCH v7 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-08-25 Thread Hans de Goede
- 1). Fixes: 684309e5043e ("pwm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v5: - Use clamp_val(... instead of clam_t(unsigned long long, ... Changes in v3: - Change upper limit of clamp to (base_unit_range - 1) -

[PATCH v7 01/16] ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase

2020-08-25 Thread Hans de Goede
rry Trail PWM controllers will be resumed in the no-irq phase. Together with the device-link added by the pwm-get this ensures that the PWM controller will be on when the troublesome PS0 method runs, which stops it from poking the PWM controller. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede

[PATCH v7 03/16] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-08-25 Thread Hans de Goede
wm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Add Fixes tag - Add Reviewed-by: Andy Shevchenko tag --- drivers/pwm/pwm-lpss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v7 02/16] ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation)

2020-08-25 Thread Hans de Goede
X_ONCE flag and setting that for the CHT PWM controllers. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede --- Changes in v2: - Move #define LPSS_SAVE_CTX_ONCE define to group it with LPSS_SAVE_CTX --- drivers/acpi/acpi_lpss.c | 21 + 1 file changed, 17 insertions(

[PATCH v6 16/16] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-08-24 Thread Hans de Goede
PWM_OUTPUT_ENABLE bit. This is fixed by an earlier patch in this series. After the dropping of this workaround, the usleep call, which seems unnecessary to begin with, has no useful effect anymore, so drop that too. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- Changes in v6: - Drop the

[PATCH v6 14/16] drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller

2020-08-24 Thread Hans de Goede
. Honoring the VBT specified PWM frequency will also hopefully fix the various bug reports which we have received about users perceiving the backlight to flicker after a suspend/resume cycle. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- .../drm/i915/display/intel_display_types.h| 1

[PATCH v6 15/16] drm/i915: panel: Honor the VBT PWM min setting for devs with an external PWM controller

2020-08-24 Thread Hans de Goede
minimum level. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 7fb162fac8a1

[PATCH v6 13/16] drm/i915: panel: Add get_vbt_pwm_freq() helper

2020-08-24 Thread Hans de Goede
de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 27 ++ 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index bbde3b12c311..ec6b9d704542 100644 --- a/drivers/gpu/drm

[PATCH v6 06/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-08-24 Thread Hans de Goede
of duplicating this inside the resume handler, this commit makes the resume handler use pwm_lpss_apply() to restore the settings when necessary. This fixes the output-freq and duty-cycle being reset to their defaults on resume. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes

[PATCH v6 07/16] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-08-24 Thread Hans de Goede
/ duty_cycle calculations to take the extra division by 256 into account. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Use NSEC_PER_USEC instead of adding a new (non-sensical) NSEC_PER_MHZ define --- drivers/pwm/pwm-crc.c | 6 +++--- 1 file changed, 3 insertions

[PATCH v6 09/16] pwm: crc: Fix period changes not having any effect

2020-08-24 Thread Hans de Goede
ally be honored. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-crc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c index 44ec7d5b63e1..81232da0c767 100644 --- a/drivers/pwm/pwm-crc.c +++ b/driver

[PATCH v6 02/16] ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation)

2020-08-24 Thread Hans de Goede
X_ONCE flag and setting that for the CHT PWM controllers. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede --- Changes in v2: - Move #define LPSS_SAVE_CTX_ONCE define to group it with LPSS_SAVE_CTX --- drivers/acpi/acpi_lpss.c | 21 + 1 file changed, 17 insertions(

[PATCH v6 05/16] pwm: lpss: Add pwm_lpss_prepare_enable() helper

2020-08-24 Thread Hans de Goede
rameter to the new pwm_lpss_prepare_enable() helper, which allows using it in that path too. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-lpss.c | 45 -- 1 file changed, 26 insertions(+)

[PATCH v6 01/16] ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase

2020-08-24 Thread Hans de Goede
rry Trail PWM controllers will be resumed in the no-irq phase. Together with the device-link added by the pwm-get this ensures that the PWM controller will be on when the troublesome PS0 method runs, which stops it from poking the PWM controller. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede

[PATCH v6 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-08-24 Thread Hans de Goede
- 1). Fixes: 684309e5043e ("pwm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v5: - Use clamp_val(... instead of clam_t(unsigned long long, ... Changes in v3: - Change upper limit of clamp to (base_unit_range - 1) -

[PATCH v6 11/16] pwm: crc: Implement apply() method to support the new atomic PWM API

2020-08-24 Thread Hans de Goede
Replace the enable, disable and config pwm_ops with an apply op, to support the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use do_div when calculating level because pwm_state.period and .duty_cycle are now u64 Changes

[PATCH v6 03/16] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-08-24 Thread Hans de Goede
wm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Add Fixes tag - Add Reviewed-by: Andy Shevchenko tag --- drivers/pwm/pwm-lpss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v6 10/16] pwm: crc: Enable/disable PWM output on enable/disable

2020-08-24 Thread Hans de Goede
) set it again on re-enable. Acked-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Remove paragraph about tri-stating the output from the commit message, we don't have a datasheet so this was just an unfounded guess --- drivers/pwm/pwm

[PATCH v6 12/16] pwm: crc: Implement get_state() method

2020-08-24 Thread Hans de Goede
Implement the pwm_ops.get_state() method to complete the support for the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v6: - Rebase on 5.9-rc1 - Use DIV_ROUND_UP_ULL because pwm_state.period and .duty_cycle are now u64 Changes in v5: - Fix an

[PATCH v6 08/16] pwm: crc: Fix off-by-one error in the clock-divider calculations

2020-08-24 Thread Hans de Goede
setting a divider of 128 (register-value 127). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v3: - Introduce crc_pwm_calc_clk_div() here instead of later in the patch-set to reduce the amount of churn in the patch-set a bit --- drivers/pwm/pwm-crc.c | 17

[PATCH v6 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-24 Thread Hans de Goede
Hi All, Here is v6 of my patch series converting the i915 driver's code for controlling the panel's backlight with an external PWM controller to use the atomic PWM API. See below for the changelog. This version of the series has been rebased on 5.9-rc1 and has a Reviewed-by or Acked-by for all pa

Re: [PATCH v5 06/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-08-02 Thread Hans de Goede
Hi, On 7/29/20 10:12 AM, Andy Shevchenko wrote: On Tue, Jul 28, 2020 at 09:55:22PM +0200, Hans de Goede wrote: On 7/28/20 8:57 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:43PM +0200, Hans de Goede wrote: ... Maybe I'm too picky, but I would go even further and split app

Re: [PATCH v5 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-02 Thread Hans de Goede
Hi, On 8/2/20 1:25 PM, Andy Shevchenko wrote: On Sat, Aug 01, 2020 at 04:38:16PM +0200, Hans de Goede wrote: On 7/29/20 12:54 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:37PM +0200, Hans de Goede wrote: ... One comment to consider, though. There are three channels in that PWM

Re: [PATCH v5 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-01 Thread Hans de Goede
Hi, On 7/29/20 12:54 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:37PM +0200, Hans de Goede wrote: Hi All, Here is v5 of my patch series converting the i915 driver's code for controlling the panel's backlight with an external PWM controller to use the atomic PWM API. See

Re: [PATCH v5 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-08-01 Thread Hans de Goede
Hi Thierry, On 7/30/20 11:26 AM, Thierry Reding wrote: On Wed, Jul 29, 2020 at 11:32:28AM +0200, Hans de Goede wrote: cHi, On 7/29/20 10:23 AM, Andy Shevchenko wrote: On Mon, Jul 27, 2020 at 09:41:20AM +0200, Thierry Reding wrote: On Fri, Jul 17, 2020 at 03:37:37PM +0200, Hans de Goede

Re: [PATCH v5 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-07-29 Thread Hans de Goede
cHi, On 7/29/20 10:23 AM, Andy Shevchenko wrote: On Mon, Jul 27, 2020 at 09:41:20AM +0200, Thierry Reding wrote: On Fri, Jul 17, 2020 at 03:37:37PM +0200, Hans de Goede wrote: I've applied patches 3 through 12 to the PWM tree. I thought it was a bit odd that only a handful of these pa

Re: [PATCH v5 07/16] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-07-28 Thread Hans de Goede
Hi, On 7/28/20 9:36 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:44PM +0200, Hans de Goede wrote: While looking into adding atomic-pwm support to the pwm-crc driver I noticed something odd, there is a PWM_BASE_CLK define of 6 MHz and there is a clock-divider which divides this with

Re: [PATCH v5 06/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-07-28 Thread Hans de Goede
Hi, On 7/28/20 8:57 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:43PM +0200, Hans de Goede wrote: Before this commit a suspend + resume of the LPSS PWM controller would result in the controller being reset to its defaults of output-freq = clock/256, duty-cycle=100%, until someone

Re: [PATCH v5 05/16] pwm: lpss: Add pwm_lpss_prepare_enable() helper

2020-07-28 Thread Hans de Goede
Hi, On 7/28/20 8:45 PM, Andy Shevchenko wrote: On Fri, Jul 17, 2020 at 03:37:42PM +0200, Hans de Goede wrote: In the not-enabled -> enabled path pwm_lpss_apply() needs to get a runtime-pm reference; and then on any errors it needs to release it again. This leads to somewhat hard to read c

[PATCH v5 15/16] drm/i915: panel: Honor the VBT PWM min setting for devs with an external PWM controller

2020-07-17 Thread Hans de Goede
minimum level. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 14e611c92194

[PATCH v5 16/16] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-07-17 Thread Hans de Goede
PWM_OUTPUT_ENABLE bit. This is fixed by an earlier patch in this series. After the dropping of this workaround, the usleep call, which seems unnecessary to begin with, has no useful effect anymore, so drop that too. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- Changes in v4: - Add a

[PATCH v5 13/16] drm/i915: panel: Add get_vbt_pwm_freq() helper

2020-07-17 Thread Hans de Goede
de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 27 ++ 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 3c5056dbf607..8efdd9f08a08 100644 --- a/drivers/gpu/drm

[PATCH v5 14/16] drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller

2020-07-17 Thread Hans de Goede
. Honoring the VBT specified PWM frequency will also hopefully fix the various bug reports which we have received about users perceiving the backlight to flicker after a suspend/resume cycle. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- .../drm/i915/display/intel_display_types.h| 1

[PATCH v5 10/16] pwm: crc: Enable/disable PWM output on enable/disable

2020-07-17 Thread Hans de Goede
) set it again on re-enable. Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Remove paragraph about tri-stating the output from the commit message, we don't have a datasheet so this was just an unfounded guess --- drivers/pwm/pwm-crc.c | 4 1 file

[PATCH v5 05/16] pwm: lpss: Add pwm_lpss_prepare_enable() helper

2020-07-17 Thread Hans de Goede
rameter to the new pwm_lpss_prepare_enable() helper, which allows using it in that path too. Suggested-by: Andy Shevchenko Signed-off-by: Hans de Goede --- drivers/pwm/pwm-lpss.c | 45 -- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/d

[PATCH v5 11/16] pwm: crc: Implement apply() method to support the new atomic PWM API

2020-07-17 Thread Hans de Goede
Replace the enable, disable and config pwm_ops with an apply op, to support the new atomic PWM API. Signed-off-by: Hans de Goede --- Changes in v3: - Keep crc_pwm_calc_clk_div() helper to avoid needless churn --- drivers/pwm/pwm-crc.c | 89 ++- 1 file

[PATCH v5 09/16] pwm: crc: Fix period changes not having any effect

2020-07-17 Thread Hans de Goede
915 driver will actually be honored. Signed-off-by: Hans de Goede --- drivers/pwm/pwm-crc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c index 44ec7d5b63e1..81232da0c767 100644 --- a/drivers/pwm/pwm-crc.c +++ b/drivers/pwm/pwm-

[PATCH v5 12/16] pwm: crc: Implement get_state() method

2020-07-17 Thread Hans de Goede
Implement the pwm_ops.get_state() method to complete the support for the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v5: - Fix an indentation issue Changes in v4: - Use DIV_ROUND_UP when calculating the period and duty_cycle from the

[PATCH v5 06/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-07-17 Thread Hans de Goede
of duplicating this inside the resume handler, this commit makes the resume handler use pwm_lpss_apply() to restore the settings when necessary. This fixes the output-freq and duty-cycle being reset to their defaults on resume. Signed-off-by: Hans de Goede --- Changes in v5: - The changes to

[PATCH v5 03/16] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-07-17 Thread Hans de Goede
wm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Add Fixes tag - Add Reviewed-by: Andy Shevchenko tag --- drivers/pwm/pwm-lpss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v5 02/16] ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation)

2020-07-17 Thread Hans de Goede
X_ONCE flag and setting that for the CHT PWM controllers. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede --- Changes in v2: - Move #define LPSS_SAVE_CTX_ONCE define to group it with LPSS_SAVE_CTX --- drivers/acpi/acpi_lpss.c | 21 + 1 file changed, 17 insertions(

[PATCH v5 07/16] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-07-17 Thread Hans de Goede
/ duty_cycle calculations to take the extra division by 256 into account. Signed-off-by: Hans de Goede --- Changes in v3: - Use NSEC_PER_USEC instead of adding a new (non-sensical) NSEC_PER_MHZ define --- drivers/pwm/pwm-crc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v5 08/16] pwm: crc: Fix off-by-one error in the clock-divider calculations

2020-07-17 Thread Hans de Goede
setting a divider of 128 (register-value 127). Signed-off-by: Hans de Goede --- Changes in v3: - Introduce crc_pwm_calc_clk_div() here instead of later in the patch-set to reduce the amount of churn in the patch-set a bit --- drivers/pwm/pwm-crc.c | 17 ++--- 1 file changed, 14

[PATCH v5 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-17 Thread Hans de Goede
- 1). Fixes: 684309e5043e ("pwm: lpss: Avoid potential overflow of base_unit") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v5: - Use clamp_val(... instead of clam_t(unsigned long long, ... Changes in v3: - Change upper limit of clamp to (base_unit_range - 1) -

[PATCH v5 01/16] ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase

2020-07-17 Thread Hans de Goede
rry Trail PWM controllers will be resumed in the no-irq phase. Together with the device-link added by the pwm-get this ensures that the PWM controller will be on when the troublesome PS0 method runs, which stops it from poking the PWM controller. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede

[PATCH v5 00/16] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-07-17 Thread Hans de Goede
Hi All, Here is v5 of my patch series converting the i915 driver's code for controlling the panel's backlight with an external PWM controller to use the atomic PWM API. See below for the changelog. This series consists of 4 parts: 1. acpi_lpss fixes workarounds for Cherry Trail DSTD nastiness 2.

Re: [PATCH] drm/vboxvideo: Replace HTTP links with HTTPS ones

2020-07-13 Thread Hans de Goede
der A. Klimov The "new" https link works for me and I see no reason why not to do this, other then that some weird site might still only do http, so: Reviewed-by: Hans de Goede (oh on second reading I see that the script already checks that the new link works, ah well)

Re: [PATCH v4 06/16] pwm: lpss: Correct get_state result for base_unit == 0

2020-07-11 Thread Hans de Goede
Hi, On 7/11/20 8:11 AM, Uwe Kleine-König wrote: On Thu, Jul 09, 2020 at 05:47:59PM +0200, Hans de Goede wrote: Hi, On 7/9/20 4:50 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:22PM +0200, Hans de Goede wrote: The datasheet specifies that programming the base_unit part of the

Re: [PATCH v4 16/16] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-07-11 Thread Hans de Goede
Hi, On 7/11/20 8:32 AM, Uwe Kleine-König wrote: On Wed, Jul 08, 2020 at 11:14:32PM +0200, Hans de Goede wrote: Now that the PWM drivers which we use have been converted to the atomic PWM API, we can move the i915 panel code over to using the atomic PWM API. The removes a long standing FIXME

Re: [PATCH v4 00/15] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-07-11 Thread Hans de Goede
Hi, On 7/11/20 8:19 AM, Uwe Kleine-König wrote: Hi Hans, On Thu, Jul 09, 2020 at 04:40:56PM +0200, Hans de Goede wrote: On 7/9/20 4:14 PM, Sam Ravnborg wrote: On Wed, Jul 08, 2020 at 11:14:16PM +0200, Hans de Goede wrote: Here is v4 of my patch series converting the i915 driver's cod

Re: [PATCH v4 06/16] pwm: lpss: Correct get_state result for base_unit == 0

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 4:50 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:22PM +0200, Hans de Goede wrote: The datasheet specifies that programming the base_unit part of the ctrl register to 0 results in a contineous low signal. Adjust the get_state method to reflect this by setting

Re: [PATCH v4 00/15] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 4:14 PM, Sam Ravnborg wrote: Hi Hans. On Wed, Jul 08, 2020 at 11:14:16PM +0200, Hans de Goede wrote: Hi All, Here is v4 of my patch series converting the i915 driver's code for controlling the panel's backlight with an external PWM controller to use the atomic PW

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 4:21 PM, Andy Shevchenko wrote: On Thu, Jul 09, 2020 at 03:23:13PM +0200, Hans de Goede wrote: On 7/9/20 2:53 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: When the user requests a high enough period ns value, then the calculations in

Re: [PATCH v4 05/16] pwm: lpss: Use pwm_lpss_apply() when restoring state on resume

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 3:36 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:21PM +0200, Hans de Goede wrote: Before this commit a suspend + resume of the LPSS PWM controller would result in the controller being reset to its defaults of output-freq = clock/256, duty-cycle=100%, until someone

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 2:53 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: When the user requests a high enough period ns value, then the calculations in pwm_lpss_prepare() might result in a base_unit value of 0. But according to the data-sheet the way the

Re: [PATCH 0/9] drm: Add privacy-screen class and connector properties

2020-07-09 Thread Hans de Goede
Hi, On 7/8/20 11:25 PM, Alex Deucher wrote: On Wed, Jul 8, 2020 at 12:43 PM Hans de Goede wrote: Hi All, Here is the privacy-screen related code which we discussed a while ago. This series consists of a number of different parts: 1. A new version of Rajat's privacy-screen conn

[PATCH v4 13/16] drm/i915: panel: Add get_vbt_pwm_freq() helper

2020-07-08 Thread Hans de Goede
de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 27 ++ 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 3c5056dbf607..8efdd9f08a08 100644 --- a/drivers/gpu/drm

[PATCH v4 11/16] pwm: crc: Implement apply() method to support the new atomic PWM API

2020-07-08 Thread Hans de Goede
Replace the enable, disable and config pwm_ops with an apply op, to support the new atomic PWM API. Signed-off-by: Hans de Goede --- Changes in v3: - Keep crc_pwm_calc_clk_div() helper to avoid needless churn --- drivers/pwm/pwm-crc.c | 89 ++- 1 file

[PATCH v4 06/16] pwm: lpss: Correct get_state result for base_unit == 0

2020-07-08 Thread Hans de Goede
The datasheet specifies that programming the base_unit part of the ctrl register to 0 results in a contineous low signal. Adjust the get_state method to reflect this by setting pwm_state.period to 1 and duty_cycle to 0. Suggested-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in

[PATCH v4 14/16] drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller

2020-07-08 Thread Hans de Goede
. Honoring the VBT specified PWM frequency will also hopefully fix the various bug reports which we have received about users perceiving the backlight to flicker after a suspend/resume cycle. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- .../drm/i915/display/intel_display_types.h| 1

[PATCH v4 16/16] drm/i915: panel: Use atomic PWM API for devs with an external PWM controller

2020-07-08 Thread Hans de Goede
PWM_OUTPUT_ENABLE bit. This is fixed by an earlier patch in this series. After the dropping of this workaround, the usleep call, which seems unnecessary to begin with, has no useful effect anymore, so drop that too. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- Changes in v4: - Add a

[PATCH v4 10/16] pwm: crc: Enable/disable PWM output on enable/disable

2020-07-08 Thread Hans de Goede
) set it again on re-enable. Acked-by: Uwe Kleine-König Signed-off-by: Hans de Goede --- Changes in v3: - Remove paragraph about tri-stating the output from the commit message, we don't have a datasheet so this was just an unfounded guess --- drivers/pwm/pwm-crc.c | 4 1 file

[PATCH v4 12/16] pwm: crc: Implement get_state() method

2020-07-08 Thread Hans de Goede
Implement the pwm_ops.get_state() method to complete the support for the new atomic PWM API. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede --- Changes in v4: - Use DIV_ROUND_UP when calculating the period and duty_cycle from the controller's register values Changes in v3:

[PATCH v4 15/16] drm/i915: panel: Honor the VBT PWM min setting for devs with an external PWM controller

2020-07-08 Thread Hans de Goede
minimum level. Acked-by: Jani Nikula Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/intel_panel.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 14e611c92194

[PATCH v4 01/16] ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase

2020-07-08 Thread Hans de Goede
rry Trail PWM controllers will be resumed in the no-irq phase. Together with the device-link added by the pwm-get this ensures that the PWM controller will be on when the troublesome PS0 method runs, which stops it from poking the PWM controller. Acked-by: Rafael J. Wysocki Signed-off-by: Hans de Goede

[PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-08 Thread Hans de Goede
- 1). Fixes: 684309e5043e ("pwm: lpss: Avoid potential overflow of base_unit") Signed-off-by: Hans de Goede --- Changes in v3: - Change upper limit of clamp to (base_unit_range - 1) - Add Fixes tag --- drivers/pwm/pwm-lpss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v4 07/16] pwm: crc: Fix period / duty_cycle times being off by a factor of 256

2020-07-08 Thread Hans de Goede
/ duty_cycle calculations to take the extra division by 256 into account. Signed-off-by: Hans de Goede --- Changes in v3: - Use NSEC_PER_USEC instead of adding a new (non-sensical) NSEC_PER_MHZ define --- drivers/pwm/pwm-crc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v4 08/16] pwm: crc: Fix off-by-one error in the clock-divider calculations

2020-07-08 Thread Hans de Goede
setting a divider of 128 (register-value 127). Signed-off-by: Hans de Goede --- Changes in v3: - Introduce crc_pwm_calc_clk_div() here instead of later in the patch-set to reduce the amount of churn in the patch-set a bit --- drivers/pwm/pwm-crc.c | 17 ++--- 1 file changed, 14

[PATCH v4 00/15] acpi/pwm/i915: Convert pwm-crc and i915 driver's PWM code to use the atomic PWM API

2020-07-08 Thread Hans de Goede
Hi All, Here is v4 of my patch series converting the i915 driver's code for controlling the panel's backlight with an external PWM controller to use the atomic PWM API. See below for the changelog. Initially the plan was for this series to consist of 2 parts: 1. convert the pwm-crc driver to supp

[PATCH v4 09/16] pwm: crc: Fix period changes not having any effect

2020-07-08 Thread Hans de Goede
915 driver will actually be honored. Signed-off-by: Hans de Goede --- drivers/pwm/pwm-crc.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c index 44ec7d5b63e1..81232da0c767 100644 --- a/drivers/pwm/pwm-crc.c +++ b/drivers/pwm/pwm-

<    4   5   6   7   8   9   10   11   12   13   >