Skip to contentSkip to conversation

Device tree binding for Avago APDS990X light sensor

PATCH Superseded Pavel Machek 4 participants 14 messages Dec 27, 2017 – Jan 29, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Device tree binding for Avago APDS990X light sensor

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

---

Patches to convert APDS990X driver to device tree and to switch to iio are available.

Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +39 -0
new file mode 100644
index 0000000..e038146
@@ -0,0 +1,39 @@
+Avago APDS990X driver
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count
+
+Example (Nokia N9):
+
+	als_ps at 39 {
+		compatible = "avago,apds990x";
+		reg = <0x39>;
+
+		interrupt-parent = <&gpio3>;
+		interrupts = <19 10>; /* gpio_83, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW */
+
+		Vdd-supply = <&vaux1>;
+		Vled-supply = <&vbat>;
+
+		ga	= <168834>;
+		cf1	= <4096>;
+		irf1	= <7824>;
+		cf2	= <877>;
+		irf2	= <1575>;
+		df	= <52>;
+
+		pdrive	= <0x2>; /* APDS_IRLED_CURR_25mA */
+		ppcount	= <5>;
+	};
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171227/8c1a1df3/attachment.sig>
#1 lore raw

Hi Pavel,

Thanks for the patch. Please see my comments below.

Quoted 18 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

---

Patches to convert APDS990X driver to device tree and to switch to iio are available.

Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +0 -0
new file mode 100644
index 0000000..e038146

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 8

Quoted 8 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
@@ -0,0 +1,39 @@
+Avago APDS990X driver
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA

AFAIK the custom is to use lower case letters for regulator supplies.

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 16

Quoted 8 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count

Are these device specific? If so, please add the vendor prefix to them.

I might not use short abbreviations such as "df" either. I wonder what others think.

Quoted 24 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +23 -0
+
+Example (Nokia N9):
+
+	als_ps at 39 {
+		compatible = "avago,apds990x";
+		reg = <0x39>;
+
+		interrupt-parent = <&gpio3>;
+		interrupts = <19 10>; /* gpio_83, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW */
+
+		Vdd-supply = <&vaux1>;
+		Vled-supply = <&vbat>;
+
+		ga	= <168834>;
+		cf1	= <4096>;
+		irf1	= <7824>;
+		cf2	= <877>;
+		irf2	= <1575>;
+		df	= <52>;
+
+		pdrive	= <0x2>; /* APDS_IRLED_CURR_25mA */
+		ppcount	= <5>;
+	};
Signature · 4 lines
Kind regards,

Sakari Ailus
sakari.ailus at linux.intel.com
#2 lore raw

Hi Sakari,

and thank you for your input - I've added a few comments below.

Quoted 17 lines · Sakari Ailus

Hi Pavel,

Thanks for the patch. Please see my comments below.

Quoted 12 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

---

Patches to convert APDS990X driver to device tree and to switch to iio are available.

Quoted 16 lines
Quoted 6 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +0 -0
new file mode 100644
index 0000000..e038146

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 8

Quoted 8 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
@@ -0,0 +1,39 @@
+Avago APDS990X driver
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA

AFAIK the custom is to use lower case letters for regulator supplies.

I've just used the same notation as in current driver. Datasheet calls those VDD (with DD being in subscript) and LEDA. I see no problem in changing those to vdd-supply and vled-supply if no one else objects.

Quoted 11 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 16

Quoted 9 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count

Are these device specific? If so, please add the vendor prefix to them.

AFAIK yes - same as before if no one else objects, these will be changed.

Quoted 3 lines

I might not use short abbreviations such as "df" either. I wonder what others think.

These are also come from current driver - some of these comes from the datasheet itself, but not all. For example "ga" and "df" are in there (so I I would leave those alone), but "irf1" is called "B", "cf2" is called "C" and "irf2" is called "D" (I guess the missing "cf1" should be "A", but there is no such thing in the datasheet).
IMHO using some other names might just add to the confusion.

Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +16 -0
+
+Example (Nokia N9):
+
+	als_ps at 39 {
+		compatible = "avago,apds990x";
+		reg = <0x39>;
+
+		interrupt-parent = <&gpio3>;
+		interrupts = <19 10>; /* gpio_83, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW */
+
+		Vdd-supply = <&vaux1>;
+		Vled-supply = <&vbat>;
+
+		ga	= <168834>;
+		cf1	= <4096>;
+		irf1	= <7824>;
Quoted 9 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 39

Quoted 8 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +7 -0
+		cf2	= <877>;
+		irf2	= <1575>;
+		df	= <52>;
+
+		pdrive	= <0x2>; /* APDS_IRLED_CURR_25mA */
+		ppcount	= <5>;
+	};

Best regards,
Filip

#3 lore raw
Quoted 61 lines · Filip Matijevi?

Hi Sakari,

and thank you for your input - I've added a few comments below.

Quoted 17 lines · Sakari Ailus

Hi Pavel,

Thanks for the patch. Please see my comments below.

Quoted 12 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

---

Patches to convert APDS990X driver to device tree and to switch to iio are available.

Quoted 16 lines
Quoted 6 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +0 -0
new file mode 100644
index 0000000..e038146

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 8

Quoted 8 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
@@ -0,0 +1,39 @@
+Avago APDS990X driver
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA

AFAIK the custom is to use lower case letters for regulator supplies.

I've just used the same notation as in current driver. Datasheet calls those VDD (with DD being in subscript) and LEDA. I see no problem in changing those to vdd-supply and vled-supply if no one else objects.

Quoted 11 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 16

Quoted 9 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +8 -0
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count

Are these device specific? If so, please add the vendor prefix to them.

AFAIK yes - same as before if no one else objects, these will be changed.

Quoted 3 lines

I might not use short abbreviations such as "df" either. I wonder what others think.

Quoted 6 lines

These are also come from current driver - some of these comes from the datasheet itself, but not all. For example "ga" and "df" are in there (so I I would leave those alone), but "irf1" is called "B", "cf2" is called "C" and "irf2" is called "D" (I guess the missing "cf1" should be "A", but there is no such thing in the datasheet).
IMHO using some other names might just add to the confusion.

Ack, datasheet names are fine.

You could also use a single property with all device specific coefficients in a pre-defined order.

I don't have a strong opinion either way.

Signature · 4 lines
Regards,

Sakari Ailus
sakari.ailus at linux.intel.com
#4 lore raw
In reply to Sakari Ailus

Hi!

Quoted 18 lines
Quoted 6 lines

+Required properties:

+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA

AFAIK the custom is to use lower case letters for regulator supplies.

Quoted 8 lines
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count
Quoted 1 line

Are these device specific? If so, please add the vendor prefix to them.

Well, whole binding is "vendor specific". Does it make sense to add prefix in such case?

Quoted 2 lines

I might not use short abbreviations such as "df" either. I wonder what others think.

I see.

Thanks,
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171227/ff1c47f7/attachment.sig>
#5 lore raw
Quoted 20 lines · Pavel Machek

Hi!

Quoted 18 lines
Quoted 6 lines

+Required properties:

+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- Vdd-supply: power supply for VDD
+- Vled-supply: power supply for LEDA

AFAIK the custom is to use lower case letters for regulator supplies.

Quoted 8 lines
+- ga: Glass attenuation
+- cf1: Clear channel factor 1
+- irf1: IR channel factor 1
+- cf2: Clear channel factor 2
+- irf2: IR channel factor 2
+- df: Device factor
+- pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- ppcount: Proximity pulse count
Quoted 4 lines
Quoted 1 line

Are these device specific? If so, please add the vendor prefix to them.

Well, whole binding is "vendor specific". Does it make sense to add prefix in such case?

Yes, it does. If you later find one or more of these are generic, you could remove the vendor prefix. I doubt that'll happen though, these seem very device specific parameters.

Signature · 2 lines
Sakari Ailus
sakari.ailus at linux.intel.com
#6 lore raw

PATCH v2 1/1 Device tree binding for Avago APDS990X light sensor

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +41 -0
new file mode 100644
index 0000000..480c0b1
@@ -0,0 +1,41 @@
+Avago APDS990X driver
+
+https://docs.broadcom.com/docs/AV02-2867EN
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- vdd-supply: power supply for VDD
+- vled-supply: power supply for LEDA
+- avago,ga: Glass attenuation
+- avago,cf1: Clear channel factor 1
+- avago,irf1: IR channel factor 1
+- avago,cf2: Clear channel factor 2
+- avago,irf2: IR channel factor 2
+- avago,df: Device factor
+- avago,pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values
+- avago,ppcount: Proximity pulse count
+
+Example (Nokia N9):
+
+	als_ps at 39 {
+		compatible = "avago,apds990x";
+		reg = <0x39>;
+
+		interrupt-parent = <&gpio3>;
+		interrupts = <19 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)>; /* gpio_83 */
+
+		vdd-supply = <&vaux1>;
+		vled-supply = <&vbat>;
+
+		avago,ga	= <168834>;
+		avago,cf1	= <4096>;
+		avago,irf1	= <7824>;
+		avago,cf2	= <877>;
+		avago,irf2	= <1575>;
+		avago,df	= <52>;
+
+		avago,pdrive	= <0x2>; /* APDS_IRLED_CURR_25mA */
+		avago,ppcount	= <5>;
+	};
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180102/275ee9b9/attachment.sig>
maintainer
#7 lore raw
Quoted 3 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

"dt-bindings: ..." is the preferred subject prefix.

Documentation/devicetree/bindings/misc/avago-apds990x.txt

Quoted 9 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +0 -0
new file mode 100644
index 0000000..480c0b1

Put this with other light sensors whether you use IIO or not:

bindings/iio/light/

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 1

Quoted 2 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
@@ -0,0 +1,41 @@
+Avago APDS990X driver

Bindings aren't drivers.

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +10 -0
+
+https://docs.broadcom.com/docs/AV02-2867EN
+
+Required properties:
+- compatible: "avago,apds990x"
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- vdd-supply: power supply for VDD
+- vled-supply: power supply for LEDA
+- avago,ga: Glass attenuation

We already have "upisemi,glass-coef". Can we align on something common.

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 15

Quoted 4 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +4 -0
+- avago,cf1: Clear channel factor 1
+- avago,irf1: IR channel factor 1
+- avago,cf2: Clear channel factor 2
+- avago,irf2: IR channel factor 2

Perhaps 2 properties with 2 cells for factor 1 and 2.

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 16

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,df: Device factor

Units/range for all these?

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values

Don't we have standard current property for LEDs?

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 18

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,ppcount: Proximity pulse count

Is this standard for prox sensors?

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 22

Quoted 4 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +4 -0
+
+Example (Nokia N9):
+
+	als_ps at 39 {

light-sensor at 39

Quoted 23 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +19 -0
+		compatible = "avago,apds990x";
+		reg = <0x39>;
+
+		interrupt-parent = <&gpio3>;
+		interrupts = <19 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)>; /* gpio_83 */
+
+		vdd-supply = <&vaux1>;
+		vled-supply = <&vbat>;
+
+		avago,ga	= <168834>;
+		avago,cf1	= <4096>;
+		avago,irf1	= <7824>;
+		avago,cf2	= <877>;
+		avago,irf2	= <1575>;
+		avago,df	= <52>;
+
+		avago,pdrive	= <0x2>; /* APDS_IRLED_CURR_25mA */
+		avago,ppcount	= <5>;
+	};
Signature · 3 lines
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw

PATCH v3 1/1 dt-bindings: Avago APDS990X light sensor

Hi!

Quoted 5 lines
Quoted 3 lines

From: Filip Matijevi? <[email protected]>

This prepares binding for light sensor used in Nokia N9.

"dt-bindings: ..." is the preferred subject prefix.

Ok.

Quoted 5 lines
Quoted 1 line

+++ b/Documentation/devicetree/bindings/misc/avago-apds990x.txt

Put this with other light sensors whether you use IIO or not:

bindings/iio/light/

Makes sense. Patches to convert to IIO are available.

Quoted 4 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 1

Quoted 2 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
@@ -0,0 +1,41 @@
+Avago APDS990X driver

Bindings aren't drivers.

Ok.

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +4 -0
+https://docs.broadcom.com/docs/AV02-2867EN
+
+Required properties:
+- compatible: "avago,apds990x"
Quoted 8 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 11

Quoted 5 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +5 -0
+- reg: address on the I2C bus
+- interrupts: external interrupt line number
+- vdd-supply: power supply for VDD
+- vled-supply: power supply for LEDA
+- avago,ga: Glass attenuation

We already have "upisemi,glass-coef". Can we align on something common.

upisemi seems to have different units (1/1000 vs. 1/4096). Do you want me to do change to avago,glass-coef or ....?

Quoted 6 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 15

Quoted 4 lines
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +4 -0
+- avago,cf1: Clear channel factor 1
+- avago,irf1: IR channel factor 1
+- avago,cf2: Clear channel factor 2
+- avago,irf2: IR channel factor 2

Perhaps 2 properties with 2 cells for factor 1 and 2.

This is obviously easier to keep, but I can change.

Quoted 3 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 16

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,df: Device factor

Units/range for all these?

Fixed point, with 4096 == 1.00.

Quoted 3 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,pdrive: IR current, one of APDS_IRLED_CURR_XXXmA values

Don't we have standard current property for LEDs?

We do have "led-max-microamp"; which is not quite what this is. I guess we can do "led-microamp" if you prefer?

Quoted 3 lines

Documentation/devicetree/bindings/misc/avago-apds990x.txt line 18

Quoted 1 line
Documentation/devicetree/bindings/misc/avago-apds990x.txt new file +1 -0
+- avago,ppcount: Proximity pulse count

Is this standard for prox sensors?

I don't know many proximity sensors. Seems like way to raise sensitivity.

Best regards,
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180108/d1bebcf2/attachment.sig>
#9 lore raw

PATCH 1/1 dt-bindings: Nokia N9 audio support

From: Filip Matijevi? <[email protected]>

Add bindings for Nokia N9 audio components.

Documentation/devicetree/bindings/media/ti-wl1273.txt new file +36 -0
new file mode 100644
index 0000000..21db389
@@ -0,0 +1,36 @@
+Texas Instruments - wl1273 radio/bluetooth module
+
+Required properties:
+
+- compatible - "ti,wl1273-core"
+- reg - I2C slave address
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+- power-gpio       - gpio pin to power the device.
+
+- wl1273radio child - compatible = "ti,wl1273-fm-radio";
+
+Optional properties:
+
+- wl1273codec child - compatible = "ti,wl1273codec";
+
+Example:
+
+wl1273core: wl1273core at 22 {
+		compatible = "ti,wl1273-core";
+		reg = <0x22>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl1273_gpio>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
+
+		wl1273radio: wl1273radio {
+			compatible = "ti,wl1273-fm-radio";
+		};
+
+		wl1273codec: wl1273codec {
+			compatible = "ti,wl1273-codec";
+		};
+	};
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +32 -0
new file mode 100644
index 0000000..230b1eb
@@ -0,0 +1,32 @@
+* Nokia N9/N950 audio setup
+
+Required properties:
+- compatible: "nokia,n9-audio"
+
+- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
+- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
+- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
+
+- nokia,twl4030-codec: phandle for the TWL4030 codec
+- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
+- nokia,wl1273-codec: phandle for the WL1273 codec
+- nokia,headphone-amplifier: phandle for the TPA6130A2 node
+
+- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
+
+Example:
+
+sound: n9-audio {
+	compatible = "nokia,n9-audio";
+
+	nokia,twl4030-cpu-dai = <&mcbsp3>;
+	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
+	nokia,wl1273-cpu-dai = <&mcbsp4>;
+
+	nokia,twl4030-codec = <&twl4030_audio>;
+	nokia,tlv320dac33-codec = <&tlv320dac33>;
+	nokia,wl1273-codec = <&wl1273codec>;
+	nokia,headphone-amplifier = <&tpa6140a2>;
+
+	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
+};
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +39 -0
new file mode 100644
index 0000000..8e981f7
@@ -0,0 +1,39 @@
+Texas Instruments - tlv320dac33 Codec module
+
+The tlv320dac33 serial control bus communicates through I2C protocols.
+
+Required properties:
+
+- compatible - "ti,tlv320dac33"
+- reg - I2C slave address
+
+Optional properties:
+
+- power-gpio - gpio pin to power the device
+
+- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
+  in Documentation/devicetree/bindings/regulator/regulator.txt
+
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+
+- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
+- ti,burst-bclkdiv - BCLK divider value in burst mode
+
+Example:
+
+tlv320dac33: tlv320dac33 at 19 {
+	compatible = "ti,tlv320dac33";
+	reg = <0x19>;
+
+	avdd-supply = <&vaux4>;
+	dvdd-supply = <&vio>;
+	iovdd-supply = <&vio>;
+
+	interrupt-parent = <&gpio2>;
+	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
+	power-gpio = <&gpio2 28 0>; /* gpio_60 */
+
+	ti,keep-bclk;
+	ti,burst-bclkdiv = /bits/ 8 <3>;
+};
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180110/6924267f/attachment.sig>
#10 lore raw

Re: [PATCH] dt-bindings: Nokia N9 audio support

Hi Pavel,

Quoted 14 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

Add bindings for Nokia N9 audio components.

Documentation/devicetree/bindings/media/ti-wl1273.txt new file +1 -0
new file mode 100644
index 0000000..21db389
@@ -0,0 +1,36 @@
+Texas Instruments - wl1273 radio/bluetooth module

Documentation/devicetree/bindings/media/ti-wl1273.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +10 -0
+
+Required properties:
+
+- compatible - "ti,wl1273-core"
+- reg - I2C slave address
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+- power-gpio       - gpio pin to power the device.
+
+- wl1273radio child - compatible = "ti,wl1273-fm-radio";

I'd document this under a separate section, as the compatible property for the other child node.

You use "property - description" here but "property: description" in the file below. It'd be nice to be consistent, albeit it's separate files.

Documentation/devicetree/bindings/media/ti-wl1273.txt line 15

Quoted 4 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +4 -0
+
+Optional properties:
+
+- wl1273codec child - compatible = "ti,wl1273codec";

"ti,wl1273-codec"

Quoted 27 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +21 -0
+
+Example:
+
+wl1273core: wl1273core at 22 {
+		compatible = "ti,wl1273-core";
+		reg = <0x22>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl1273_gpio>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
+
+		wl1273radio: wl1273radio {
+			compatible = "ti,wl1273-fm-radio";
+		};
+
+		wl1273codec: wl1273codec {
+			compatible = "ti,wl1273-codec";
+		};
+	};
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +0 -0
new file mode 100644
index 0000000..230b1eb

Documentation/devicetree/bindings/sound/nokia,n9.txt line 2

Quoted 2 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +2 -0
@@ -0,0 +1,32 @@
+* Nokia N9/N950 audio setup
+

A small description saying what this really is would be nice.

