* [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup
@ 2024-05-27 11:47 Hans de Goede
2024-05-27 11:49 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2024-05-27 11:47 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: Hans de Goede, Jani Nikula, linux-kernel
The primary use of the CRC PMIC's PWM is for LCD panel backlight
control by the i915 driver.
Due to its complexity the probe() function of the i915 driver does not
support -EPROBE_DEFER handling. So far the pwm-crc driver must be built
into the kernel to ensure that the pwm_get() done by the i915 driver
succeeds at once (rather then returning -EPROBE_DEFER).
But the PWM core can load the module from pwm_get() if a module-name is
provided in the pwm_lookup associated with the consumer device.
Switch to using PWM_LOOKUP_WITH_MODULE() for the lookup added for
the Intel integrated GPU, so that the PWM core can load the module from
pwm_get() as needed allowing the pwm-crc driver to be safely built as
module.
This has been successfully tested on an Asus T100TAM with pwm-crc
build as a module.
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11081
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Some small commit message tweaks
- Add Andy's Reviewed-by
---
drivers/mfd/intel_soc_pmic_crc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 581f81cbaa24..876d017f74fe 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -137,7 +137,9 @@ static const struct regmap_irq_chip crystal_cove_irq_chip = {
/* PWM consumed by the Intel GFX */
static struct pwm_lookup crc_pwm_lookup[] = {
- PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
+ PWM_LOOKUP_WITH_MODULE("crystal_cove_pwm", 0, "0000:00:02.0",
+ "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL,
+ "pwm-crc"),
};
struct crystal_cove_config {
--
2.45.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup
2024-05-27 11:47 [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup Hans de Goede
@ 2024-05-27 11:49 ` Hans de Goede
0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2024-05-27 11:49 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Jani Nikula, linux-kernel
Hi,
Ugh I send this to the wrong email address for Lee, so I'm going to resend it
with the right address, sorry about the spam.
Regards,
Hans
On 5/27/24 1:47 PM, Hans de Goede wrote:
> The primary use of the CRC PMIC's PWM is for LCD panel backlight
> control by the i915 driver.
>
> Due to its complexity the probe() function of the i915 driver does not
> support -EPROBE_DEFER handling. So far the pwm-crc driver must be built
> into the kernel to ensure that the pwm_get() done by the i915 driver
> succeeds at once (rather then returning -EPROBE_DEFER).
>
> But the PWM core can load the module from pwm_get() if a module-name is
> provided in the pwm_lookup associated with the consumer device.
>
> Switch to using PWM_LOOKUP_WITH_MODULE() for the lookup added for
> the Intel integrated GPU, so that the PWM core can load the module from
> pwm_get() as needed allowing the pwm-crc driver to be safely built as
> module.
>
> This has been successfully tested on an Asus T100TAM with pwm-crc
> build as a module.
>
> Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11081
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> - Some small commit message tweaks
> - Add Andy's Reviewed-by
> ---
> drivers/mfd/intel_soc_pmic_crc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
> index 581f81cbaa24..876d017f74fe 100644
> --- a/drivers/mfd/intel_soc_pmic_crc.c
> +++ b/drivers/mfd/intel_soc_pmic_crc.c
> @@ -137,7 +137,9 @@ static const struct regmap_irq_chip crystal_cove_irq_chip = {
>
> /* PWM consumed by the Intel GFX */
> static struct pwm_lookup crc_pwm_lookup[] = {
> - PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
> + PWM_LOOKUP_WITH_MODULE("crystal_cove_pwm", 0, "0000:00:02.0",
> + "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL,
> + "pwm-crc"),
> };
>
> struct crystal_cove_config {
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup
@ 2024-05-27 11:49 Hans de Goede
0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2024-05-27 11:49 UTC (permalink / raw)
To: Andy Shevchenko, Lee Jones; +Cc: Hans de Goede, Jani Nikula, linux-kernel
The primary use of the CRC PMIC's PWM is for LCD panel backlight
control by the i915 driver.
Due to its complexity the probe() function of the i915 driver does not
support -EPROBE_DEFER handling. So far the pwm-crc driver must be built
into the kernel to ensure that the pwm_get() done by the i915 driver
succeeds at once (rather then returning -EPROBE_DEFER).
But the PWM core can load the module from pwm_get() if a module-name is
provided in the pwm_lookup associated with the consumer device.
Switch to using PWM_LOOKUP_WITH_MODULE() for the lookup added for
the Intel integrated GPU, so that the PWM core can load the module from
pwm_get() as needed allowing the pwm-crc driver to be safely built as
module.
This has been successfully tested on an Asus T100TAM with pwm-crc
build as a module.
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11081
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Some small commit message tweaks
- Add Andy's Reviewed-by
---
drivers/mfd/intel_soc_pmic_crc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 581f81cbaa24..876d017f74fe 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -137,7 +137,9 @@ static const struct regmap_irq_chip crystal_cove_irq_chip = {
/* PWM consumed by the Intel GFX */
static struct pwm_lookup crc_pwm_lookup[] = {
- PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
+ PWM_LOOKUP_WITH_MODULE("crystal_cove_pwm", 0, "0000:00:02.0",
+ "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL,
+ "pwm-crc"),
};
struct crystal_cove_config {
--
2.45.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-27 11:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 11:47 [PATCH v2] mfd: intel_soc_pmic_crc: Use PWM_LOOKUP_WITH_MODULE() for the PWM lookup Hans de Goede
2024-05-27 11:49 ` Hans de Goede
2024-05-27 11:49 Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®