RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-08 Thread Li, Yong B
Thanks Robert!

-Original Message-
From: Robert Nelson [mailto:robertcnel...@gmail.com] 
Sent: Wednesday, June 8, 2016 1:15 AM
To: Li, Yong B <yong.b...@intel.com>
Cc: Tony Lindgren <t...@atomide.com>; Benoit Cousson <bcous...@baylibre.com>; 
Rob Herring <robh...@kernel.org>; Pawel Moll <pawel.m...@arm.com>; Mark Rutland 
<mark.rutl...@arm.com>; Ian Campbell <ijc+devicet...@hellion.org.uk>; Kumar 
Gala <ga...@codeaurora.org>; Russell King <li...@arm.linux.org.uk>; 
linux-o...@vger.kernel.org; devicetree <devicet...@vger.kernel.org>; 
linux-arm-ker...@lists.infradead.org; linux kernel 
<linux-kernel@vger.kernel.org>; sdliy...@gmail.com; Pantelis Antoniou 
<pantelis.anton...@konsulko.com>
Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

On Tue, Jun 7, 2016 at 1:14 AM, Li, Yong B <yong.b...@intel.com> wrote:
> Thanks Tony.
>
> I checked the DTS/overlays using linux-yocto-4.1 kernel(Ostro OS). It seems 
> to me that the kernel/u-boot do not include the latest overlay support patch. 
> And I also tested the latest Debian 8.4 using BBB boards, the I2C1 does not 
> work too. This patch is the simplest solution for I2C1/I2C2 in 
> linux-yocto-4.1.

ps, your patch is also broken, you didn't even mux the pins, so i2c1 doesn't 
work for you anyways. ;)

pinctrl-0 = <_pins>; -> pinctrl-0 = <_pins>;

Option 1:

With the latest BBB image's, we utilize "cape_universal", thus you can enable 
I2C1 via:

root@beaglebone:~# config-pin -l P9.17
default gpio gpio_pu gpio_pd spi i2c pwm

root@beaglebone:~# config-pin -l P9.18
default gpio gpio_pu gpio_pd spi i2c pwm

root@beaglebone:~# config-pin P9.17 i2c

root@beaglebone:~# config-pin P9.18 i2c

Option 2, for the BB-I2C1 overlay:

add

cape_enable=bone_capemgr.enable_partno=BB-I2C1

Option 3, wait for Pantelis's solution... ;)

http://comments.gmane.org/gmane.linux.kernel/2234662

Regards,

--
Robert Nelson
https://rcn-ee.com/


RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-08 Thread Li, Yong B
Thanks Robert!

-Original Message-
From: Robert Nelson [mailto:robertcnel...@gmail.com] 
Sent: Wednesday, June 8, 2016 1:15 AM
To: Li, Yong B 
Cc: Tony Lindgren ; Benoit Cousson ; 
Rob Herring ; Pawel Moll ; Mark Rutland 
; Ian Campbell ; Kumar 
Gala ; Russell King ; 
linux-o...@vger.kernel.org; devicetree ; 
linux-arm-ker...@lists.infradead.org; linux kernel 
; sdliy...@gmail.com; Pantelis Antoniou 

Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

On Tue, Jun 7, 2016 at 1:14 AM, Li, Yong B  wrote:
> Thanks Tony.
>
> I checked the DTS/overlays using linux-yocto-4.1 kernel(Ostro OS). It seems 
> to me that the kernel/u-boot do not include the latest overlay support patch. 
> And I also tested the latest Debian 8.4 using BBB boards, the I2C1 does not 
> work too. This patch is the simplest solution for I2C1/I2C2 in 
> linux-yocto-4.1.

ps, your patch is also broken, you didn't even mux the pins, so i2c1 doesn't 
work for you anyways. ;)

pinctrl-0 = <_pins>; -> pinctrl-0 = <_pins>;

Option 1:

With the latest BBB image's, we utilize "cape_universal", thus you can enable 
I2C1 via:

root@beaglebone:~# config-pin -l P9.17
default gpio gpio_pu gpio_pd spi i2c pwm

root@beaglebone:~# config-pin -l P9.18
default gpio gpio_pu gpio_pd spi i2c pwm

root@beaglebone:~# config-pin P9.17 i2c

root@beaglebone:~# config-pin P9.18 i2c

Option 2, for the BB-I2C1 overlay:

add

cape_enable=bone_capemgr.enable_partno=BB-I2C1

Option 3, wait for Pantelis's solution... ;)

http://comments.gmane.org/gmane.linux.kernel/2234662

Regards,

--
Robert Nelson
https://rcn-ee.com/


RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-07 Thread Li, Yong B
Thanks Tony.

I checked the DTS/overlays using linux-yocto-4.1 kernel(Ostro OS). It seems to 
me that the kernel/u-boot do not include the latest overlay support patch. And 
I also tested the latest Debian 8.4 using BBB boards, the I2C1 does not work 
too. This patch is the simplest solution for I2C1/I2C2 in linux-yocto-4.1.

Thanks,
Yong
-Original Message-
From: Tony Lindgren [mailto:t...@atomide.com] 
Sent: Tuesday, June 7, 2016 2:00 PM
To: Li, Yong B <yong.b...@intel.com>
Cc: Robert Nelson <robertcnel...@gmail.com>; Benoit Cousson 
<bcous...@baylibre.com>; Rob Herring <robh...@kernel.org>; Pawel Moll 
<pawel.m...@arm.com>; Mark Rutland <mark.rutl...@arm.com>; Ian Campbell 
<ijc+devicet...@hellion.org.uk>; Kumar Gala <ga...@codeaurora.org>; Russell 
King <li...@arm.linux.org.uk>; linux-o...@vger.kernel.org; devicetree 
<devicet...@vger.kernel.org>; linux-arm-ker...@lists.infradead.org; linux 
kernel <linux-kernel@vger.kernel.org>; sdliy...@gmail.com
Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

* Li, Yong B <yong.b...@intel.com> [160602 22:49]:
> Hi Tony,
> 
> I can submit a V2 version about the "disabled", or just drop this patch?

Probably best to wait on this one until we know how it can be enabled without 
manually editing the dts file. I'm still hoping u-boot could enable it based on 
some environment variable..

Regards,

Tony


RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-07 Thread Li, Yong B
Thanks Tony.

I checked the DTS/overlays using linux-yocto-4.1 kernel(Ostro OS). It seems to 
me that the kernel/u-boot do not include the latest overlay support patch. And 
I also tested the latest Debian 8.4 using BBB boards, the I2C1 does not work 
too. This patch is the simplest solution for I2C1/I2C2 in linux-yocto-4.1.

Thanks,
Yong
-Original Message-
From: Tony Lindgren [mailto:t...@atomide.com] 
Sent: Tuesday, June 7, 2016 2:00 PM
To: Li, Yong B 
Cc: Robert Nelson ; Benoit Cousson 
; Rob Herring ; Pawel Moll 
; Mark Rutland ; Ian Campbell 
; Kumar Gala ; Russell 
King ; linux-o...@vger.kernel.org; devicetree 
; linux-arm-ker...@lists.infradead.org; linux 
kernel ; sdliy...@gmail.com
Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

* Li, Yong B  [160602 22:49]:
> Hi Tony,
> 
> I can submit a V2 version about the "disabled", or just drop this patch?

Probably best to wait on this one until we know how it can be enabled without 
manually editing the dts file. I'm still hoping u-boot could enable it based on 
some environment variable..

Regards,

Tony


RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-02 Thread Li, Yong B
Hi Tony,

I can submit a V2 version about the "disabled", or just drop this patch?

Thanks,
Yong
-Original Message-
From: Tony Lindgren [mailto:t...@atomide.com] 
Sent: Friday, June 3, 2016 1:57 AM
To: Robert Nelson <robertcnel...@gmail.com>
Cc: Li, Yong B <yong.b...@intel.com>; Benoit Cousson <bcous...@baylibre.com>; 
Rob Herring <robh...@kernel.org>; Pawel Moll <pawel.m...@arm.com>; Mark Rutland 
<mark.rutl...@arm.com>; Ian Campbell <ijc+devicet...@hellion.org.uk>; Kumar 
Gala <ga...@codeaurora.org>; Russell King <li...@arm.linux.org.uk>; 
linux-o...@vger.kernel.org; devicetree <devicet...@vger.kernel.org>; 
linux-arm-ker...@lists.infradead.org; linux kernel 
<linux-kernel@vger.kernel.org>; sdliy...@gmail.com
Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

* Robert Nelson <robertcnel...@gmail.com> [160602 10:48]:
> On Thu, Jun 2, 2016 at 12:39 PM, Tony Lindgren <t...@atomide.com> wrote:
> >
> > * Robert Nelson <robertcnel...@gmail.com> [160602 10:39]:
> > > On Thu, Jun 2, 2016 at 2:41 AM, Yong Li <yong.b...@intel.com> wrote:
> > >
> > > > From: Yong Li <sdliy...@gmail.com>
> > > >
> > > > Without this patch, I2C-1 is missing on beaglebone black boards
> > > >
> > > > Signed-off-by: Yong Li <sdliy...@gmail.com>
> > > > ---
> > > >  arch/arm/boot/dts/am335x-boneblack.dts | 15 +++
> > > >  1 file changed, 15 insertions(+)
> > > >
> > >
> > >
> > > This is also 'common' for the white/green, if your really going to 
> > > push this, please add it to:
> > >
> > > am335x-bone-common.dtsi
> >
> > But isn't this exposed on the cape pins? So the use can be whatever 
> > for these pins?
> 
> That is correct, "i2c1" is on the cape connector, with no primary 
> function defined.
> 
> Currently on mainline, the board and cape eeprom i2c bus's are enabled.
> 
> i2c0 = board eeprom
> i2c2 = 'cape' eeprom
> 
> personally, nak by me to add i2c1 by default, should use overlay's to enable 
> it.

Yes sounds like the best we can do is define it but set it with status = 
"disabled" for now.

Regards,

Tony


RE: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

2016-06-02 Thread Li, Yong B
Hi Tony,

I can submit a V2 version about the "disabled", or just drop this patch?

Thanks,
Yong
-Original Message-
From: Tony Lindgren [mailto:t...@atomide.com] 
Sent: Friday, June 3, 2016 1:57 AM
To: Robert Nelson 
Cc: Li, Yong B ; Benoit Cousson ; 
Rob Herring ; Pawel Moll ; Mark Rutland 
; Ian Campbell ; Kumar 
Gala ; Russell King ; 
linux-o...@vger.kernel.org; devicetree ; 
linux-arm-ker...@lists.infradead.org; linux kernel 
; sdliy...@gmail.com
Subject: Re: [PATCH] ARM: dts: am335x-boneblack: add i2c1 DT entry

* Robert Nelson  [160602 10:48]:
> On Thu, Jun 2, 2016 at 12:39 PM, Tony Lindgren  wrote:
> >
> > * Robert Nelson  [160602 10:39]:
> > > On Thu, Jun 2, 2016 at 2:41 AM, Yong Li  wrote:
> > >
> > > > From: Yong Li 
> > > >
> > > > Without this patch, I2C-1 is missing on beaglebone black boards
> > > >
> > > > Signed-off-by: Yong Li 
> > > > ---
> > > >  arch/arm/boot/dts/am335x-boneblack.dts | 15 +++
> > > >  1 file changed, 15 insertions(+)
> > > >
> > >
> > >
> > > This is also 'common' for the white/green, if your really going to 
> > > push this, please add it to:
> > >
> > > am335x-bone-common.dtsi
> >
> > But isn't this exposed on the cape pins? So the use can be whatever 
> > for these pins?
> 
> That is correct, "i2c1" is on the cape connector, with no primary 
> function defined.
> 
> Currently on mainline, the board and cape eeprom i2c bus's are enabled.
> 
> i2c0 = board eeprom
> i2c2 = 'cape' eeprom
> 
> personally, nak by me to add i2c1 by default, should use overlay's to enable 
> it.

Yes sounds like the best we can do is define it but set it with status = 
"disabled" for now.

Regards,

Tony


RE: [PATCH v2] gpio: pca953x: add PCAL9535 interrupt support for Galileo Gen2

2016-04-09 Thread Li, Yong B
Thanks Linus. I think the below patch(in fixes branch) should be merged into 
devel branch too, since the below patch is depended by this one in devel branch.

commit 9b8e3ec34318663affced3c14d960e78d760dd9a
Author: Yong Li <sdliy...@gmail.com>
Date:   Wed Mar 30 14:49:14 2016 +0800

gpio: pca953x: Use correct u16 value for register word write

The current implementation only uses the first byte in val,
the second byte is always 0. Change it to use cpu_to_le16
to write the two bytes into the register

Cc: sta...@vger.kernel.org
Signed-off-by: Yong Li <sdliy...@gmail.com>
Reviewed-by: Phil Reid <pr...@electromag.com.au>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Yong
> -Original Message-
> From: Linus Walleij [mailto:linus.wall...@linaro.org]
> Sent: Friday, April 08, 2016 21:21
> To: Li, Yong B <yong.b...@intel.com>
> Cc: linux-g...@vger.kernel.org; linux-kernel@vger.kernel.org; Alexandre
> Courbot <gnu...@gmail.com>; Andy Shevchenko
> <andriy.shevche...@linux.intel.com>; Puustinen, Ismo
> <ismo.puusti...@intel.com>; Phil Reid <pr...@electromag.com.au>
> Subject: Re: [PATCH v2] gpio: pca953x: add PCAL9535 interrupt support for
> Galileo Gen2
> 
> n Thu, Apr 7, 2016 at 6:56 AM, Yong Li <yong.b...@intel.com> wrote:
> 
> > Galileo Gen2 board uses the PCAL9535 as the GPIO expansion, it is
> > different from PCA9535 and includes interrupt mask/status registers,
> > The current driver does not support the interrupt registers
> > configuration, it causes some gpio pins cannot trigger interrupt
> > events, this patch fix this issue. The original patch was submitted by
> > Josef Ahmad <josef.ah...@linux.intel.com>
> > http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-quark/tree/recipe
> > s-kernel/linux/files/0015-Quark-GPIO-1-2-quark.patch
> >
> > Signed-off-by: Yong Li <yong.b...@intel.com>
> 
> Patch applied with Andy's review tag.
> 
> Yours,
> Linus Walleij


RE: [PATCH v2] gpio: pca953x: add PCAL9535 interrupt support for Galileo Gen2

2016-04-09 Thread Li, Yong B
Thanks Linus. I think the below patch(in fixes branch) should be merged into 
devel branch too, since the below patch is depended by this one in devel branch.

commit 9b8e3ec34318663affced3c14d960e78d760dd9a
Author: Yong Li 
Date:   Wed Mar 30 14:49:14 2016 +0800

gpio: pca953x: Use correct u16 value for register word write

The current implementation only uses the first byte in val,
the second byte is always 0. Change it to use cpu_to_le16
to write the two bytes into the register

Cc: sta...@vger.kernel.org
Signed-off-by: Yong Li 
Reviewed-by: Phil Reid 
Signed-off-by: Linus Walleij 

Yong
> -Original Message-
> From: Linus Walleij [mailto:linus.wall...@linaro.org]
> Sent: Friday, April 08, 2016 21:21
> To: Li, Yong B 
> Cc: linux-g...@vger.kernel.org; linux-kernel@vger.kernel.org; Alexandre
> Courbot ; Andy Shevchenko
> ; Puustinen, Ismo
> ; Phil Reid 
> Subject: Re: [PATCH v2] gpio: pca953x: add PCAL9535 interrupt support for
> Galileo Gen2
> 
> n Thu, Apr 7, 2016 at 6:56 AM, Yong Li  wrote:
> 
> > Galileo Gen2 board uses the PCAL9535 as the GPIO expansion, it is
> > different from PCA9535 and includes interrupt mask/status registers,
> > The current driver does not support the interrupt registers
> > configuration, it causes some gpio pins cannot trigger interrupt
> > events, this patch fix this issue. The original patch was submitted by
> > Josef Ahmad 
> > http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-quark/tree/recipe
> > s-kernel/linux/files/0015-Quark-GPIO-1-2-quark.patch
> >
> > Signed-off-by: Yong Li 
> 
> Patch applied with Andy's review tag.
> 
> Yours,
> Linus Walleij