Quoted 76 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +30 -0
+Required properties:
+- compatible: "nokia,n9-audio"
+
+- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
+- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
+- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
+
+- nokia,twl4030-codec: phandle for the TWL4030 codec
+- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
+- nokia,wl1273-codec: phandle for the WL1273 codec
+- nokia,headphone-amplifier: phandle for the TPA6130A2 node
+
+- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
+
+Example:
+
+sound: n9-audio {
+	compatible = "nokia,n9-audio";
+
+	nokia,twl4030-cpu-dai = <&mcbsp3>;
+	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
+	nokia,wl1273-cpu-dai = <&mcbsp4>;
+
+	nokia,twl4030-codec = <&twl4030_audio>;
+	nokia,tlv320dac33-codec = <&tlv320dac33>;
+	nokia,wl1273-codec = <&wl1273codec>;
+	nokia,headphone-amplifier = <&tpa6140a2>;
+
+	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
+};
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +39 -0
new file mode 100644
index 0000000..8e981f7
@@ -0,0 +1,39 @@
+Texas Instruments - tlv320dac33 Codec module
+
+The tlv320dac33 serial control bus communicates through I2C protocols.
+
+Required properties:
+
+- compatible - "ti,tlv320dac33"
+- reg - I2C slave address
+
+Optional properties:
+
+- power-gpio - gpio pin to power the device
+
+- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
+  in Documentation/devicetree/bindings/regulator/regulator.txt
+
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+
+- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
+- ti,burst-bclkdiv - BCLK divider value in burst mode
+
+Example:
+
+tlv320dac33: tlv320dac33 at 19 {
+	compatible = "ti,tlv320dac33";
+	reg = <0x19>;
+
+	avdd-supply = <&vaux4>;
+	dvdd-supply = <&vio>;
+	iovdd-supply = <&vio>;
+
+	interrupt-parent = <&gpio2>;
+	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
+	power-gpio = <&gpio2 28 0>; /* gpio_60 */
+
+	ti,keep-bclk;
+	ti,burst-bclkdiv = /bits/ 8 <3>;
+};
Signature · 4 lines
Kind regards,

Sakari Ailus
sakari.ailus at linux.intel.com
#11 lore raw

Re: [PATCH] dt-bindings: Nokia N9 audio support

Hi!

Quoted 29 lines · Pavel Machek
Quoted 14 lines

From: Filip Matijevi? <[email protected]>

Add bindings for Nokia N9 audio components.

Documentation/devicetree/bindings/media/ti-wl1273.txt new file +1 -0
new file mode 100644
index 0000000..21db389
@@ -0,0 +1,36 @@
+Texas Instruments - wl1273 radio/bluetooth module

Documentation/devicetree/bindings/media/ti-wl1273.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +10 -0
+
+Required properties:
+
+- compatible - "ti,wl1273-core"
+- reg - I2C slave address
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+- power-gpio       - gpio pin to power the device.
+
+- wl1273radio child - compatible = "ti,wl1273-fm-radio";

I'd document this under a separate section, as the compatible property for the other child node.

Quoted 3 lines

You use "property - description" here but "property: description" in the file below. It'd be nice to be consistent, albeit it's separate files.

Heh. If we want to do consistency, it should be consistent in whole documentation. I looked at cec-gpio.txt and it uses both styles. Sampled few more files, and seems ":" is more common here.

Quoted 6 lines

Documentation/devicetree/bindings/media/ti-wl1273.txt line 15

Quoted 4 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +4 -0
+
+Optional properties:
+
+- wl1273codec child - compatible = "ti,wl1273codec";

"ti,wl1273-codec"

Ok.

Quoted 10 lines

Documentation/devicetree/bindings/sound/nokia,n9.txt line 2

Quoted 8 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +2 -0
new file mode 100644
index 0000000..230b1eb
@@ -0,0 +1,32 @@
+* Nokia N9/N950 audio setup
+

A small description saying what this really is would be nice.

I'm actually not sure what to say here. Suggestions?

Thanks,
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180110/534a2a80/attachment.sig>
maintainer
#12 lore raw

Re: [PATCH] dt-bindings: Nokia N9 audio support

In reply to Pavel Machek
Quoted 13 lines · Pavel Machek

From: Filip Matijevi? <[email protected]>

Add bindings for Nokia N9 audio components.

Documentation/devicetree/bindings/media/ti-wl1273.txt new file +0 -0
new file mode 100644
index 0000000..21db389

Documentation/devicetree/bindings/media/ti-wl1273.txt line 1

Quoted 1 line
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +1 -0
@@ -0,0 +1,36 @@
+Texas Instruments - wl1273 radio/bluetooth module

bluetooth chips have a binding location: bindings/net/bluetooth.

