All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
	Jacek Anaszewski
	<jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] leds: cpcap: new driver
Date: Tue, 7 Mar 2017 18:19:26 +0100	[thread overview]
Message-ID: <20170307171926.wscaogsrdmxc2opz@earth> (raw)
In-Reply-To: <20170306221147.GA24272@amd>

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

Hi,

On Mon, Mar 06, 2017 at 11:11:47PM +0100, Pavel Machek wrote:
> > Motorola CPCAP is a PMIC found in multiple smartphones.
> > This driver adds support for the chip's LED controllers.
> > It has explicit support for all controllers used by the
> > Droid 4. Since no datasheets are available the other
> > available controllers are not supported until somebody
> > verified, that the register layout matches.
> 
> This of course leads me to two questions:
> 
> 1) Where can I get Droid 4?

I got a used one on Ebay for 42€ incl. shipping & customs. The trick
is clicking the worldwide option, since they are pretty expensive in
EU (they only exist with US LTE modem, so they were not sold here
officially).

> 2) How well is it supported?

UART + WLAN works with mainline master branch. As written by Tony
we have a couple of patches ready for 4.12. Big open tasks are the
cameras and the modems. Cameras are handled via co-processor in the
stock system (that's about all I know about them so far) and modems are
connected via USB + GPIOs (and for the 2G/3G modem an additional UART).
LTE modem support seems simple (USB-CDC based), but does not work
in EU and 2G/3G looks like much work. Modem voice support will be
simpler than on N900, though (data goes directly to the audio codec).
Speaking about audio codec: I'm currently working on that.

> > index 000000000000..d523f8c3c358
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/cpcap-leds.txt
> > @@ -0,0 +1,29 @@
> > +Motorola CPCAP PMIC LEDs
> > +------------------------
> > +
> > +This module is part of the CPCAP. For more details about the whole
> > +chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
> > +
> > +Requires node properties:
> > +- compatible: should be one of
> > +   * "motorola,cpcap-led-mdl"		(Main Display Lighting)
> > +   * "motorola,cpcap-led-kl"		(Keyboard Lighting)
> > +   * "motorola,cpcap-led-adl"		(Aux Display Lighting)
> > +   * "motorola,cpcap-led-red"		(Red Triode)
> > +   * "motorola,cpcap-led-green"		(Green Triode)
> > +   * "motorola,cpcap-led-blue"		(Blue Triode)
> > +   * "motorola,cpcap-led-cf"		(Camera Flash)
> > +   * "motorola,cpcap-led-bt"		(Bluetooth)
> > +   * "motorola,cpcap-led-cp"		(Camera Privacy LED)
> 
> BTW. Does the RGB controller support any kind of "patterns" similar
> to what n900 can do?

No. Motorola CPCAP has simple blink support for the RGB leds, though.
It can potentially save some CPU cycles, but I did not yet add support
for that. CPCAP also has a few more LED interfaces, that are unused
on Droid 4.

> > +&cpcap {
> > +	cpcap_led_red: red-led {
> > +		compatible = "motorola,cpcap-led-red";
> > +		label = "cpcap:red";
> > +		vdd-supply = <&sw5>;
> > +	};
> > +};
> 
> This should be copied to the device tree people.

They are already in CC.

> > index 275f467956ee..043f02a4fe73 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -76,6 +76,15 @@ config LEDS_BCM6358
> >  	  This option enables support for LEDs connected to the BCM6358
> >  	  LED HW controller accessed via MMIO registers.
> >  
> > +config LEDS_CPCAP
> > +	tristate "LED Support for Motorola CPCAP"
> > +	depends on LEDS_CLASS
> > +	depends on MFD_CPCAP
> > +	depends on OF
> > +	help
> > +	  This option enables support for LEDs offered by Motorola's
> > +	  CPCAP PMIC.
> > +
> 
> Umm. That help explains exactly what I oculd tell from the name. Can
> you spell out "CPCAP" and "PMIC"... and maybe mention that it is used
> on the Droid 4 phone?

PMIC = power management integrated circuit

https://en.wikipedia.org/wiki/Power_management_integrated_circuit

CPCAP = a chip similar to TWL6040.

CPCAP it used on multiple motorola smartphones, just like TWL6040
is often used as PMIC. Usually we do not add a list of boards using
some feature to config description (except when the option is only
useful for a single one).

> > +#define DEBUG
> 
> Remove for production?

Yes, thanks.

> > +	err = device_property_read_string(&pdev->dev, "label", &led->led.name);
> > +	if (err) {
> > +		dev_err(led->dev, "Couldn't read led label: %d", err);
> 
> s/led/LED/.

ok.

> 
> > +	if (err) {
> > +		dev_err(led->dev, "Couldn't register led: %d", err);
> > +		return err;
> 
> And here.

ok.

> Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

Thanks.

-- Sebastian

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

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sre@kernel.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Tony Lindgren <tony@atomide.com>,
	Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: cpcap: new driver
Date: Tue, 7 Mar 2017 18:19:26 +0100	[thread overview]
Message-ID: <20170307171926.wscaogsrdmxc2opz@earth> (raw)
In-Reply-To: <20170306221147.GA24272@amd>

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

Hi,

On Mon, Mar 06, 2017 at 11:11:47PM +0100, Pavel Machek wrote:
> > Motorola CPCAP is a PMIC found in multiple smartphones.
> > This driver adds support for the chip's LED controllers.
> > It has explicit support for all controllers used by the
> > Droid 4. Since no datasheets are available the other
> > available controllers are not supported until somebody
> > verified, that the register layout matches.
> 
> This of course leads me to two questions:
> 
> 1) Where can I get Droid 4?

I got a used one on Ebay for 42€ incl. shipping & customs. The trick
is clicking the worldwide option, since they are pretty expensive in
EU (they only exist with US LTE modem, so they were not sold here
officially).

> 2) How well is it supported?

UART + WLAN works with mainline master branch. As written by Tony
we have a couple of patches ready for 4.12. Big open tasks are the
cameras and the modems. Cameras are handled via co-processor in the
stock system (that's about all I know about them so far) and modems are
connected via USB + GPIOs (and for the 2G/3G modem an additional UART).
LTE modem support seems simple (USB-CDC based), but does not work
in EU and 2G/3G looks like much work. Modem voice support will be
simpler than on N900, though (data goes directly to the audio codec).
Speaking about audio codec: I'm currently working on that.

> > index 000000000000..d523f8c3c358
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/cpcap-leds.txt
> > @@ -0,0 +1,29 @@
> > +Motorola CPCAP PMIC LEDs
> > +------------------------
> > +
> > +This module is part of the CPCAP. For more details about the whole
> > +chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
> > +
> > +Requires node properties:
> > +- compatible: should be one of
> > +   * "motorola,cpcap-led-mdl"		(Main Display Lighting)
> > +   * "motorola,cpcap-led-kl"		(Keyboard Lighting)
> > +   * "motorola,cpcap-led-adl"		(Aux Display Lighting)
> > +   * "motorola,cpcap-led-red"		(Red Triode)
> > +   * "motorola,cpcap-led-green"		(Green Triode)
> > +   * "motorola,cpcap-led-blue"		(Blue Triode)
> > +   * "motorola,cpcap-led-cf"		(Camera Flash)
> > +   * "motorola,cpcap-led-bt"		(Bluetooth)
> > +   * "motorola,cpcap-led-cp"		(Camera Privacy LED)
> 
> BTW. Does the RGB controller support any kind of "patterns" similar
> to what n900 can do?

No. Motorola CPCAP has simple blink support for the RGB leds, though.
It can potentially save some CPU cycles, but I did not yet add support
for that. CPCAP also has a few more LED interfaces, that are unused
on Droid 4.

> > +&cpcap {
> > +	cpcap_led_red: red-led {
> > +		compatible = "motorola,cpcap-led-red";
> > +		label = "cpcap:red";
> > +		vdd-supply = <&sw5>;
> > +	};
> > +};
> 
> This should be copied to the device tree people.

They are already in CC.

> > index 275f467956ee..043f02a4fe73 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -76,6 +76,15 @@ config LEDS_BCM6358
> >  	  This option enables support for LEDs connected to the BCM6358
> >  	  LED HW controller accessed via MMIO registers.
> >  
> > +config LEDS_CPCAP
> > +	tristate "LED Support for Motorola CPCAP"
> > +	depends on LEDS_CLASS
> > +	depends on MFD_CPCAP
> > +	depends on OF
> > +	help
> > +	  This option enables support for LEDs offered by Motorola's
> > +	  CPCAP PMIC.
> > +
> 
> Umm. That help explains exactly what I oculd tell from the name. Can
> you spell out "CPCAP" and "PMIC"... and maybe mention that it is used
> on the Droid 4 phone?

PMIC = power management integrated circuit

https://en.wikipedia.org/wiki/Power_management_integrated_circuit

CPCAP = a chip similar to TWL6040.

CPCAP it used on multiple motorola smartphones, just like TWL6040
is often used as PMIC. Usually we do not add a list of boards using
some feature to config description (except when the option is only
useful for a single one).

> > +#define DEBUG
> 
> Remove for production?

Yes, thanks.

> > +	err = device_property_read_string(&pdev->dev, "label", &led->led.name);
> > +	if (err) {
> > +		dev_err(led->dev, "Couldn't read led label: %d", err);
> 
> s/led/LED/.

ok.

> 
> > +	if (err) {
> > +		dev_err(led->dev, "Couldn't register led: %d", err);
> > +		return err;
> 
> And here.

ok.

> Acked-by: Pavel Machek <pavel@ucw.cz>

Thanks.

-- Sebastian

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

  parent reply	other threads:[~2017-03-07 17:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 17:22 [PATCH 1/2] leds: cpcap: new driver Sebastian Reichel
     [not found] ` <20170305172234.24120-1-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-03-05 17:22   ` [PATCH 2/2] ARM: dts: motorola-cpcap-mapphone: add LEDs Sebastian Reichel
2017-03-05 17:22     ` Sebastian Reichel
2017-03-06 16:11     ` Tony Lindgren
2017-03-06 21:41   ` [PATCH 1/2] leds: cpcap: new driver Jacek Anaszewski
2017-03-06 21:41     ` Jacek Anaszewski
2017-03-06 22:11 ` Pavel Machek
2017-03-06 23:38   ` Tony Lindgren
     [not found]     ` <20170306233859.GQ20572-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-03-07 11:55       ` Pavel Machek
2017-03-07 11:55         ` Pavel Machek
2017-03-07 16:26         ` Tony Lindgren
2017-03-07 16:26           ` Tony Lindgren
2017-04-11 20:20           ` Pavel Machek
2017-03-07 17:19   ` Sebastian Reichel [this message]
2017-03-07 17:19     ` Sebastian Reichel
2017-04-11 20:19     ` Pavel Machek
2017-04-11 20:19       ` 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=20170307171926.wscaogsrdmxc2opz@earth \
    --to=sre-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@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.