All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Rob Herring <robh@kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	Georgi Vlaev <gvlaev@juniper.net>,
	linux-watchdog@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	devicetree@vger.kernel.org, Frank Rowand <frowand.list@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Guenter Roeck <groeck@juniper.net>,
	linux-kernel@vger.kernel.org,
	JawaharBalaji Thirumalaisamy <jawaharb@juniper.net>,
	linux-gpio@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>,
	linux-mtd@lists.infradead.org, Debjit Ghosh <dghosh@juniper.net>,
	Rajat Jain <rajatjain@juniper.net>,
	Brian Norris <computersforpeace@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH 06/10] i2c: i2c-mux-ptxpmb-cpld: Add device tree bindings
Date: Tue, 11 Oct 2016 09:36:55 +0200	[thread overview]
Message-ID: <8a2c459d-0ead-86f1-8633-eb483fe33281@axentia.se> (raw)
In-Reply-To: <20161010174517.GA18097@rob-hp-laptop>

On 2016-10-10 19:45, Rob Herring wrote:
> On Fri, Oct 07, 2016 at 06:17:27PM +0300, Pantelis Antoniou wrote:
>> From: Georgi Vlaev <gvlaev@juniper.net>
>>
>> Add binding document for the i2c driver of PTXPMB CPLD.
>>
>> Signed-off-by: Georgi Vlaev <gvlaev@juniper.net>
>> [Ported from Juniper kernel]
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>> ---
>>  .../bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt       | 50 ++++++++++++++++++++++
>>  1 file changed, 50 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt b/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>> new file mode 100644
>> index 0000000..3b201f7
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>> @@ -0,0 +1,50 @@
>> +* Juniper PTXPMB CPLD I2C Mux
>> +
>> +I2C mux on the PTXPMB CPLD on Juniper series of routers.
>> +
>> +Required properties:
>> +
>> +  - compatible: Must contain one of the following.
>> +    "jnx,i2c-mux-ptxpmb-cpld", "jnx,i2c-mux-ngpmb-bcpld"
>> +  - num-enable: Number of muxes to enable.
> 
> No. Use status property.

Reading the code, I understand this mux to be like a combination of
i2c switches (like pca9548) where the slave i2c busses can be
enabled individually using an "enable" bitmask in one register, and
"regular" i2c muxes (like pca9547) where you can only select one
slave i2c bus at a time using an enumeration.

num-enable would be the number of switches and num-channels would be
the number of muxes per switch channel. Or the other way around? This
is a real problem. The bindings are too tightly coupled to the way
Linux currently handles i2c switches (i.e. not very well, you can only
select one slave bus on an i2c switch, thus reducing the more
flexible switch hardware to a regular mux). The bindings should not
describe what the driver does, they should describe the hardware.

Basically, you need to describe the i2c topology of the hardware in
the bindings, because I'm just guessing all this, and I shouldn't
have to.

Cheers,
Peter