And we already have a WL1273 binding. Plus there's the one for the Nokia BT which I think can be TI chips with a different firmware and protocol. Is this related?

Documentation/devicetree/bindings/media/ti-wl1273.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +10 -0
+
+Required properties:
+
+- compatible - "ti,wl1273-core"
+- reg - I2C slave address
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+- power-gpio       - gpio pin to power the device.
+
+- wl1273radio child - compatible = "ti,wl1273-fm-radio";

AIUI, the FM radio is accessed thru the HCI interface aka shared transport via the UART. So it is already covered by the serial device binding for TI chips.

Documentation/devicetree/bindings/media/ti-wl1273.txt line 15

Quoted 4 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +4 -0
+
+Optional properties:
+
+- wl1273codec child - compatible = "ti,wl1273codec";

This is a codec or just BT audio I2S/PCM interface?

Quoted 29 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +21 -0
+
+Example:
+
+wl1273core: wl1273core at 22 {
+		compatible = "ti,wl1273-core";
+		reg = <0x22>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl1273_gpio>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <11 2>; /* gpio_43, IRQF_TRIGGER_FALLING */
+
+		wl1273radio: wl1273radio {
+			compatible = "ti,wl1273-fm-radio";
+		};
+
+		wl1273codec: wl1273codec {
+			compatible = "ti,wl1273-codec";
+		};
+	};
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +2 -0
new file mode 100644
index 0000000..230b1eb
@@ -0,0 +1,32 @@
+* Nokia N9/N950 audio setup
+

Documentation/devicetree/bindings/sound/nokia,n9.txt line 12

Quoted 10 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +10 -0
+Required properties:
+- compatible: "nokia,n9-audio"
+
+- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
+- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
+- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
+
+- nokia,twl4030-codec: phandle for the TWL4030 codec
+- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
+- nokia,wl1273-codec: phandle for the WL1273 codec

Both dais and codecs should just be lists with a defined order.

Documentation/devicetree/bindings/sound/nokia,n9.txt line 13

Quoted 1 line
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +1 -0
+- nokia,headphone-amplifier: phandle for the TPA6130A2 node

The simple card or graph card binding don't work? At least follow them to the extent that they do work.

Quoted 27 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +19 -0
+
+- nokia,speaker-amplifier-gpios: GPIO for speaker amplifier
+
+Example:
+
+sound: n9-audio {
+	compatible = "nokia,n9-audio";
+
+	nokia,twl4030-cpu-dai = <&mcbsp3>;
+	nokia,tlv320dac33-cpu-dai = <&mcbsp2>;
+	nokia,wl1273-cpu-dai = <&mcbsp4>;
+
+	nokia,twl4030-codec = <&twl4030_audio>;
+	nokia,tlv320dac33-codec = <&tlv320dac33>;
+	nokia,wl1273-codec = <&wl1273codec>;
+	nokia,headphone-amplifier = <&tpa6140a2>;
+
+	nokia,speaker-amplifier-gpios = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
+};
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +2 -0
new file mode 100644
index 0000000..8e981f7
@@ -0,0 +1,39 @@
+Texas Instruments - tlv320dac33 Codec module
+

Documentation/devicetree/bindings/sound/tlv320dac33.txt line 12

Quoted 10 lines
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +10 -0
+The tlv320dac33 serial control bus communicates through I2C protocols.
+
+Required properties:
+
+- compatible - "ti,tlv320dac33"
+- reg - I2C slave address
+
+Optional properties:
+
+- power-gpio - gpio pin to power the device

power-gpios.

Active high or low?

Documentation/devicetree/bindings/sound/tlv320dac33.txt line 25

