All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: jeffy <jeffy.chen@rock-chips.com>
Cc: linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
	rjw@rjwysocki.net, dianders@chromium.org,
	dri-devel@lists.freedesktop.org, tfiga@chromium.org,
	broonie@kernel.org, Jingoo Han <jingoohan1@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm
Date: Tue, 17 Oct 2017 16:51:48 +0000	[thread overview]
Message-ID: <20171017165146.GA3408@google.com> (raw)
In-Reply-To: <59E5BBC3.2020504@rock-chips.com>

Hi,

On Tue, Oct 17, 2017 at 04:13:55PM +0800, Jeffy Chen wrote:
> On 10/17/2017 07:57 AM, Brian Norris wrote:
> >This is going to be a*lot*  of churn throughout the tree, if we expect
> >all resource consumers to do this. I think we'd want some kind of
> >agreement from the PM maintainers and (larger) subsystem owners before
> >going down this route...
> >
> >And in the PWM case, pwm_get() already has the device pointer. Why can't
> >we just instrument it instead?
> 
> according to pwm_bl driver, we may need to take care of pwm_request() too:

That's a legacy API. I wouldn't spend any time on improving it. In fact,
the only other 2 users are:
(a) drivers/input/misc/max8997_haptic.c: abandoned; nobody provides
    pdata for that driver, so pwm_request() can never be called...
(b) arch/arm/mach-s3c24xx/mach-rx1950.c: can be easily converted to
    the lookup table approach (pwm_add_table() + pwm_get()) if needed

