[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200321154353.GF8386@duo.ucw.cz>
Date: Sat, 21 Mar 2020 16:43:53 +0100
From: Pavel Machek <pavel@....cz>
To: Lubomir Rintel <lkundrak@...sk>
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>,
Dan Murphy <dmurphy@...com>, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org
Subject: Re: [PATCH] leds: ariel: Add driver for status LEDs on Dell Wyse 3020
Hi!
> > > +static int ariel_led_probe(struct platform_device *pdev)
> > > +{
> > > + struct device *dev = &pdev->dev;
> > > + struct ariel_led *leds;
> > > + struct regmap *ec_ram;
> > > + int ret;
> > > +
> > > + leds = devm_kcalloc(dev, 3, sizeof(*leds), GFP_KERNEL);
> > > + if (!leds)
> > > + return -ENOMEM;
> > > +
> > > + ec_ram = dev_get_regmap(dev->parent, "ec_ram");
> > > + if (!ec_ram)
> > > + return -ENODEV;
> > > +
> > > + leds[0].ec_ram = ec_ram;
> > > + leds[0].ec_index = EC_BLUE_LED;
> > > + leds[0].led_cdev.name = "ariel:blue:power",
> > > + leds[0].led_cdev.brightness_get = ariel_led_get;
> > > + leds[0].led_cdev.brightness_set = ariel_led_set;
> > > + leds[0].led_cdev.blink_set = ariel_blink_set;
> > > + leds[0].led_cdev.default_trigger = "default-on";
> >
> > Move common settings to a loop?
> >
> > Definitely delete "ariel:" prefix.
> >
> > > + leds[1].led_cdev.name = "ariel:amber:status",
> > > + leds[2].led_cdev.name = "ariel:green:status",
> >
> > Do the LEDs have some label, or some kind of common function? Calling
> > it ":status" is not too useful...
>
> No label there. This is what it looks like:
> https://people.freedesktop.org/~lkundrak/ariel-leds.jpeg
>
> The green and amber, despite being packaged separately, can be
> controlled independently (they are not connected to the same inputs in
> reverse).
>
> What does the machine do with stock firmware & ThinOS:
> * On power on, EC lights up the Amber one & Blue one
> * As soon as the firmware takes control, it turns off Amber and turns on
> Green
> * Just before passing control to the OS, firmware turns the Green LED to
> blinking
> * As soon as OS initializes, it turns Green back to always-on
>
> Therefore the functionality generally is as follows:
> * Amber is always off (only on for a short time between CPU on and
> firmware running)
> - Green blinking means "loading OS", otherwise always on when CPU is on
> - Blue is always on when the CPU is on
Ok, I guess your naming makes sense (without the ariel prefix).
Thank you,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists