devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: Tomi Valkeinen <tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Cc: cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org, "R,
	Vignesh" <vigneshr-l0cyMroinI0@public.gmane.org>,
	linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux ARM
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	kaloz-p3rKhJxN3npAfugRpC6u6w@public.gmane.org,
	Matthew.Fatheree-REUqjI8E1xrQT0dZR+AlfA@public.gmane.org,
	Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCHv3 0/2] Driver for TI tlc59116 16 Channel i2c LED driver
Date: Fri, 16 Jan 2015 16:55:53 +0100	[thread overview]
Message-ID: <20150116155553.GC17658@lunn.ch> (raw)
In-Reply-To: <54B9259C.3070403-l0cyMroinI0@public.gmane.org>

On Fri, Jan 16, 2015 at 04:52:12PM +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 15/01/15 01:15, Andrew Lunn wrote:
> > This patchset is a driver for the TI tlc59116 16 Channel i2c LED
> > driver. This driver is used on the Belkin WRT1900AC access point and
> > the C code is derived from code Belkin contributed to OpenWRT.
> > However it has been extensively re-written, and a device tree binding
> > added to replace platform data.
> 
> We have a TLC59108 on one of our boards, and with a quick glance it
> looks about the same as TLC59116, except the amount of outputs. Vignesh
> wrote a driver for it and was about to send it for review.
> 
> However, Vignesh implemented it as a PWM driver. We use it for LCD
> backlight (via pwm-backlight).
> 
> I'm not very familiar with LED and PWM drivers, but doesn't implementing
> this as a LED driver prevent us from using it as a backlight? Whereas it
> looks like PWM can be used as a led via pwm-leds (I think).
> 
Hi Tomi

I've no idea about backlighting....

But the driver does fully implement brightness. So on my board:

echo 128 > /sys/class/leds/wrt1900ac\:white\:wan/brightness

will set that LED to 128/256 brightness. You have 255 steps of
brightness.

The reason i did not model it as a PWM, is that it cannot fulfil the
PWM interface. The configure interface is:

int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);

However with this device, you have no control over the period. It is
fixed, from a 97-kHz clock. All you can change is the duty as a ratio
between 0 and 256. There is the group PWM, where you do have control
over the period. But as the name implies, this PWM is shared for all
outputs, which is not what the PWM interface expects, it wants to be
able to control them individually. Also, it only has a range of 24 Hz
to 10.73 s. Again, i have no idea about backlights, but i suspect if
it is driven at 24Hz, i'm going to get a headache. 

The LED interface can be fully implemented. So that is what i have
done.

So i think modeling this as an LED driver is correct, and maybe you
need to implemented an led_bl.c driver?

	Andrew




--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-16 15:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 23:15 [PATCHv3 0/2] Driver for TI tlc59116 16 Channel i2c LED driver Andrew Lunn
2015-01-14 23:15 ` [PATCHv3 1/2] leds: tlc59116: Document binding for the TI " Andrew Lunn
2015-01-14 23:15 ` [PATCHv3 2/2] leds: tlc59116: Driver " Andrew Lunn
2015-01-16 14:52 ` [PATCHv3 0/2] Driver for TI tlc59116 " Tomi Valkeinen
     [not found]   ` <54B9259C.3070403-l0cyMroinI0@public.gmane.org>
2015-01-16 15:55     ` Andrew Lunn [this message]
2015-01-16 17:50       ` R, Vignesh
2015-01-16 19:10         ` Andrew Lunn
2015-01-16 19:17   ` Andrew Lunn
2015-01-20  9:53     ` Tomi Valkeinen
2015-01-20 13:26       ` Andrew Lunn
     [not found]         ` <20150120132613.GJ2938-g2DYL2Zd6BY@public.gmane.org>
2015-01-20 13:32           ` Tomi Valkeinen
2015-01-20 13:40             ` Andrew Lunn
2015-01-20 13:33         ` Geert Uytterhoeven

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=20150116155553.GC17658@lunn.ch \
    --to=andrew-g2dyl2zd6by@public.gmane.org \
    --cc=Matthew.Fatheree-REUqjI8E1xrQT0dZR+AlfA@public.gmane.org \
    --cc=cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kaloz-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org \
    --cc=tomi.valkeinen-l0cyMroinI0@public.gmane.org \
    --cc=vigneshr-l0cyMroinI0@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).