>         pb->pwm = devm_pwm_get(&pdev->dev, NULL);
>         if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER &&
> !node) {
>                 dev_err(&pdev->dev, "unable to request PWM, trying
> legacy API\n");
>                 pb->legacy = true;
>                 pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
>         }
> 
> and maybe also *of_pwm_get...
> 
> maybe we can add a dummy pwm chip for those orphan pwms?

What? That seems like a very silly idea. And judging by Thierry's
response to your v4, he doesn't understand it either.

All I was suggesting was that you should try to add the device links in
the fewest places possible. Because if you require all consumers to add
extra boilerplate to resolve some strange corner cases, those corner
cases will likely go unsolved in many cases.

Brian

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <briannorris@chromium.org>
To: jeffy <jeffy.chen@rock-chips.com>
Cc: linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
	rjw@rjwysocki.net, dianders@chromium.org,
	dri-devel@lists.freedesktop.org, tfiga@chromium.org,
	broonie@kernel.org, Jingoo Han <jingoohan1@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm
Date: Tue, 17 Oct 2017 09:51:48 -0700	[thread overview]
Message-ID: <20171017165146.GA3408@google.com> (raw)
In-Reply-To: <59E5BBC3.2020504@rock-chips.com>

Hi,

On Tue, Oct 17, 2017 at 04:13:55PM +0800, Jeffy Chen wrote:
> On 10/17/2017 07:57 AM, Brian Norris wrote:
> >This is going to be a*lot*  of churn throughout the tree, if we expect
> >all resource consumers to do this. I think we'd want some kind of
> >agreement from the PM maintainers and (larger) subsystem owners before
> >going down this route...
> >
> >And in the PWM case, pwm_get() already has the device pointer. Why can't
> >we just instrument it instead?
> 
> according to pwm_bl driver, we may need to take care of pwm_request() too:

That's a legacy API. I wouldn't spend any time on improving it. In fact,
the only other 2 users are:
(a) drivers/input/misc/max8997_haptic.c: abandoned; nobody provides
    pdata for that driver, so pwm_request() can never be called...
(b) arch/arm/mach-s3c24xx/mach-rx1950.c: can be easily converted to
    the lookup table approach (pwm_add_table() + pwm_get()) if needed

>         pb->pwm = devm_pwm_get(&pdev->dev, NULL);
>         if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER &&
> !node) {
>                 dev_err(&pdev->dev, "unable to request PWM, trying
> legacy API\n");
>                 pb->legacy = true;
>                 pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
>         }
> 
> and maybe also *of_pwm_get...
> 
> maybe we can add a dummy pwm chip for those orphan pwms?

What? That seems like a very silly idea. And judging by Thierry's
response to your v4, he doesn't understand it either.

All I was suggesting was that you should try to add the device links in
the fewest places possible. Because if you require all consumers to add
extra boilerplate to resolve some strange corner cases, those corner
cases will likely go unsolved in many cases.

Brian
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <briannorris@chromium.org>
To: jeffy <jeffy.chen@rock-chips.com>
Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
	heiko@sntech.de, rjw@rjwysocki.net, dianders@chromium.org,
	tfiga@chromium.org, broonie@kernel.org, seanpaul@chromium.org,
	linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	dri-devel@lists.freedesktop.org,
	Jingoo Han <jingoohan1@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm
Date: Tue, 17 Oct 2017 09:51:48 -0700	[thread overview]
Message-ID: <20171017165146.GA3408@google.com> (raw)
In-Reply-To: <59E5BBC3.2020504@rock-chips.com>

Hi,

On Tue, Oct 17, 2017 at 04:13:55PM +0800, Jeffy Chen wrote:
> On 10/17/2017 07:57 AM, Brian Norris wrote:
> >This is going to be a*lot*  of churn throughout the tree, if we expect
> >all resource consumers to do this. I think we'd want some kind of
> >agreement from the PM maintainers and (larger) subsystem owners before
> >going down this route...
> >
> >And in the PWM case, pwm_get() already has the device pointer. Why can't
> >we just instrument it instead?
> 
> according to pwm_bl driver, we may need to take care of pwm_request() too:

That's a legacy API. I wouldn't spend any time on improving it. In fact,
the only other 2 users are:
(a) drivers/input/misc/max8997_haptic.c: abandoned; nobody provides
    pdata for that driver, so pwm_request() can never be called...
(b) arch/arm/mach-s3c24xx/mach-rx1950.c: can be easily converted to
    the lookup table approach (pwm_add_table() + pwm_get()) if needed

>         pb->pwm = devm_pwm_get(&pdev->dev, NULL);
>         if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER &&
> !node) {
>                 dev_err(&pdev->dev, "unable to request PWM, trying
> legacy API\n");
>                 pb->legacy = true;
>                 pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
>         }
> 
> and maybe also *of_pwm_get...
> 
> maybe we can add a dummy pwm chip for those orphan pwms?

What? That seems like a very silly idea. And judging by Thierry's
response to your v4, he doesn't understand it either.

All I was suggesting was that you should try to add the device links in
the fewest places possible. Because if you require all consumers to add
extra boilerplate to resolve some strange corner cases, those corner
cases will likely go unsolved in many cases.

Brian

  reply	other threads:[~2017-10-17 16:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 10:06 [RESEND PATCH v2 0/5] rockchip: kevin: Enable edp display Jeffy Chen
2017-10-16 10:06 ` Jeffy Chen
2017-10-16 10:06 ` Jeffy Chen
2017-10-16 10:06 ` Jeffy Chen
2017-10-16 10:06 ` [RESEND PATCH v2 1/5] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
     [not found]   ` <20171016100640.26575-2-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-10-17  1:50     ` Mark yao
2017-10-17  1:50       ` Mark yao
2017-10-17  1:50       ` Mark yao
2017-10-16 10:06 ` [RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 23:57   ` Brian Norris
2017-10-16 23:57     ` Brian Norris
2017-10-16 23:57     ` Brian Norris
2017-10-17  8:13     ` jeffy
2017-10-17  8:13       ` jeffy
2017-10-17  8:13       ` jeffy
2017-10-17 16:51       ` Brian Norris [this message]
2017-10-17 16:51         ` Brian Norris
2017-10-17 16:51         ` Brian Norris
2017-10-16 10:06 ` [RESEND PATCH v2 3/5] drm/rockchip: Fix error handling path in rockchip_dp_bind() Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 10:06 ` [RESEND PATCH v2 4/5] drm/bridge/analogix: Do not use device's drvdata Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 10:44   ` Andrzej Hajda
2017-10-16 10:44     ` Andrzej Hajda
2017-10-16 10:44     ` Andrzej Hajda
2017-10-16 10:06 ` [RESEND PATCH v2 5/5] drm/rockchip: Add device links for master and components Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen
2017-10-16 10:06   ` Jeffy Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171017165146.GA3408@google.com \
    --to=briannorris@chromium.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tfiga@chromium.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.