All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Pavel Machek <pavel@ucw.cz>
Cc: Milo Kim <Milo.Kim@ti.com>, Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCHv4 08/10] backlight: add TI LMU backlight driver
Date: Mon, 9 Apr 2018 17:54:33 +0200	[thread overview]
Message-ID: <20180409155433.zxqs2b2k2xzn6kon@earth.universe> (raw)
In-Reply-To: <20180403104908.GD6758@amd>

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

Hi,

On Tue, Apr 03, 2018 at 12:49:08PM +0200, Pavel Machek wrote:
> > +enum ti_lmu_bl_type {
> > +	TI_LMU_BL,  /* backlight userspace interface */
> > +	TI_LMU_LED, /* led userspace interface */
> > +};
> ...
> > +static int ti_lmu_bl_add_device(struct ti_lmu_bank *lmu_bank)
> > +{
> > +	switch (lmu_bank->type) {
> > +	case TI_LMU_BL:
> > +		return ti_lmu_bl_register_backlight(lmu_bank);
> > +	case TI_LMU_LED:
> > +		return ti_lmu_bl_register_led(lmu_bank);
> > +	default:
> > +		return -EINVAL;
> > +	}
> > +}
> 
> Ok, this is somehow unusual/crazy. Single driver with two
> interfaces.
> 
> Do we need the LED interface for something?
>
> If yes, I believe reasonable solution would be to always provide LED
> interface, and then have "backlight-trigger" which that would provide
> backlight interface for arbitrary LED.

Userspace expects keyboard backlight to be exposed via the LED
subsystem and display backlight via the backlight subsystem.

I considered always exposing the banks via the LED subsystem and
using a generic backlight driver. That brings its own problems,
since there is a dependency between the display and the backlight.
This is described in DT using a phandle. Getting the right backlight
device from the phandle will become very tricky with this approach.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Pavel Machek <pavel@ucw.cz>
Cc: Milo Kim <Milo.Kim@ti.com>, Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCHv4 08/10] backlight: add TI LMU backlight driver
Date: Mon, 09 Apr 2018 15:54:33 +0000	[thread overview]
Message-ID: <20180409155433.zxqs2b2k2xzn6kon@earth.universe> (raw)
In-Reply-To: <20180403104908.GD6758@amd>

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

Hi,

On Tue, Apr 03, 2018 at 12:49:08PM +0200, Pavel Machek wrote:
> > +enum ti_lmu_bl_type {
> > +	TI_LMU_BL,  /* backlight userspace interface */
> > +	TI_LMU_LED, /* led userspace interface */
> > +};
> ...
> > +static int ti_lmu_bl_add_device(struct ti_lmu_bank *lmu_bank)
> > +{
> > +	switch (lmu_bank->type) {
> > +	case TI_LMU_BL:
> > +		return ti_lmu_bl_register_backlight(lmu_bank);
> > +	case TI_LMU_LED:
> > +		return ti_lmu_bl_register_led(lmu_bank);
> > +	default:
> > +		return -EINVAL;
> > +	}
> > +}
> 
> Ok, this is somehow unusual/crazy. Single driver with two
> interfaces.
> 
> Do we need the LED interface for something?
>
> If yes, I believe reasonable solution would be to always provide LED
> interface, and then have "backlight-trigger" which that would provide
> backlight interface for arbitrary LED.

Userspace expects keyboard backlight to be exposed via the LED
subsystem and display backlight via the backlight subsystem.

I considered always exposing the banks via the LED subsystem and
using a generic backlight driver. That brings its own problems,
since there is a dependency between the display and the backlight.
This is described in DT using a phandle. Getting the right backlight
device from the phandle will become very tricky with this approach.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-04-09 15:54 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 17:24 [PATCHv4 00/10] backlight: Add TI LMU backlight driver Sebastian Reichel
2018-03-30 17:24 ` Sebastian Reichel
2018-03-30 17:24 ` [PATCHv4 01/10] mfd: ti-lmu: constify mfd_cell tables Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:20   ` Lee Jones
2018-04-16 14:20     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 02/10] mfd: ti-lmu: switch to gpiod Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:32   ` Lee Jones
2018-04-16 14:32     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 03/10] mfd: ti-lmu: use managed resource for everything Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:38   ` Lee Jones
2018-04-16 14:38     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 04/10] mfd: ti-lmu: drop of_compatible for backlight driver Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:40   ` Lee Jones
2018-04-16 14:40     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 05/10] mfd: ti-lmu: use of_device_get_match_data() helper Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:41   ` Lee Jones
2018-04-16 14:41     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 06/10] mfd: ti-lmu: add PWM support Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-03 10:48   ` Pavel Machek
2018-04-03 10:48     ` Pavel Machek
2018-04-04 19:04   ` Dan Murphy
2018-04-04 19:04     ` Dan Murphy
2018-04-04 19:04     ` Dan Murphy
2018-04-09 15:46     ` Sebastian Reichel
2018-04-09 15:46       ` Sebastian Reichel
2018-03-30 17:24 ` [PATCHv4 07/10] mfd: ti-lmu: register one backlight device per channel Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-16 14:42   ` Lee Jones
2018-04-16 14:42     ` Lee Jones
2018-03-30 17:24 ` [PATCHv4 08/10] backlight: add TI LMU backlight driver Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-03 10:49   ` Pavel Machek
2018-04-03 10:49     ` Pavel Machek
2018-04-09 15:54     ` Sebastian Reichel [this message]
2018-04-09 15:54       ` Sebastian Reichel
2018-04-10  6:38       ` Pavel Machek
2018-04-10  6:38         ` Pavel Machek
2018-04-04 14:57   ` Daniel Thompson
2018-04-04 14:57     ` Daniel Thompson
2018-04-09 16:14     ` Sebastian Reichel
2018-04-09 16:14       ` Sebastian Reichel
2018-04-04 18:30   ` Dan Murphy
2018-04-04 18:30     ` Dan Murphy
2018-04-04 18:30     ` Dan Murphy
2018-04-09 16:11     ` Sebastian Reichel
2018-04-09 16:11       ` Sebastian Reichel
2018-03-30 17:24 ` [PATCHv4 09/10] dt-bindings: mfd: ti-lmu: update for backlight Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-09 21:06   ` Rob Herring
2018-04-09 21:06     ` Rob Herring
2018-04-09 21:24     ` Sebastian Reichel
2018-04-09 21:24       ` Sebastian Reichel
2018-03-30 17:24 ` [PATCHv4 10/10] ARM: dts: omap4-droid4: update backlight led-controller Sebastian Reichel
2018-03-30 17:24   ` Sebastian Reichel
2018-04-03 10:49   ` Pavel Machek
2018-04-03 10:49     ` Pavel Machek

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=20180409155433.zxqs2b2k2xzn6kon@earth.universe \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=Milo.Kim@ti.com \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.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.