From: Alex Courbot <acourbot@nvidia.com>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Thierry Reding
<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>,
"linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Mark Zhang <markz-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 2/3] tegra: pwm-backlight: add tegra pwm-bl driver
Date: Tue, 22 Jan 2013 03:24:34 +0000 [thread overview]
Message-ID: <12033649.LY58cllSHv@percival> (raw)
In-Reply-To: <50FD7EF9.1010205-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On Tuesday 22 January 2013 01:46:33 Stephen Warren wrote:
> > arch/arm/boot/dts/tegra20-ventana.dts | 18 +++-
> > arch/arm/configs/tegra_defconfig | 1 +
> > drivers/video/backlight/Kconfig | 7 ++
> > drivers/video/backlight/pwm_bl.c | 3 +
> > drivers/video/backlight/pwm_bl_tegra.c | 159
> > +++++++++++++++++++++++++++++++++
> This should be at least 3 separate patches: (1) Driver code (2) Ventana
> .dts file (3) Tegra defconfig.
Will do that.
> If this is Ventana-specific, this should have a vendor prefix; "nvidia,"
> would be appropriate.
>
> But, why is this Ventana-specific; surely it's at most panel-specific,
> or perhaps even generic across any/most LCD panels?
Yes, we could use the panel model here instead. Not sure how many other panels
follow the same powering sequence though.
Making it Ventana-specific would have allowed to group all Tegra board support
into the same driver, and considering that probably not many devices use the
same panels as we do this seemed to make sense at first.
> > + power-supply = <&vdd_bl_reg>;
>
> "power" doesn't seem like a good regulator name; power to what? Is this
> for the backlight, since I see there's a panel-supply below?
>
> > + panel-supply = <&vdd_pnl_reg>;
> >
> > + bl-gpio = <&gpio 28 0>;
> > + bl-panel = <&gpio 10 0>;
>
> GPIO names usually have "gpios" in their name, so I assume those should
> be bl-enable-gpios, panel-enable-gpios?
Indeed, even though there is only one gpio here. Maybe we could group them
into a single property and retrieve them by index - that's what the DT GPIO
APIs seem to be designed for initially.
> > +static struct pwm_backlight_subdriver pwm_backlight_ventana_subdriver = {
> > + .name = "pwm-backlight-ventana",
> > + .init = init_ventana,
> > + .exit = exit_ventana,
> > + .notify = notify_ventana,
> > + .notify_after = notify_after_ventana,
> > +};
>
> It seems like all of that code should be completely generic.
Sorry, I don't get your point here - could you elaborate?
> Rather than invent some new registration mechanism, if we need
> board-/panel-/...-specific drivers, it'd be better to make each of those
> specific drivers a full platform device in an of itself (i.e. regular
> Linux platform device/driver, have its own probe(), etc.), and have
> those specific drivers call into the base PWM backlight code, treating
> it like a utility API.
That's what would make the most sense indeed, but would require some extra
changes in pwm-backlight and might go against Thierry's wish to keep it
simple. On the other hand I totally agree this would be more elegant. Every
pwm-backlight based driver would just need to invoke pwm_bl's probe/remove
function from its own. Thierry, would that be an acceptable alternative to the
sub-driver thing despite the slightly deeper changes this involves?
Thanks,
Alex.
next prev parent reply other threads:[~2013-01-22 3:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 10:30 [PATCH 0/3] pwm-backlight: add subdrivers & Tegra support Alexandre Courbot
2013-01-19 10:30 ` [PATCH 1/3] pwm-backlight: add subdriver mechanism Alexandre Courbot
2013-01-19 10:30 ` [PATCH 2/3] tegra: pwm-backlight: add tegra pwm-bl driver Alexandre Courbot
[not found] ` <1358591420-7790-3-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-21 7:35 ` Mark Zhang
2013-01-21 8:24 ` Alex Courbot
2013-01-21 8:35 ` Mark Zhang
[not found] ` <50FCEFDE.8000705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-21 8:52 ` Marc Dietrich
2013-01-21 8:55 ` Mark Zhang
2013-01-21 17:46 ` Stephen Warren
[not found] ` <50FD7EF9.1010205-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-22 3:24 ` Alex Courbot [this message]
2013-01-22 7:06 ` Thierry Reding
2013-01-23 9:45 ` Alex Courbot
2013-01-24 6:10 ` Alex Courbot
2013-01-22 16:30 ` Stephen Warren
2013-01-23 10:27 ` Leela Krishna Amudala
[not found] ` <CAL1wa8d2BS3RxdsdUyCqF20ZKe46jUZcfUKitnpP9Lgb9aB5hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-23 10:29 ` Alex Courbot
[not found] ` <1358591420-7790-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-19 10:30 ` [PATCH 3/3] tegra: ventana: of: add host1x device to DT Alexandre Courbot
2013-01-20 3:38 ` [PATCH 0/3] pwm-backlight: add subdrivers & Tegra support Mark Zhang
2013-01-20 5:26 ` Alexandre Courbot
2013-01-20 5:51 ` Mark Zhang
2013-01-21 2:09 ` Mark Zhang
[not found] ` <50FCA346.2070608-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-21 2:59 ` Mark Zhang
2013-01-21 7:49 ` Thierry Reding
[not found] ` <20130121074928.GE15508-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-21 8:18 ` Alex Courbot
2013-01-22 7:17 ` Thierry Reding
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=12033649.LY58cllSHv@percival \
--to=acourbot@nvidia.com \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=markz-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).