public inbox for linux-pwm@vger.kernel.org
 help / color / mirror / Atom feed
* pwm-bl: regression on all pxa platforms
@ 2015-09-21 20:41 Robert Jarzmik
  2015-09-26 18:40 ` Robert Jarzmik
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Jarzmik @ 2015-09-21 20:41 UTC (permalink / raw)
  To: Thierry Reding, Nicolas Ferre; +Cc: linux-pwm, linux-arm-kernel

Hi Thierry,

Since a bit of time, the PWM backlight based pxa platforms are broken.
All of these platforms rely on a registering such as the one in [1].

At least I think the commit 68feaca0b13e ("backlight: pwm: Handle EPROBE_DEFER
while requesting the PWM") breaks my platforms because :
 (a) no pwm table is added (legacy platforms)
 (b) in this case, in pwm_get(), pmw_lookup_list is empty, and therefore chosen
      == NULL, and therefore pwm_get() returns NULL, and pwm_get() return
      -EPROBE_DEFER
 (c) as a consequence, this code is unreachable in pwm_bl.c :
	if (IS_ERR(pb->pwm)) {
		ret = PTR_ERR(pb->pwm);
		dev_info(&pdev->dev, "%s:%d(): %d\n", __func__, __LINE__, ret);
		if (ret == -EPROBE_DEFER)
			goto err_alloc;

		dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
		pb->legacy = true;
		pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");

Could you either revert 68feaca0b13e or find a better solution to repair the
legacy platorms please ?

Cheers.

-- 
Robert

[1] Backlight registration
static struct platform_pwm_backlight_data cm_x300_backlight_data = {
	.pwm_id		= 2,
	.max_brightness	= 100,
	.dft_brightness	= 100,
	.pwm_period_ns	= 10000,
	.enable_gpio	= -1,
};

static struct platform_device cm_x300_backlight_device = {
	.name		= "pwm-backlight",
	.dev		= {
		.parent = &pxa27x_device_pwm0.dev,
		.platform_data	= &cm_x300_backlight_data,
	},
};

static void cm_x300_init_bl(void)
{
	platform_device_register(&cm_x300_backlight_device);
}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-26 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 20:41 pwm-bl: regression on all pxa platforms Robert Jarzmik
2015-09-26 18:40 ` Robert Jarzmik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox