From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Harald Welte <laforge-4Bgg8jF3iZdg9hUCZPvPmw@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org
Subject: Re: [PATCH 7/12] neo1973: JBT6K74 LCM control interface driver
Date: Thu, 20 Dec 2007 14:31:58 -0800 [thread overview]
Message-ID: <200712201431.58932.david-b@pacbell.net> (raw)
In-Reply-To: <20071220150659.GP29882-jI4mzJ+yNOMOwssVsN95jSCwEArCW2h5@public.gmane.org>
> > Since this is a LCD controller, it should be living in the
> > drivers/video directory somewhere.
>
> Ok, no problem.
>
> > Maybe in "backlight" and depending on LCD_CLASS_DEVICE like the
> > LTV350QV code. (Which is not dissimilar to this LCM driver, although
> > that Samsung panel is much simpler.)
>
> Well, the jbt6k74 driver does many things. But backlight switching is
> not part of it :) the backlight is completely independent and machine
> dependent.
The "backlight" directory is a bit misnamed, since it also holds
the LCD_CLASS_DEVICE stuff which is just "lowlevel LCD controls".
You'll observe the LTV driver controls power and gamma just like
this JBT driver does...
Of course there aren't yet many "lowlevel LCD controls" drivers,
and this driver might suggest revisiting that class. There's one
LCD controller I know of with integral PWM contrast control, which
might help motivate relocating that class code. How about a new
"lcm" directory? :)
> > > + default:
> > > + return -1;
> >
> > Why return "-EPERM" rather than "0"? Are you trying to
> > prevent use of this driver on systems that support hibernation?
> >
>
> nope. I just didn't know what other cases there were, and since none of
> them are implemented, I thought it's better to refuse them than to claim
> we support something that was never tested.
>
> I'm now following the suggestion of pm.h, i.e. treat all cases like
> SUSPEND. Do you agree this sounds like the right thing to do?
Yes. If it's not, then most Linux device drivers are
broken, and at least this one would be compatible!
> > > +static int jbt_resume(struct spi_device *spi)
> > > +{
> > > + struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
> > > +
> > > + jbt6k74_enter_state(jbt, jbt->last_state);
> > > + jbt6k74_display_onoff(jbt, 1);
> >
> > I suspect that if the last state isn't DEEP_STANDBY this
> > should do nothing.
>
> Erm, you mean if the last state _is_ DEEP_STANDBY or SLEEP, it should do
> nothing? Thansk anyway for pointing it out, there definitely was a bug.
I just meant that in a series of resume calls (matching the series of
suspend calls that will happen with hibernation), it's probably best
to do nothing if the device isn't in a suspended state. And if the
system suspended while this device was in any kind of runtime suspend,
it should normally resume into that same runtime suspend state.
> > Remember that during hibernation, this can be called multiple times.
>
> And how would this be a problem? Sorry, I don't get it :/
Waking up a power-aware system normally shouldn't force every device
into its highest power state. I don't know how much runtime PM is
done on the systems you're working with, but I was assuming you do at
least some of it as a way to minimize battery drain.
> *************************
>
> This driver adds support for the SPI-based control interface of the LCM (LCD
> Panel) found on the FIC GTA01 hardware.
>
> The specific panel in this hardware is a TPO TD028TTEC1, but the driver should
> be able to drive any other diplay based on the JBT6K74-AS controller ASIC.
>
> Signed-off-by: Harald Welte <laforge-4Bgg8jF3iZdg9hUCZPvPmw@public.gmane.org>
Looks much better IMO. I still think that since this exposes
"low level controls" it should depend on LCD_CLASS_DEVICE, since
that's allegedly what that infrastructure is there for. But I
expect that feedback would be resolved by folk maintaining that
part of the driver stack.
Also:
> +/* frontend function */
> +int jbt6k74_enter_state(struct jbt_info *jbt, enum jbt_state new_state)
> +{
> + int rc = -EINVAL;
> +
> + ...
> + /* first transition into sleep */
> + rc = standby_to_sleep(jbt);
> + /* then transition into normal */
> + rc |= sleep_to_normal(jbt);
> + break;
> + ...
> + return rc;
> +}
This routine still has that error handling bug on most paths.
- Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2007-12-20 22:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 11:08 [PATCH 7/12] neo1973: JBT6K74 LCM control interface driver Harald Welte
[not found] ` <20071218110800.GN29882-jI4mzJ+yNOMOwssVsN95jSCwEArCW2h5@public.gmane.org>
2007-12-18 23:59 ` David Brownell
[not found] ` <20071218235954.5351225EA51-ZcXrCSuhvln6VZ3dlLfH/g4gEjPzgfUyLrfjE7I9kuVHxeISYlDBzl6hYfS7NtTn@public.gmane.org>
2007-12-19 9:57 ` Harald Welte
[not found] ` <20071219095721.GU29882-jI4mzJ+yNOMOwssVsN95jSCwEArCW2h5@public.gmane.org>
2007-12-19 20:04 ` David Brownell
2007-12-19 21:16 ` David Brownell
[not found] ` <200712191316.45435.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-12-20 15:06 ` Harald Welte
[not found] ` <20071220150659.GP29882-jI4mzJ+yNOMOwssVsN95jSCwEArCW2h5@public.gmane.org>
2007-12-20 22:31 ` David Brownell [this message]
[not found] ` <200712201431.58932.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-12-21 0:01 ` Richard Purdie
[not found] ` <1198195271.4651.52.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-12-21 9:39 ` display/lcm/backlight/framebuffer interaction (was [PATCH 7/12] neo1973: JBT6K74 LCM control interface driver) Harald Welte
[not found] ` <20071221093934.GO6625-jI4mzJ+yNOMOwssVsN95jSCwEArCW2h5@public.gmane.org>
2007-12-21 10:50 ` Richard Purdie
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=200712201431.58932.david-b@pacbell.net \
--to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
--cc=laforge-4Bgg8jF3iZdg9hUCZPvPmw@public.gmane.org \
--cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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 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.