>> +
>> +  The following required properties are defined externally:
>> +
>> +  - Standard I2C mux properties. See i2c-mux.txt in this directory.
>> +  - I2C child bus nodes. See i2c-mux.txt in this directory.
>> +
>> +Optional Properties:
>> +
>> +  - num-channels: Number of channels. If not present the default is 8.
> 
> What's a channel?
> 
>> +  - base-bus-num: Base bus number. If not present it is 0.
> 
> No. Linuxism and why do you care?
> 
>> +  - use-force: Use the force method of the controller.
>> +
>> +
>> +Example:
>> +
>> +cpld-i2c-mux {
> 
> mux {
> 
>> +	compatible = "jnx,i2c-mux-ptxpmb-cpld";
>> +	#address-cells = <1>;
>> +	#size-cells = <0>;
>> +
>> +	i2c-parent = <&i2c1>;
>> +
>> +	num-enable = <1>;
>> +
>> +	i2c@0 {
>> +		reg = <0>;
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +
>> +		/* PMB devices are accessed through FPC */
>> +
>> +		temp-sensor@1a { /* FPC */
>> +			compatible = "maxim,max6697";
>> +			reg = <0x1a>;
>> +			smbus-timeout-disable;
>> +			resistance-cancellation;
>> +			alert-mask = <0xff>;
>> +			over-temperature-mask = <0xff>;
>> +		};
>> +	};
>> +};
>> -- 
>> 1.9.1
>>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Peter Rosin <peda@axentia.se>
To: Rob Herring <robh@kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	Frank Rowand <frowand.list@gmail.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Wim Van Sebroeck <wim@iguana.be>,
	Guenter Roeck <linux@roeck-us.net>,
	Debjit Ghosh <dghosh@juniper.net>,
	"Georgi Vlaev" <gvlaev@juniper.net>,
	Guenter Roeck <groeck@juniper.net>,
	"JawaharBalaji Thirumalaisamy" <jawaharb@juniper.net>,
	Rajat Jain <rajatjain@juniper.net>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
	<linux-i2c@vger.kernel.org>, <linux-mtd@lists.infradead.org>,
	<linux-watchdog@vger.kernel.org>
Subject: Re: [PATCH 06/10] i2c: i2c-mux-ptxpmb-cpld: Add device tree bindings
Date: Tue, 11 Oct 2016 09:36:55 +0200	[thread overview]
Message-ID: <8a2c459d-0ead-86f1-8633-eb483fe33281@axentia.se> (raw)
In-Reply-To: <20161010174517.GA18097@rob-hp-laptop>

On 2016-10-10 19:45, Rob Herring wrote:
> On Fri, Oct 07, 2016 at 06:17:27PM +0300, Pantelis Antoniou wrote:
>> From: Georgi Vlaev <gvlaev@juniper.net>
>>
>> Add binding document for the i2c driver of PTXPMB CPLD.
>>
>> Signed-off-by: Georgi Vlaev <gvlaev@juniper.net>
>> [Ported from Juniper kernel]
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>> ---
>>  .../bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt       | 50 ++++++++++++++++++++++
>>  1 file changed, 50 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt b/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>> new file mode 100644
>> index 0000000..3b201f7
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/i2c/jnx,i2c-mux-ptxpmb-cpld.txt
>> @@ -0,0 +1,50 @@
>> +* Juniper PTXPMB CPLD I2C Mux
>> +
>> +I2C mux on the PTXPMB CPLD on Juniper series of routers.
>> +
>> +Required properties:
>> +
>> +  - compatible: Must contain one of the following.
>> +    "jnx,i2c-mux-ptxpmb-cpld", "jnx,i2c-mux-ngpmb-bcpld"
>> +  - num-enable: Number of muxes to enable.
> 
> No. Use status property.

Reading the code, I understand this mux to be like a combination of
i2c switches (like pca9548) where the slave i2c busses can be
enabled individually using an "enable" bitmask in one register, and
"regular" i2c muxes (like pca9547) where you can only select one
slave i2c bus at a time using an enumeration.

num-enable would be the number of switches and num-channels would be
the number of muxes per switch channel. Or the other way around? This
is a real problem. The bindings are too tightly coupled to the way
Linux currently handles i2c switches (i.e. not very well, you can only
select one slave bus on an i2c switch, thus reducing the more
flexible switch hardware to a regular mux). The bindings should not
describe what the driver does, they should describe the hardware.

Basically, you need to describe the i2c topology of the hardware in
the bindings, because I'm just guessing all this, and I shouldn't
have to.

Cheers,
Peter

>> +
>> +  The following required properties are defined externally:
>> +
>> +  - Standard I2C mux properties. See i2c-mux.txt in this directory.
>> +  - I2C child bus nodes. See i2c-mux.txt in this directory.
>> +
>> +Optional Properties:
>> +
>> +  - num-channels: Number of channels. If not present the default is 8.
> 
> What's a channel?
> 
>> +  - base-bus-num: Base bus number. If not present it is 0.
> 
> No. Linuxism and why do you care?
> 
>> +  - use-force: Use the force method of the controller.
>> +
>> +
>> +Example:
>> +
>> +cpld-i2c-mux {
> 
> mux {
> 
>> +	compatible = "jnx,i2c-mux-ptxpmb-cpld";
>> +	#address-cells = <1>;
>> +	#size-cells = <0>;
>> +
>> +	i2c-parent = <&i2c1>;
>> +
>> +	num-enable = <1>;
>> +
>> +	i2c@0 {
>> +		reg = <0>;
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
>> +
>> +		/* PMB devices are accessed through FPC */
>> +
>> +		temp-sensor@1a { /* FPC */
>> +			compatible = "maxim,max6697";
>> +			reg = <0x1a>;
>> +			smbus-timeout-disable;
>> +			resistance-cancellation;
>> +			alert-mask = <0xff>;
>> +			over-temperature-mask = <0xff>;
>> +		};
>> +	};
>> +};
>> -- 
>> 1.9.1
>>

  reply	other threads:[~2016-10-11  7:36 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 15:17 [PATCH 00/10] Introduce Juniper PTXPMB CPLD driver Pantelis Antoniou
2016-10-07 15:17 ` Pantelis Antoniou
2016-10-07 15:17 ` [PATCH 01/10] mfd: Juniper PTXPMB CPLD Multi-function core driver Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
2016-10-26 13:50   ` Lee Jones
2016-10-26 13:50     ` Lee Jones
2016-10-26 13:50     ` Lee Jones
2016-10-07 15:17 ` [PATCH 02/10] mfd: ptxpmb-cpld: Add documentation for PTXPMB CPLD Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
2016-10-10 17:38   ` Rob Herring
2016-10-10 17:38     ` Rob Herring
2016-10-07 15:17 ` [PATCH 03/10] watchdog: Add support for PTXPMB CPLD watchdog Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
2016-10-07 15:17 ` [PATCH 04/10] watchdog: ptxpmb-wdt: Add ptxpmb-wdt device tree bindings Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
     [not found]   ` <1475853451-22121-5-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-10-10 17:41     ` Rob Herring
2016-10-10 17:41       ` Rob Herring
2016-10-07 15:17 ` [PATCH 07/10] gpio: ptxpmb-cpld: Add support for PTXPMB CPLD's GPIO Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
     [not found]   ` <1475853451-22121-8-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-10-20 22:24     ` Linus Walleij
2016-10-20 22:24       ` Linus Walleij
2016-10-07 15:17 ` [PATCH 08/10] gpio: ptxpmb-cpld: Document bindings of PTXPMB's CPLD GPIO Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
2016-10-10 18:08   ` Rob Herring
2016-10-10 18:08     ` Rob Herring
2016-10-07 15:17 ` [PATCH 09/10] mtd: devices: Add driver for memory mapped NVRAM on FPC Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
2016-10-07 15:17 ` [PATCH 10/10] mtd: ngpmb_nvram: Add bindings for Juniper's ngpmb NVRAM Pantelis Antoniou
2016-10-07 15:17   ` Pantelis Antoniou
     [not found]   ` <1475853451-22121-11-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-10-10 18:18     ` Rob Herring
2016-10-10 18:18       ` Rob Herring
     [not found] ` <1475853451-22121-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-10-07 15:17   ` [PATCH 05/10] i2c/muxes: Juniper's PTXPMB CPLD I2C multiplexer Pantelis Antoniou
2016-10-07 15:17     ` Pantelis Antoniou
2016-10-07 15:17   ` [PATCH 06/10] i2c: i2c-mux-ptxpmb-cpld: Add device tree bindings Pantelis Antoniou
2016-10-07 15:17     ` Pantelis Antoniou
     [not found]     ` <1475853451-22121-7-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-10-10 17:45       ` Rob Herring
2016-10-10 17:45         ` Rob Herring
2016-10-11  7:36         ` Peter Rosin [this message]
2016-10-11  7:36           ` Peter Rosin
2016-10-07 23:39   ` [PATCH 00/10] Introduce Juniper PTXPMB CPLD driver Frank Rowand
2016-10-07 23:39     ` Frank Rowand
     [not found]     ` <57F8324C.2040804-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-08  2:17       ` Frank Rowand
2016-10-08  2:17         ` Frank Rowand
2016-10-20 13:42 ` Linus Walleij
2016-10-20 13:42   ` Linus Walleij
2016-10-20 13:43   ` Pantelis Antoniou
2016-10-20 13:43     ` Pantelis Antoniou

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=8a2c459d-0ead-86f1-8633-eb483fe33281@axentia.se \
    --to=peda@axentia.se \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dghosh@juniper.net \
    --cc=dwmw2@infradead.org \
    --cc=frowand.list@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=groeck@juniper.net \
    --cc=gvlaev@juniper.net \
    --cc=jawaharb@juniper.net \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=rajatjain@juniper.net \
    --cc=robh@kernel.org \
    --cc=wim@iguana.be \
    --cc=wsa@the-dreams.de \
    /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.