Quoted 13 lines
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +13 -0
+
+- avdd-supply, dvdd-supply, iovdd-supply: power supplies for the device as covered
+  in Documentation/devicetree/bindings/regulator/regulator.txt
+
+- interrupts       - The interrupt output from the device.
+- interrupt-parent - The parent interrupt controller.
+
+- ti,keep-bclk 	- Keep the BCLK running in FIFO modes
+- ti,burst-bclkdiv - BCLK divider value in burst mode
+
+Example:
+
+tlv320dac33: tlv320dac33 at 19 {

audio-codec at 19

Quoted 19 lines
Documentation/devicetree/bindings/sound/tlv320dac33.txt new file +14 -0
+	compatible = "ti,tlv320dac33";
+	reg = <0x19>;
+
+	avdd-supply = <&vaux4>;
+	dvdd-supply = <&vio>;
+	iovdd-supply = <&vio>;
+
+	interrupt-parent = <&gpio2>;
+	interrupts = <21 1>; /* gpio_53, IRQF_TRIGGER_RISING */
+	power-gpio = <&gpio2 28 0>; /* gpio_60 */
+
+	ti,keep-bclk;
+	ti,burst-bclkdiv = /bits/ 8 <3>;
+};
Signature · 3 lines
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#13 lore raw

Re: [PATCH] dt-bindings: Nokia N9 audio support

Hi!

Quoted 10 lines

Documentation/devicetree/bindings/media/ti-wl1273.txt line 1

Quoted 4 lines
Documentation/devicetree/bindings/media/ti-wl1273.txt new file +1 -0
@@ -0,0 +1,36 @@
+Texas Instruments - wl1273 radio/bluetooth module

bluetooth chips have a binding location: bindings/net/bluetooth.

And we already have a WL1273 binding. Plus there's the one for the Nokia BT which I think can be TI chips with a different firmware and protocol. Is this related?

Ok, let me investigate wl1273 (and postpone it, audio is critical, FM radio -- not so much).

Quoted 19 lines
Quoted 6 lines

index 0000000..230b1eb

Documentation/devicetree/bindings/sound/nokia,n9.txt new file +2 -0
@@ -0,0 +1,32 @@
+* Nokia N9/N950 audio setup
+

Documentation/devicetree/bindings/sound/nokia,n9.txt line 12

Quoted 10 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +10 -0
+Required properties:
+- compatible: "nokia,n9-audio"
+
+- nokia,twl4030-cpu-dai: phandle for the McBSP node connected to TWL4030
+- nokia,tlv320dac33-cpu-dai: phandle for the McBSP node connected to TLV320DAC33
+- nokia,wl1273-cpu-dai: phandle for the McBSP node connected to WL1273
+
+- nokia,twl4030-codec: phandle for the TWL4030 codec
+- nokia,tlv320dac33-codec: phandle for the TLV320DAC33 codec
+- nokia,wl1273-codec: phandle for the WL1273 codec

Both dais and codecs should just be lists with a defined order.

Quoted 4 lines

Documentation/devicetree/bindings/sound/nokia,n9.txt line 13

Quoted 1 line
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +1 -0
+- nokia,headphone-amplifier: phandle for the TPA6130A2 node

The simple card or graph card binding don't work? At least follow them to the extent that they do work.

Yep, that quite big changes for the driver... Thanks for pointers. I'm not sure what features simple card / graph card miss.

Quoted 15 lines

Documentation/devicetree/bindings/sound/nokia,n9.txt line 25

Quoted 12 lines
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +12 -0
+Texas Instruments - tlv320dac33 Codec module
+
+The tlv320dac33 serial control bus communicates through I2C protocols.
+
+Required properties:
+
+- compatible - "ti,tlv320dac33"
+- reg - I2C slave address
+
+Optional properties:
+
+- power-gpio - gpio pin to power the device

power-gpios.

Quoted 1 line

Active high or low?

Ok, this one can be fixed easily, and I guess tlv320dac33 driver might be useful for someone else, so I'll try to merge it first.

Thanks for review,

Quoted 1 line

Documentation/devicetree/bindings/sound/nokia,n9.txt line 26

Quoted 1 line
Documentation/devicetree/bindings/sound/nokia,n9.txt new file +1 -0
+	ti,burst-bclkdiv = /bits/ 8 <3>;

Oh and I'll make this plain int. No need to play with bits.

Best regards
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180129/f37f00db/attachment.sig>