[linux-yocto] [PATCH] common-pc*.scc: Add igb to common-pc drivers

2017-12-06 Thread Saul Wold
The IGB driver is showing up on some general hardware (like MinnowBoard)
which is one of the Yocto Project Reference Platforms.

Signed-off-by: Saul Wold <s...@linux.intel.com>
---

Bruce, this is for 4.9 and newer.  Thanks!

 bsp/common-pc-64/common-pc-64.scc | 1 +
 bsp/common-pc/common-pc.scc   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/bsp/common-pc-64/common-pc-64.scc 
b/bsp/common-pc-64/common-pc-64.scc
index d9d41c1c..5d30c731 100644
--- a/bsp/common-pc-64/common-pc-64.scc
+++ b/bsp/common-pc-64/common-pc-64.scc
@@ -20,6 +20,7 @@ include features/usb/touchscreen-composite.scc
 include features/usb-net/usb-net.scc
 include features/intel-e1/intel-e100.scc
 include features/intel-e1/intel-e1.scc
+include features/igb/igb.scc
 include features/scsi/cdrom.scc
 
 # generic Bluetooth support
diff --git a/bsp/common-pc/common-pc.scc b/bsp/common-pc/common-pc.scc
index 384ffbad..cd947b0f 100644
--- a/bsp/common-pc/common-pc.scc
+++ b/bsp/common-pc/common-pc.scc
@@ -21,11 +21,11 @@ include features/usb/xhci-hcd.scc
 include features/usb/touchscreen-composite.scc
 
 include features/usb-net/usb-net.scc
-
 include features/intel-e1/intel-e100.scc
 include features/intel-e1/intel-e1.scc
 include features/iwlwifi/iwlwifi.scc
 include features/iwlegacy/iwlegacy.scc
+include features/igb/igb.scc
 
 include features/i915/i915.scc
 include features/drm-gma500/drm-gma500.scc
-- 
2.13.6

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [yocto] [meta-intel] meta-intel has been split into meta-dpdk and meta-intel-qat

2017-09-28 Thread Saul Wold
On Thu, 2017-09-28 at 11:32 +0800, Lai Eddy wrote:
> is this mean I don't need meta-intel anymore? (but still can be found
> in the git)
> just choose to use meta-dpdk and/or meta-intel-qat
> 
If you are building an Intel target, I would suggest you still use
meta-intel.

The DPDK and QAT are specificly breaking out software middleware that
might not be needed for all meta-intel MACHINES.

Sau!

> 2017-09-28 11:27 GMT+08:00 Saul Wold <s...@linux.intel.com>:
> > In an effort to create more consistency in Yocto Project layer, we
> > are
> > splitting the meta-intel to remove some application/libraries that
> > should really be in their own layers.
> > 
> > The new meta-dpdk will serve as a place for the Linux Foundation's
> > DPDK
> > project to host meta-data.
> > 
> > The meta-intel-qat will carry the Quick Assist Technology libraries
> > and
> > associated applications.
> > 
> > They are both hosted at https://git.yoctoproject.org
> > 
> > 
> > Sau!
> > --
> > ___
> > meta-intel mailing list
> > meta-in...@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/meta-intel
> 
> 
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] meta-intel has been split into meta-dpdk and meta-intel-qat

2017-09-27 Thread Saul Wold

In an effort to create more consistency in Yocto Project layer, we are
splitting the meta-intel to remove some application/libraries that
should really be in their own layers.  

The new meta-dpdk will serve as a place for the Linux Foundation's DPDK
project to host meta-data.

The meta-intel-qat will carry the Quick Assist Technology libraries and
associated applications.

They are both hosted at https://git.yoctoproject.org


Sau!
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[linux-yocto] [PATCH] common-pc-wifi: Enable SDIO for BroadCom BRCMFMAC

2017-07-12 Thread Saul Wold
Enable Broadcom Wifi driver for SDIO mounted hardware on Intel boards

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
Please apply to 4.9 and beyond.

 bsp/common-pc/common-pc-wifi.cfg | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bsp/common-pc/common-pc-wifi.cfg b/bsp/common-pc/common-pc-wifi.cfg
index 442aa2f..998a789 100644
--- a/bsp/common-pc/common-pc-wifi.cfg
+++ b/bsp/common-pc/common-pc-wifi.cfg
@@ -22,6 +22,9 @@ CONFIG_BRCMUTIL=m
 CONFIG_BRCMSMAC=m
 CONFIG_BRCMFMAC=m
 CONFIG_BRCMFMAC_USB=y
+CONFIG_BRCMFMAC_SDIO=y
+CONFIG_BRCMFMAC_PROTO_BCDC=y
+CONFIG_BRCMFMAC_PROTO_MSGBUF=y
 
 CONFIG_WEXT_CORE=y
 CONFIG_WEXT_PROC=y
-- 
2.7.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] base.cfg: Add POSIX_TIMERS to fix ping hang

2017-04-17 Thread Saul Wold
busybox ping was hanging after 1 loop with 4.10.x/4.11.x kernel.
ping was hanging waiting for alarm to expire.
4.10.x kernel intrdoduced new kernel config CONFIG_POSIX_TIMERS
which needs to be enabled to enable calls timer_create, settimer,
alarm etc.

Signed-off-by: Kushwaha, Priyalee <priyalee.kushw...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
Targeted for 4.10 and beyond

 ktypes/base/base.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ktypes/base/base.cfg b/ktypes/base/base.cfg
index 91a140b..062f6e3 100644
--- a/ktypes/base/base.cfg
+++ b/ktypes/base/base.cfg
@@ -23,6 +23,7 @@ CONFIG_LOCALVERSION=""
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_TIMERS=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 # CONFIG_AUDIT is not set
-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [yocto] [PATCH] i386 machine.cfg: Explicitly disable 64BIT

2017-03-30 Thread Saul Wold
On Thu, 2017-03-30 at 11:14 -0600, Leonardo Sandoval wrote:
> On Thu, 2017-03-30 at 09:56 -0700, Saul Wold wrote:
> > 
> > Since we do not set the 64 bit flags, newer kernels seem to build
> > 64bit
> > config files by default. This is due to a hard-coded uname -m check
> > that
> > selects the KBUILD_DEFCONFIG based on the host, not the cross
> > target.
> > 
> 
> 
> Saul, this is poky code, so wrong list.
> 
I am just having a bad day with email!

Sau!

> 
> 
> > 
> > Similar to e9ec769926b2378e63380bd7762ce7ce201af151 in the yocto-
> > kernel-cache repo
> > 
> > [YOCTO #11230]
> > 
> > Signed-off-by: Saul Wold <s...@linux.intel.com>
> > ---
> >  .../substrate/target/arch/i386/recipes-
> > kernel/linux/files/machine.cfg  | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-
> > kernel/linux/files/machine.cfg
> > b/scripts/lib/bsp/substrate/target/arch/i386/recipes-
> > kernel/linux/files/machine.cfg
> > index 3b168b7..fe5b882 100644
> > --- a/scripts/lib/bsp/substrate/target/arch/i386/recipes-
> > kernel/linux/files/machine.cfg
> > +++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-
> > kernel/linux/files/machine.cfg
> > @@ -1,5 +1,8 @@
> >  # yocto-bsp-filename {{=machine}}.cfg
> >  CONFIG_X86_32=y
> > +# Must explicitly disable 64BIT
> > +# CONFIG_64BIT is not set
> > +
> >  CONFIG_MATOM=y
> >  CONFIG_PRINTK=y
> >  
> > -- 
> > 2.7.4
> > 
> 
> 
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [PATCH] i386 machine.cfg: Explicitly disable 64BIT

2017-03-30 Thread Saul Wold
Since we do not set the 64 bit flags, newer kernels seem to build 64bit
config files by default. This is due to a hard-coded uname -m check that
selects the KBUILD_DEFCONFIG based on the host, not the cross target.

Similar to e9ec769926b2378e63380bd7762ce7ce201af151 in the yocto-kernel-cache 
repo

[YOCTO #11230]

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 .../substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
 
b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
index 3b168b7..fe5b882 100644
--- 
a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
+++ 
b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine.cfg
@@ -1,5 +1,8 @@
 # yocto-bsp-filename {{=machine}}.cfg
 CONFIG_X86_32=y
+# Must explicitly disable 64BIT
+# CONFIG_64BIT is not set
+
 CONFIG_MATOM=y
 CONFIG_PRINTK=y
 
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[linux-yocto] [PATCH 0/2] Clean up some cfg files

2017-03-29 Thread Saul Wold
Found this trying to debug something else. The ip_nf goes into
4.1 and newer.  The firmware one goes into 4.4 and newer.

Sau!


Saul Wold (2):
  ip_nf.cfg: clean up bad merge lines
  firmware.cfg: clean up bad merge lines

 cfg/net/ip_nf.cfg  | 5 -
 features/firmware/firmware.cfg | 6 +++---
 2 files changed, 3 insertions(+), 8 deletions(-)

-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/2] firmware.cfg: clean up bad merge lines

2017-03-29 Thread Saul Wold
The '+' dont belong here and cause warnings

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 features/firmware/firmware.cfg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/features/firmware/firmware.cfg b/features/firmware/firmware.cfg
index c8e436c..c013129 100644
--- a/features/firmware/firmware.cfg
+++ b/features/firmware/firmware.cfg
@@ -1,6 +1,6 @@
  #
  # Generic Driver Options
  #
-+CONFIG_FW_LOADER=m
-+CONFIG_FIRMWARE_IN_KERNEL=y
-+CONFIG_EXTRA_FIRMWARE=""
+CONFIG_FW_LOADER=m
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/2] ip_nf.cfg: clean up bad merge lines

2017-03-29 Thread Saul Wold
These lines don't belong in the .cfg and cause warnings during
the configme process

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 cfg/net/ip_nf.cfg | 5 -
 1 file changed, 5 deletions(-)

diff --git a/cfg/net/ip_nf.cfg b/cfg/net/ip_nf.cfg
index 3b3eed0..f43e7b2 100644
--- a/cfg/net/ip_nf.cfg
+++ b/cfg/net/ip_nf.cfg
@@ -1,8 +1,3 @@
-diff --git a/ktypes/standard/standard.cfg b/ktypes/standard/standard.cfg
-index a6a3d92..a392c7d 100644
--- a/ktypes/standard/standard.cfg
-+++ b/ktypes/standard/standard.cfg
-@@ -136,50 +136,6 @@ CONFIG_BRIDGE_NETFILTER=y
 #
 # IP: Netfilter Configuration
 #
-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] baytrail: Update DW_DMAC_PCI

2017-03-02 Thread Saul Wold
This address the following warning:

From: 
/srv/sdb/releases/master/builds/4.9/tmp/work-shared/intel-corei7-64/kernel-source/.kernel-meta/configs/standard/intel/features/soc/baytrail/baytrail.cfg
Requested value:  CONFIG_DW_DMAC_PCI=m
Actual value: CONFIG_DW_DMAC_PCI=y

Config 'DW_DMAC_PCI' has the following conditionals:
  PCI (value: y)
Dependency values are:
  PCI [y]

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 features/soc/baytrail/baytrail.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/features/soc/baytrail/baytrail.cfg 
b/features/soc/baytrail/baytrail.cfg
index 6b9ad27..ddcc9a4 100644
--- a/features/soc/baytrail/baytrail.cfg
+++ b/features/soc/baytrail/baytrail.cfg
@@ -34,7 +34,7 @@ CONFIG_I2C_I801=y
 CONFIG_SPI_PXA2XX=m
 
 CONFIG_DW_DMAC=m
-CONFIG_DW_DMAC_PCI=m
+CONFIG_DW_DMAC_PCI=y
 
 # USB Device Support
 CONFIG_USB_GADGET=y
-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[yocto] [meta-qt4 2/2] qt4e-demo-image: LICENSE is straight MIT so just use COPYING.MIT

2017-02-28 Thread Saul Wold
The OE-Core LICENSE is mostly MIT, but should not be used as a checksum
file for a purely MIT licensed package.

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 recipes-qt4/images/qt4e-demo-image.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-qt4/images/qt4e-demo-image.bb 
b/recipes-qt4/images/qt4e-demo-image.bb
index 4451848..22e1bf9 100644
--- a/recipes-qt4/images/qt4e-demo-image.bb
+++ b/recipes-qt4/images/qt4e-demo-image.bb
@@ -2,8 +2,7 @@ DESCRIPTION = "An image that will launch into the demo 
application for the embed
 LICENSE = "MIT"
 PR = "r3"
 
-LIC_FILES_CHKSUM = 
"file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = 
"file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 IMAGE_INSTALL += "\
${CORE_IMAGE_BASE_INSTALL} \
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-qt4 1/2] qt-demo-init: LICENSE is straight MIT so just use COPYING.MIT

2017-02-28 Thread Saul Wold
The OE-Core LICENSE is mostly MIT, but should not be used as a checksum
file for a purely MIT licensed package.

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 recipes-qt4/qt-demo/qt-demo-init_0.1.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-qt4/qt-demo/qt-demo-init_0.1.bb 
b/recipes-qt4/qt-demo/qt-demo-init_0.1.bb
index aa1b0b6..12b0cd9 100644
--- a/recipes-qt4/qt-demo/qt-demo-init_0.1.bb
+++ b/recipes-qt4/qt-demo/qt-demo-init_0.1.bb
@@ -3,8 +3,7 @@ LICENSE = "MIT"
 SRC_URI = "file://qtdemo-init"
 PR = "r3"
 
-LIC_FILES_CHKSUM = 
"file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
-
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LIC_FILES_CHKSUM = 
"file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 S = "${WORKDIR}"
 
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-qt4 0/2] Update LIC_FILES_CKHSUMs

2017-02-28 Thread Saul Wold
The following two recipes use the OE-Core License file in additional 
to the COPYING.MIT, these are really purely MIT so don't use the OE-Core
LICENSE file.

This was discovered when a clarification statement was added to the
OE-Core LICENSE file.

Sau!

Saul Wold (2):
  qt-demo-init: LICENSE is straight MIT so just use COPYING.MIT
  qt4e-demo-image: LICENSE is straight MIT so just use COPYING.MIT

 recipes-qt4/images/qt4e-demo-image.bb   | 3 +--
 recipes-qt4/qt-demo/qt-demo-init_0.1.bb | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Deprecating hddimg/isoimg

2016-12-20 Thread Saul Wold

Folks,

For years we have wanted to get rid of the hddimg/iso type, we now have
the WIC tool integrated into OE-Core such that we can build properly
partitioned disk images.

Historically the hddimg was a single FAT filesystem that contained
boot-loader, the kernel and a rootfs.img file for booting Intel Arch
machines. This has a 4G limit due to the FAT limitations and we are
starting to see this limit hit more frequently.

Are there any other usages out there that we are not aware of?

Any reasons that this should not get deprecated at this time?

Sau!

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Yocto Project Status WW51

2016-12-12 Thread Saul Wold

Current Dev Position: YP 2.3 M1 -> M2
Next Deadline: YP 2.3 M1 by Dec. 12, 2016 (TODAY!!)
 YP 2.3 M2 by Jan 23, 2017

SWAT team rotation: Tracy -> Alejandro
https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team

Key Status/Updates:
 * Today is the M1 feature freeze deadline. Patches are being processed with a 
view to merging. We believe all patchsets targeting M1 have been posted apart 
from tinfoil2 which is imminent and we’re planning to try and include that in 
M1.
 * We’re continuing to struggle to identify which patches are causing which 
failures which may delay M1 slightly as it is going to take time to figure this 
out and ensure builds are stable.
 * We’re considering the best way to handle containers and the current build 
appliance in the project going forwards. If anyone had input they wish to 
contribute on that subject, Brian has started a thread on the architecture 
mailing list.

Proposed upcoming dot releases:
YP 2.0.3 Release by Dec. 9, 2016
YP 2.2.1 Release by Jan. 20, 2017
YP 2.1.3 Release by May. 19, 2017

Key YP 2.3 Dates:
YP 2.3 M1 Cutoff is Dec. 12, 2016
YP 2.3 M1 Release is Dec. 23, 2016
YP 2.3 M2 Cutoff is Jan. 23, 2017
YP 2.3 M2 Release is Feb. 3, 2017
YP 2.3 M3 Cutoff is Feb 27, 2017
YP 2.3 M3 Release is Mar. 10, 2017
YP 2.3 M4 Cutoff is April 3, 2017
YP 2.3 M4 Release is April 28, 2017

Tracking Metrics:
WDD 2437 (last week 2507)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.3_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.3_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.3_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [linux-yocto] [PATCH] Backport smack patch from 4.6 to 4.4

2016-10-11 Thread Saul Wold
On Tue, 2016-10-11 at 11:58 -0400, Bruce Ashfield wrote:
> On 2016-10-11 11:51 AM, Saul Wold wrote:
> > 
> > Bruce,
> > 
> > Please merge this backported patch to 4.4, it's a backport so it
> > can go in either standard/base or standard/intel/base.  Ultimately
> > it's needed in standard/intel/bxt-rebase.
> > 
> 
> We need the upstream commit ID in the patch itself. But otherwise, it
> looks fine.
> 
Oh, forgot about that, sorry, here is the 4.6 reference, hope this is
what you want.

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.6/commit/securi
ty/smack/smack_lsm.c?h=standard/intel/base=79be093500791cc25cc31bcae
c5a4db62e21497b

Sau!

> Bruce
> 
> 
> > 
> > Thanks
> >    Sau!
> > 
> > 
> > Casey Schaufler (1):
> >   Smack: File receive for sockets
> > 
> >  security/smack/smack_lsm.c | 22 ++
> >  1 file changed, 22 insertions(+)
> > 
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] Backport smack patch from 4.6 to 4.4

2016-10-11 Thread Saul Wold
Bruce, 

Please merge this backported patch to 4.4, it's a backport so it can go in 
either standard/base or standard/intel/base.  Ultimately it's needed in 
standard/intel/bxt-rebase.

Thanks
   Sau!


Casey Schaufler (1):
  Smack: File receive for sockets

 security/smack/smack_lsm.c | 22 ++
 1 file changed, 22 insertions(+)

-- 
2.7.4

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [yocto-kernel-cache] [PATCH] bsp: leafhill: add new SoC and BSP

2016-09-02 Thread Saul Wold
On Fri, 2016-09-02 at 10:45 +0800, Rebecca Chang Swee Fun wrote:
> Add new leafhill bsp type using standard x86_64 base and re-using
> some of the intel-common config fragments. This new bsp type will
> support Intel Atom E3900 SoC family platform, named Leaf Hill and
> its derivatives.
> 
> This bsp type will fetch kernel source from intel/4.1.27/leaf-hill
> branch.
> 
> Signed-off-by: Rebecca Chang Swee Fun  om>
> ---
>  bsp/leafhill/leafhill-standard.scc |  13 
>  bsp/leafhill/leafhill.cfg  | 139
> +
>  bsp/leafhill/leafhill.scc  |  11 +++
>  3 files changed, 163 insertions(+)
>  create mode 100644 bsp/leafhill/leafhill-standard.scc
>  create mode 100644 bsp/leafhill/leafhill.cfg

For the 4.4 update, can you please break this down into smaller
features and/or including them into existing features.

A number of these configs are already in their various associated
feature cfg fragment.

Thanks
   Sau!

>  create mode 100644 bsp/leafhill/leafhill.scc
> 
> diff --git a/bsp/leafhill/leafhill-standard.scc
> b/bsp/leafhill/leafhill-standard.scc
> new file mode 100644
> index 000..8318a57
> --- /dev/null
> +++ b/bsp/leafhill/leafhill-standard.scc
> @@ -0,0 +1,13 @@
> +# leafhill-standard.scc
> +#
> +# Standard ktype for 64 bit Intel® Atom E3900 SoC.
> +#
> +
> +define KMACHINE leafhill
> +define KARCH x86_64
> +define KTYPE standard
> +
> +include ktypes/standard/standard.scc
> +include leafhill.scc
> +
> +branch intel/4.1.27/leaf-hill
> diff --git a/bsp/leafhill/leafhill.cfg b/bsp/leafhill/leafhill.cfg
> new file mode 100644
> index 000..aa0e583
> --- /dev/null
> +++ b/bsp/leafhill/leafhill.cfg
> @@ -0,0 +1,139 @@
> +# Additional EFI support
> +CONFIG_EARLY_PRINTK_EFI=y
> +CONFIG_EFI_MIXED=y
> +
> +# Audio support
> +CONFIG_SND_HDA_CORE=m
> +CONFIG_SND_HDA_INTEL=m
> +CONFIG_SND_HDA_PREALLOC_SIZE=188
> +CONFIG_SND_HDA_I915=y
> +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=3
> +CONFIG_SND_SPI=y
> +CONFIG_PCCARD=y
> +CONFIG_PCMCIA=y
> +CONFIG_SND_PCMCIA=y
> +CONFIG_SND_SOC=m
> +CONFIG_SND_SOC_I2C_AND_SPI=m
> +CONFIG_SND_USB_AUDIO=m
> +# Disable CA0132 Audio Codes support
> +# CONFIG_SND_HDA_CODEC_CA0132 is not set
> +
> +# CPU Frequency scaling
> +CONFIG_CPU_FREQ_GOV_POWERSAVE=y
> +CONFIG_CPU_FREQ_GOV_USERSPACE=y
> +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
> +
> +# EDAC Support
> +CONFIG_EDAC=y
> +CONFIG_EDAC_MM_EDAC=m
> +CONFIG_EDAC_PND2=m
> +CONFIG_EDAC_I82975X=m
> +CONFIG_EDAC_I7CORE=m
> +CONFIG_EDAC_I7300=m
> +
> +# Graphics
> +CONFIG_DRM_LOAD_EDID_FIRMWARE=y
> +# Disable DRM_CIRRUS_QEMU
> +# CONFIG_DRM_CIRRUS_QEMU is not set
> +
> +# I/O Sideband
> +CONFIG_X86_INTEL_SBI_APL=m
> +
> +# Input support
> +CONFIG_INPUT_MISC=y
> +CONFIG_INPUT_UINPUT=m
> +
> +# ISH support
> +CONFIG_INTEL_ISH_HID=m
> +CONFIG_HID_SENSOR_CUSTOM_SENSOR=m
> +CONFIG_HID_SENSOR_PRESS=m
> +CONFIG_HID_MULTITOUCH=m
> +# Disable 3D Magnetometer
> +# CONFIG_HID_SENSOR_MAGNETOMETER_3D is not set
> +
> +# Kernel Stack Protector
> +CONFIG_CC_STACKPROTECTOR_STRONG=y
> +
> +# MEI DAL support
> +CONFIG_INTEL_MEI_DAL=m
> +
> +# MII PHY Device Drivers
> +CONFIG_USB_NET_CDC_EEM=m
> +CONFIG_USB_NET_HUAWEI_CDC_NCM=m
> +CONFIG_USB_NET_CDC_MBIM=m
> +CONFIG_USB_NET_RNDIS_HOST=m
> +CONFIG_USB_IPHETH=m
> +CONFIG_USB_HSO=m
> +
> +# Piezo Beep support
> +CONFIG_INPUT_PCSPKR=m
> +CONFIG_INPUT_PWM_BEEPER=m
> +
> +# Power Management S4
> +CONFIG_HIBERNATION=y
> +
> +# SPI Device Node on Leaf Hill
> +CONFIG_APL_SPI_BRD=y
> +
> +# SPI NOR
> +CONFIG_MTD=y
> +CONFIG_MTD_SPI_NOR=y
> +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
> +CONFIG_MTD_PARTITIONED_MASTER=y
> +CONFIG_SPI_INTEL_SPI=m
> +CONFIG_SPI_INTEL_SPI_PLATFORM=m
> +
> +# TCG TPM support
> +CONFIG_TCG_TPM=m
> +CONFIG_TCG_CRB=m
> +CONFIG_TCG_TIS=m
> +CONFIG_HW_RANDOM_TPM=m
> +
> +# USB Controller support
> +# Enable dual role support
> +# CONFIG_USB_DWC3_HOST is not set
> +# CONFIG_USB_DWC3_GADGET is not set
> +CONFIG_USB_DWC3_DUAL_ROLE=y
> +
> +# USB Over Current Condition Event Notification
> +CONFIG_USB_OC_NOTIFICATION=y
> +
> +# USB Misc.
> +CONFIG_USB_ETH_RNDIS=y
> +CONFIG_USB_FUNCTIONFS_RNDIS=y
> +CONFIG_USB_TEST=m
> +CONFIG_USB_F_EEM=m
> +CONFIG_USB_F_UAC1=m
> +CONFIG_USB_CONFIGFS=m
> +CONFIG_USB_CONFIGFS_SERIAL=y
> +CONFIG_USB_CONFIGFS_ACM=y
> +CONFIG_USB_CONFIGFS_OBEX=y
> +CONFIG_USB_CONFIGFS_NCM=y
> +CONFIG_USB_CONFIGFS_ECM=y
> +CONFIG_USB_CONFIGFS_ECM_SUBSET=y
> +CONFIG_USB_CONFIGFS_RNDIS=y
> +CONFIG_USB_CONFIGFS_EEM=y
> +CONFIG_USB_CONFIGFS_MASS_STORAGE=y
> +CONFIG_USB_CONFIGFS_F_LB_SS=y
> +CONFIG_USB_CONFIGFS_F_FS=y
> +CONFIG_USB_CONFIGFS_F_UAC1=y
> +CONFIG_USB_CONFIGFS_F_UAC2=y
> +CONFIG_USB_CONFIGFS_F_MIDI=y
> +CONFIG_USB_CONFIGFS_F_HID=y
> +CONFIG_USB_CONFIGFS_F_UVC=y
> +CONFIG_USB_CONFIGFS_F_PRINTER=y
> +CONFIG_USB_ETH_EEM=y
> +CONFIG_USB_FUNCTIONFS_ETH=y
> +CONFIG_USB_FUNCTIONFS_RNDIS=y
> +CONFIG_USB_G_MULTI_CDC=y
> +
> +# USB port MUX drivers
> +CONFIG_USB_PORTMUX=y
> +CONFIG_INTEL_MUX_DRCFG=m
> +
> +# USB serial 

[yocto] Yocto Project Status WW35

2016-08-26 Thread Saul Wold

Current Dev Position: YP 2.2 M3
Next Deadline: YP 2.2 M3 which will be Aug 29th (5:00pm GMT)

SWAT team rotation: Anibal -> Tracy
https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team

Key Status/Updates:
 * The M3 deadline and feature freeze for 2.2 is on Monday. The patch queue is 
relatively low at the moment but it will likely take a few days to stablise and 
get all the patches merged. Beyond this point we will only be taking bugfixes 
for 2.2.
 * The pre-M3 build we’ve run looks good from a QA perspective so far.
 * We continue to see a significant ‘random’ autobuilder failures. Currently 
unknown/unresolved issues:
* Mips machine ‘failure to start’ despite booting the kernel: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10136
* Systemd logging failure: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10128
* Unknown ppc failure: 
https://autobuilder.yoctoproject.org/main/builders/nightly-ppc/builds/910/steps/Running%20Sanity%20Tests/logs/stdio
* gobject-introspection issues on mips-lsb and ppc-lsb from 
gstreamer1.0-plugins-bad
* Webkit gobject-introspection race over a file
These are all issue which potentially put the M3 and 2.2 final builds at risk
 * We had a good performance gain on the autobuilders by enabling kvm, now our 
oldest supported distros support it reliably. This took runtime QA testing on 
x86 from around 45 minutes down to around 3 minutes which is a significant win, 
even if its x86 only.
 * We have started testing musl world builds and also runtime x86 musl testing 
now the kvm change means the overhead is lower.

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2747  (last week 2706)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [linux-yocto] [PATCH 1/3] features: Fix dependencies and =m vs =y discrepancies for corei7

2016-08-24 Thread Saul Wold
On Fri, 2016-08-19 at 20:40 -0700, California Sullivan wrote:
> I missed these in my first pass. This should fix the remaining
> warnings
> that occur with the intel-corei7-64 configurations. The ISDN
> configurations might need to be broken out into their own feature but
> for now just enable them as dependencies for BT_CMTP.
> 
> Signed-off-by: California Sullivan 
> ---
>  features/bluetooth/bluetooth.cfg   | 7 ++-
>  features/ieee802154/ieee802154.cfg | 2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/features/bluetooth/bluetooth.cfg
> b/features/bluetooth/bluetooth.cfg
> index fefb357..67d3f52 100644
> --- a/features/bluetooth/bluetooth.cfg
> +++ b/features/bluetooth/bluetooth.cfg
> @@ -1,5 +1,10 @@
> +# Dependencies
> +CONFIG_ISDN=y
> +CONFIG_ISDN_CAPI=m
> +
> +# Features
>  CONFIG_BT=y
> -CONFIG_BT_6LOWPAN=y
> +CONFIG_BT_6LOWPAN=m
>  CONFIG_BT_RFCOMM=m
>  CONFIG_BT_RFCOMM_TTY=y
>  CONFIG_BT_BNEP=m
> diff --git a/features/ieee802154/ieee802154.cfg
> b/features/ieee802154/ieee802154.cfg
> index bd6c214..518adf0 100644
> --- a/features/ieee802154/ieee802154.cfg
> +++ b/features/ieee802154/ieee802154.cfg
> @@ -1,2 +1,2 @@
>  CONFIG_IEEE802154=y
> -CONFIG_IEEE802154_6LOWPAN=y
> +CONFIG_IEEE802154_6LOWPAN=m
> -- 

Do we also need a 6lowpan feature scc file?

Sau!

> 2.5.5
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH 1/3] features: Fix dependencies and =m vs =y discrepancies for corei7

2016-08-22 Thread Saul Wold
On Mon, 2016-08-22 at 18:33 +, Sullivan, California L wrote:
> On 08/20/2016 08:45 PM, Wold, Saul wrote:
> > 
> > On Fri, 2016-08-19 at 20:40 -0700, California Sullivan wrote:
> > > 
> > > I missed these in my first pass. This should fix the remaining
> > > warnings
> > > that occur with the intel-corei7-64 configurations. The ISDN
> > > configurations might need to be broken out into their own feature
> > > but
> > > for now just enable them as dependencies for BT_CMTP.
> > > 
> > > Signed-off-by: California Sullivan  > > om>
> > > ---
> > >  features/bluetooth/bluetooth.cfg   | 7 ++-
> > >  features/ieee802154/ieee802154.cfg | 2 +-
> > >  2 files changed, 7 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/features/bluetooth/bluetooth.cfg
> > > b/features/bluetooth/bluetooth.cfg
> > > index fefb357..67d3f52 100644
> > > --- a/features/bluetooth/bluetooth.cfg
> > > +++ b/features/bluetooth/bluetooth.cfg
> > > @@ -1,5 +1,10 @@
> > > +# Dependencies
> > > +CONFIG_ISDN=y
> > > +CONFIG_ISDN_CAPI=m
> > > +
> > > +# Features
> > >  CONFIG_BT=y
> > > -CONFIG_BT_6LOWPAN=y
> > > +CONFIG_BT_6LOWPAN=m
> > >  CONFIG_BT_RFCOMM=m
> > >  CONFIG_BT_RFCOMM_TTY=y
> > >  CONFIG_BT_BNEP=m
> > > diff --git a/features/ieee802154/ieee802154.cfg
> > > b/features/ieee802154/ieee802154.cfg
> > > index bd6c214..518adf0 100644
> > > --- a/features/ieee802154/ieee802154.cfg
> > > +++ b/features/ieee802154/ieee802154.cfg
> > > @@ -1,2 +1,2 @@
> > >  CONFIG_IEEE802154=y
> > > -CONFIG_IEEE802154_6LOWPAN=y
> > > +CONFIG_IEEE802154_6LOWPAN=m
> > > -- 
> > Do we also need a 6lowpan feature scc file?
> > 
> > Sau!
> 
> We have a 6lowpan feature. Right now its a minimal configuration to
> satisfy those two CONFIGs,  and is included in their features'
> respective .scc files. We could have those 6LOWPAN CONFIGs in the
> 6lowpan feature, but then we would need the 6lowpan feature to depend
> on
> these two features and add it everywhere one of these two features
> are
> used. I think this way is cleaner, but if you prefer it the other way
> its a simple change.
> 
Your right of course, I miss-read the above, so these are correct.

Sau!

> ---
> Cal
> 
> > 
> > 
> > > 
> > > 2.5.5
> > > 
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[yocto] Yocto Project Status WW34

2016-08-19 Thread Saul Wold


Current Dev Position: YP 2.2 M3
Next Deadline: YP 2.2 M3 which will be Aug 29th (5:00pm GMT)

SWAT team rotation: Juro -> Anibal
https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team

Key Status/Updates:
 * We’re drawing close to the M3 deadline and feature freeze for 2.2. There is 
still a significant number of features outstanding with several looking to be 
at risk at this point.
 * The bitbake multi-config build series has now merged. 
 * We’ve re-enabled prelink on x86/mips. ppc/arm was disabled whilst we 
investigated test failures but will likely be enabled since the issues are 
looking to be a binutils bug.
 * We upgraded to gcc 6.2rc1 (we will track 6.2 through to our release)
 * Uninative 1.3 was released to deal with some locale problems. This will need 
to be backported to krogoth as a 1.0.1 release of uninative.
 * Current master is going to go through a full QA pass before M3 to try and 
make sure we are dealing with all the known bugs.
 * We are starting to see significant ‘random’ autobuilder failures again:
* Mips machine ‘failure to start’ despite booting the kernel: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10136
* Systemd logging failure: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10128
* Unknown ppc failure: 
https://autobuilder.yoctoproject.org/main/builders/nightly-ppc/builds/910/steps/Running%20Sanity%20Tests/logs/stdio
* Uvesa timeout issue: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8245
* Busybox parallel make race: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10116
We need to get to grips with these as a matter of urgency as they do keep 
recurring and several occurred during our QA build, sadly. I am getting quite 
concerned about these.
 * 2.1.1 has been released, finally!
 * We will be moving to the 4.7 kernel before M3 closes, and evaluating a move 
to 4.8 in mid-September.  We will be keeping both the 4.1 (as LTSI) and 4.4 (as 
LTS) kernels.  GregKH has announced that 4.9 will be the next LTS for a Dec/Jan 
release, therefore our 4.7 (or 4.8) will be short lived kernels.

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2706  (last week 2712)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Yocto Project Status WW32

2016-08-05 Thread Saul Wold

Current Dev Position: YP 2.2 M3
Next Deadline: YP 2.2 M3 which will be Aug 29th (5:00pm GMT)

SWAT team rotation: Randy -> Leo
https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team

Key Status/Updates:
 * We decided to release M2 with known issues. We have a good handle on some of 
them, there are others which are unknown but there is no one specific cause of 
the bugs. 
 * We will run another full QA pass before M3 to try and make sure we are 
dealing with the known bugs.
 * Merging of patches continues to be slow as it is proving hard to work out 
which patches are causing which breakage. The test matrix continues to increase 
with people being upset if their personal favourite set of options breaks yet 
we can’t expect to test and catch every regression. We’re not sure what to do 
about this, the scope of the testing is greater than it ever has been but it 
does seem to be slowing things down.
 * A patch for performance issues with pseudo when using xattrs have was merged
 * 2.1.1 is currently in QA and is expected to be completed early next week, 
this update contains numerous fixes for for a variety of areas including CVEs, 
GCC 6.x on Host OS and updated SRC_URIs

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2714 (last week 2744)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [GIT PULL | BXT-REBASE] USB Perihperal RTPM fixes

2016-08-04 Thread Saul Wold

These requests need to go to the linux-yo...@yoctoproject.org list.
 This is part of the open source process and needs to be followed for
transparency.

Sending it to me or directly to Bruce will not work.

Also, please understand that Bruce is on vacation this week, he will
merge things time permitting, but his gmail email must also be CC'ed
otherwise he may not see it. (bruce.ashfi...@gmail.com).


Sau!


On Thu, 2016-08-04 at 07:37 -0700, Kumar, Anil K wrote:
> + Saul
> 
> Anil K Kumar, PhD
> Principal Engineer
> Lead System Architect
> Makers & Innovators Group (MIG) / New Technology Group (NTG)
> 
> 
> -Original Message-
> From: Felipe Balbi [mailto:felipe.ba...@linux.intel.com] 
> Sent: Thursday, August 4, 2016 4:34 AM
> To: Ashfield, Bruce (Wind River) 
> Cc: Kumar, Anil K ; Renganathan, Prabu  .renganat...@intel.com>; Svahn, Kai ; Ponnusamy,
> Siva Prasath ; Hart, Patrick J  rick.j.h...@intel.com>; Leblanc, Darrell ;
> yocto@yoctoproject.org
> Subject: [GIT PULL | BXT-REBASE] USB Perihperal RTPM fixes
> 
> 
> Hi Bruce,
> 
> please pull following branch and apply on top of bxt-rebase. It fixes
> a few issues with runtime PM with drivers/usb/dwc3/
> 
> Best
> 
> The following changes since commit
> 17a1643e70318316c4cd275d1c1f252d0a97f46f:
> 
>   Merge branch 'standard/intel/base' into standard/intel/bxt-rebase
> (2016-07-25 23:56:53 -0400)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git bxt-
> testing-pm
> 
> for you to fetch changes up to
> fea0e55419272d6185c1d19a1a5b89e0545cbc39:
> 
>   usb: dwc3: pci: call _DSM for suspend/resume (2016-08-04 09:35:44
> +0300)
> 
> 
> Felipe Balbi (5):
>   usb: dwc3: pci: runtime_resume child device
>   usb: dwc3: core: allow device to runtime_suspend several times
>   usb: dwc3: gadget: increment request->actual once
>   usb: dwc3: make sure UX_EXIT_PX is cleared
>   usb: dwc3: pci: call _DSM for suspend/resume
> 
>  drivers/usb/dwc3/core.c |   7 +++
>  drivers/usb/dwc3/core.h |   1 +
>  drivers/usb/dwc3/dwc3-pci.c | 105
> +---
>  drivers/usb/dwc3/gadget.c   |  19 
>  4 files changed, 107 insertions(+), 25 deletions(-)
> 
> 
> --
> balbi
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Yocto Project Status WW31

2016-07-29 Thread Saul Wold

Current Dev Position: YP 2.2 M3
Next Deadline: YP 2.2 M3 which will be Aug 29th (5:00pm GMT)

SWAT team rotation: Ross -> Randy
https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team

Key Status/Updates:
 * This status covers two weeks
 * We did get an M2 build into QA, it took some time to stabilize due to the 
shear number of errors we ran into coming from submitted patches, particularly 
from oe-selftest which takes a long time to run.
 * A performance regressing in the printk kernel feature was identified, 
proving the value in monitoring these things, wish we had more eyes on it 
though.
 * The M2 QA report is out. Unfortunately there are a substantial number of 
bugs being reported against M2. There is no common theme, bugs in many aspects 
of the system. We’re undecided whether to release it as is, try an rc2 with 
bugs fixed on a branch or try an rc2 with current master which does address 
some of the issues.
 * 
https://wiki.yoctoproject.org/wiki/WW30_-_2016-07-21_-_Full_Test_Cycle_2.2_M2.rc1
 * We’ve decided to remove uclibc.
 * Performance issues with pseudo when using xattrs have been identified and 
are in testing.
 * 2.1.1 has gcc6 fixes merged. We have some checkuri fixes pending, then will 
run a 2.1.1 rc2 build.

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2744 (last week 2698)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[linux-yocto] [PATCH] drivers/mfd/pca9685-pwm.c: Update to reflect changes in patches from upstream

2016-07-21 Thread Saul Wold
There are some patches brought into to 4.4 from upstream that change
the pwm structure and move period and duty_cycle into a state structure
so fix these up. Additional address the removal of PWMF_ENABLED in favor
checking the state via pwm_is_enabled().

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/mfd/pca9685-pwm.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/pca9685-pwm.c b/drivers/mfd/pca9685-pwm.c
index 0c05263..3a79c33 100644
--- a/drivers/mfd/pca9685-pwm.c
+++ b/drivers/mfd/pca9685-pwm.c
@@ -80,16 +80,16 @@ int pca9685_update_prescale(struct pca9685 *pca, unsigned 
period_ns,
if (reconfigure_channels) {
for (i = 0; i < pca->pwm_chip.npwm; i++) {
pwm = >pwm_chip.pwms[i];
-   pwm->period = period_ns;
-   if (pwm->duty_cycle > 0) {
+   pwm->state.period = period_ns;
+   if (pwm->state.duty_cycle > 0) {
/* Scale the rise time to maintain duty cycle */
duty_scale = period_ns;
duty_scale *= 100;
do_div(duty_scale, pca->pwm_period);
-   new_duty_ns = duty_scale * pwm->duty_cycle;
+   new_duty_ns = duty_scale * 
pwm->state.duty_cycle;
do_div(new_duty_ns, 100);
/* Update the duty_cycle */
-   pwm_config(pwm, (int)new_duty_ns, pwm->period);
+   pwm_config(pwm, (int)new_duty_ns, 
pwm->state.period);
}
}
}
@@ -159,7 +159,7 @@ static int pca9685_pwm_config(struct pwm_chip *chip, struct 
pwm_device *pwm,
/* Changing PWM period for a single channel at run-time not allowed.
 * The PCA9685 PWM clock is shared across all PWM channels
 */
-   if (unlikely(period_ns != pwm->period))
+   if (unlikely(period_ns != pwm->state.period))
return -EPERM;
 
if (unlikely(pwm->hwpwm >= PCA9685_MAXCHAN)) {
@@ -180,7 +180,7 @@ static int pca9685_pwm_config(struct pwm_chip *chip, struct 
pwm_device *pwm,
else /* clear the LED_FULL bit */
regmap_write(pca->regmap, reg_on_h, 0x00);
 
-   full_off = !test_bit(PWMF_ENABLED, >flags) << 4;
+   full_off = !pwm_is_enabled(pwm);
 
regmap_write(pca->regmap, reg_off_l, (int)duty & 0xff);
 
@@ -246,7 +246,7 @@ static int pca9685_pwm_request(struct pwm_chip *chip, 
struct pwm_device *pwm)
(gpiochip_is_requested(gpio_chip, channel)))
return -EBUSY;
 
-   pwm->period = pca->pwm_period;
+   pwm->state.period = pca->pwm_period;
 
return 0;
 }
-- 
2.5.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH] features/powertop: To provide wakeup/seconds events

2016-07-21 Thread Saul Wold
On Wed, 2016-07-20 at 16:20 -0700, Nilesh Bacchewar wrote:
> 
> for powertop to provide wakeup/seconds events
> 
> Signed-off-by: Nilesh Bacchewar 
> ---
>  features/powertop/powertop.cfg   | 5 +
>  features/soc/broxton/broxton.scc | 2 ++
>  2 files changed, 7 insertions(+)
>  create mode 100644 features/powertop/powertop.cfg
> 
> diff --git a/features/powertop/powertop.cfg
> b/features/powertop/powertop.cfg
> new file mode 100644
> index 000..922a731
> --- /dev/null
> +++ b/features/powertop/powertop.cfg
> @@ -0,0 +1,5 @@
> +# make debugging options available
> +CONFIG_DEBUG_KERNEL=y
> +
I thought that the Ostro team did not want DEBUG_KERNEL enabled, I
realize that it might be required for TIMER_STATS, but I think you
would want to enable this via the developer kernel, rather than the
-standard kernel, this is why there is a split.

TIMER_STATS is already part of the -developer kernel via the
profiling.scc

I think I would rather see the -developer kernel be used for
validation, if that's what your trying to do, instead of polluting the
-standard kernel with DEBUG items.

Sau!

> 
> +# Collect kernel timers statistics
> +CONFIG_TIMER_STATS=y
> diff --git a/features/soc/broxton/broxton.scc
> b/features/soc/broxton/broxton.scc
> index 8e268e5..aea7bbd 100644
> --- a/features/soc/broxton/broxton.scc
> +++ b/features/soc/broxton/broxton.scc
> @@ -14,4 +14,6 @@ include features/usb/designware-usb3.scc
>  include features/intel-pinctrl/intel-pinctrl.scc
>  include features/usb/usb-typec.scc
>  
> +include features/powertop/powertop.scc
> +
>  kconf hardware broxton.cfg
> -- 
> 1.9.1
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[yocto] Yocto Project Status WW29

2016-07-15 Thread Saul Wold

Current Dev Position: YP 2.2 M2
Next Deadline: YP 2.2 M2 cut off would
be: 7/18/16 (This coming Monday - 5:00pm GMT)

SWAT team rotation: Paul -> Ross
https://wiki.yoctoproject.org/wiki/Yoct
o_Build_Failure_Swat_Team

Key Status/Updates:
 * Richard has been out this week, so the report will be thin.
 * Performance regressions were narrowed down to the GCC6 Update, movingto GTK3 
and the Python3 port. Investigation into how to mitigate thisis ongoing.
 * We’re considering removing uclibc and GCC 5.4 (preferring musl and GCC6) 
from OE Core 2.2, so if this would impact you please speak up.
 * 2.1.1 Completed QA, but there was a High found to do with supportingFedora 
24, which released very soon after 2.1 initially released andshould be a 
supported build host. This will delay 2.1.1 until after M2QA is completed.
 * Reminder that the M2 cut off is this coming Monday!

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2698 (last week 2747)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Yocto Project Status WW28

2016-07-08 Thread Saul Wold
Current Dev Position: YP 2.2 M2
Next Deadline: YP 2.2 M2 cut off would
be: 7/18/16

SWAT team rotation: Bill -> Paul
https://wiki.yoctoproject.org/wiki/Yoct
o_Build_Failure_Swat_Team

Key Status/Updates:
 * M1 QA report is out however there are concerns about performanceregressions 
which have not been root caused. M1 will continue to bedelayed until we figure 
out those issues and the fact that medium+ bugsand high bugs are still assigned 
to M1.
 * M2 patch merging is held up due to the shear volume of regressionswe’re 
seeing which are basically being left to Ross/RP to triage andfind the patches 
responsible. 
 * We did upgrade pseudo after various issues which brings in severalxattr 
fixes and resolves the init problems we were seeing in pseudotowards the end of 
the last release properly, rather than theworkarounds we put in place.
 * We’ve merged the progress patches from Paul so we get better feedbackduring 
the build for how various tasks are progressing.
 * We’re looking likely to remove directfb from OE-Core since the 
projectappears to have died.
 * 2.1.1 is in QA having had a successful build. We are working with areduced 
capacity QA team due to various changes at Intel/WindRiver sowe will have more 
limited QA testing of this unfortunately.

Key YP 2.2 Dates:
 * YP 2.2 M1 release would be: 6/24/16
 * YP 2.2 M2 cut off would be: 7/18/16
 * YP 2.2 M2 release would be: 7/29/16
 * YP 2.2 M3 cut off would be: 8/29/16
 * YP 2.2 M3 release would be: 9/9/16
 * YP 2.2 M4 cut off would be: 10/3/16
 * YP 2.2 M4 release would be: 10/28/16

Tracking Metrics:
WDD 2747 (last week 2718)
(https://wiki.yoctoproject.org/charts/combo.html)

Key Status Links for YP:
https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Minutes: Yocto Project Technical Team Meeting - Tuesday, July 5, 2016 8:00 AM US Pacific Time

2016-07-05 Thread Saul Wold
Attendees: Saul, Richard, Randy, Armin, Joshua

Agenda:

Yocto Project:
 - YP 2.2 M1 Build has gone through QA
   - Issues with Toaster and Eclipse
   - WIC Issues but not blockers
   - Planning to release it regardless
   - Very front loaded
     - Number of enhancements for M1 uncompleted
     - Number of bugs is still high
   - Python3 issues still surfacing
     - Locale issues
   - M2 will close on July 18 5:00pm GMT

https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.2_Status
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Schedule
https://wiki.yoctoproject.org/wiki/Yocto_2.2_Features

 pseudo
  - lost Peter Seabach (seebs), maintainer of pseudo
  - Issues still exist in pseudo and master did not resolve

 - 2.1.1 Stable Release Status - Armin
  - Looking Green, patches merged
  - Are we ready to QA and Release?
  - A few more patches pending
     would be good to have before 11th for QA window

 - 2.0.2 Stable Release - Robert
  - Patches pending
  - pydevshell patch is pending


Opens

Tips and Tricks
- Richard is requesting interesting idea for short blog entries and the
wiki page above is the tracking location, please take a look and add
any thoughts/ideas you might have.
https://wiki.yoctoproject.org/wiki/TipsAndTricks

Randy asked about dropping UClibc, RP replied in affirmative, proposed
dropping main recipe, but not the associated patches in recipes for a
short term and then dropping patches in a future release/recipe updates



-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [linux-yocto] [PATCH] cpumask: Export cpumask_any_but()

2016-06-30 Thread Saul Wold
This fixes the build if the IOSF_MBI and INTEL_RAPL are not set to =y

Acked and Tested by: Saul Wold <s...@linux.intel.com>


Sau!

On Thu, 2016-06-30 at 15:30 -0700, Nilesh Bacchewar wrote:
> 
> Almost every cpumask function is exported, just not the one I need to
> make the
> Intel uncore driver modular.
> 
> commit 3712bba1a260ad851f3aa8ddea9cb7326f6aa0b3 upstream.
> 
> Signed-off-by: Thomas Gleixner <t...@linutronix.de>
> Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
> Cc: Andi Kleen <andi.kl...@intel.com>
> Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
> Cc: Borislav Petkov <b...@alien8.de>
> Cc: David S. Miller <da...@davemloft.net>
> Cc: Harish Chegondi <harish.chego...@intel.com>
> Cc: Jacob Pan <jacob.jun@linux.intel.com>
> Cc: Jiri Olsa <jo...@redhat.com>
> Cc: Kan Liang <kan.li...@intel.com>
> Cc: Linus Torvalds <torva...@linux-foundation.org>
> Cc: Peter Zijlstra <pet...@infradead.org>
> Cc: Rusty Russell <ru...@rustcorp.com.au>
> Cc: Stephane Eranian <eran...@google.com>
> Cc: Vince Weaver <vincent.wea...@maine.edu>
> Cc: linux-ker...@vger.kernel.org
> Link: http://lkml.kernel.org/r/2016021011.878299...@linutronix.de
> Signed-off-by: Ingo Molnar <mi...@kernel.org>
> ---
>  lib/cpumask.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index 5a70f61..81dedaa 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -41,6 +41,7 @@ int cpumask_any_but(const struct cpumask *mask,
> unsigned int cpu)
>   break;
>   return i;
>  }
> +EXPORT_SYMBOL(cpumask_any_but);
>  
>  /* These are not inline because of header tangles. */
>  #ifdef CONFIG_CPUMASK_OFFSTACK
> -- 
> 1.9.1
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] mei.cfg: Add CONFIG_INTEL_MEI_TXE=m

2016-06-30 Thread Saul Wold
This will create the TXE based Intel Management Excution Interface
to support additional chipsets.

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 features/amt/mei/mei.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/features/amt/mei/mei.cfg b/features/amt/mei/mei.cfg
index 3195218..de6f657 100644
--- a/features/amt/mei/mei.cfg
+++ b/features/amt/mei/mei.cfg
@@ -2,3 +2,4 @@ CONFIG_STAGING=y
 CONFIG_WATCHDOG_CORE=y
 CONFIG_INTEL_MEI=m
 CONFIG_INTEL_MEI_ME=m
+CONFIG_INTEL_MEI_TXE=m
-- 
2.5.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/2] x86 tsc: enumerate BXT tsc_khz via CPUID

2016-06-30 Thread Saul Wold
From: Len Brown <len.br...@intel.com>

Hard code the BXT crystal clock (aka ART - Always Running Timer)
to 19.200 MHz, and use CPUID leaf 0x15 to determine the BXT TSC frequency.

Use tsc_khz to sanity check BXT cpu_khz,
which can be erroneous in some configurations.

Signed-off-by: Bin Gao <bin@intel.com>
[lenb: simplified]
Signed-off-by: Len Brown <len.br...@intel.com>

(cherry picked from commit dad7a9a9376716ffdf33aa719981a43cefa19ff4)
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 arch/x86/kernel/tsc.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 0123365..dd85b3c 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -688,7 +688,11 @@ unsigned long native_calibrate_tsc(void)
switch (boot_cpu_data.x86_model) {
case 0x4E:  /* SKL */
case 0x5E:  /* SKL */
-   crystal_khz = 24000;/* 24 MHz */
+   crystal_khz = 24000;/* 24.0 MHz */
+   break;
+   case 0x5C:  /* BXT */
+   crystal_khz = 19200;/* 19.2 MHz */
+   break;
}
}
 
@@ -896,6 +900,8 @@ int recalibrate_cpu_khz(void)
tsc_khz = x86_platform.calibrate_tsc();
if (tsc_khz == 0)
tsc_khz = cpu_khz;
+   else if (abs(cpu_khz - tsc_khz) * 10 > tsc_khz)
+   cpu_khz = tsc_khz;
cpu_data(0).loops_per_jiffy = cpufreq_scale(cpu_data(0).loops_per_jiffy,
cpu_khz_old, cpu_khz);
 
@@ -1256,8 +1262,16 @@ void __init tsc_init(void)
 
cpu_khz = x86_platform.calibrate_cpu();
tsc_khz = x86_platform.calibrate_tsc();
+
+   /*
+* Trust non-zero tsc_khz as authorative,
+* and use it to sanity check cpu_khz,
+* which will be off if system timer is off.
+*/
if (tsc_khz == 0)
tsc_khz = cpu_khz;
+   else if (abs(cpu_khz - tsc_khz) * 10 > tsc_khz)
+   cpu_khz = tsc_khz;
 
if (!tsc_khz) {
mark_tsc_unstable("could not calculate TSC khz");
-- 
2.5.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/2] x86 tsc: enumerate SKL cpu_khz and tsc_khz via CPUID

2016-06-30 Thread Saul Wold
From: Len Brown <len.br...@intel.com>

Skylake CPU base-frequency and TSC frequency may differ
by up to 2%.

Enumerate CPU and TSC frequencies separately, allowing
cpu_khz and tsc_khz to differ.

The existing CPU frequency calibration mechanism is unchanged.
However, CPUID extensions are preferred, when available.

CPUID.0x16 is preferred over MSR and timer calibration
for CPU frequency discovery.

CPUID.0x15 takes precedence over CPU-frequency
for TSC frequency discovery.

Signed-off-by: Len Brown <len.br...@intel.com>
(cherry picked from commit 19fa5e73647fde1e6a7038a8f05cddf4c43f08d3)
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 arch/x86/include/asm/tsc.h  |  1 +
 arch/x86/include/asm/x86_init.h |  4 ++-
 arch/x86/kernel/tsc.c   | 76 +
 arch/x86/kernel/x86_init.c  |  1 +
 4 files changed, 75 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 6d7c547..3b31206 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -34,6 +34,7 @@ extern void mark_tsc_unstable(char *reason);
 extern int unsynchronized_tsc(void);
 extern int check_tsc_unstable(void);
 extern int check_tsc_disabled(void);
+extern unsigned long native_calibrate_cpu(void);
 extern unsigned long native_calibrate_tsc(void);
 extern unsigned long long native_sched_clock_from_tsc(u64 tsc);
 
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index cd0fc0c..a324f63 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -145,7 +145,8 @@ struct timespec;
 
 /**
  * struct x86_platform_ops - platform specific runtime functions
- * @calibrate_tsc: calibrate TSC
+ * @calibrate_cpu: calibrate CPU
+ * @calibrate_tsc: calibrate TSC, if different from CPU
  * @get_wallclock: get time from HW clock like RTC etc.
  * @set_wallclock: set time back to HW clock
  * @is_untracked_pat_range exclude from PAT logic
@@ -156,6 +157,7 @@ struct timespec;
  * @apic_post_init:adjust apic if neeeded
  */
 struct x86_platform_ops {
+   unsigned long (*calibrate_cpu)(void);
unsigned long (*calibrate_tsc)(void);
void (*get_wallclock)(struct timespec *ts);
int (*set_wallclock)(const struct timespec *ts);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index c7c4d9c..0123365 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -234,7 +234,7 @@ static inline unsigned long long cycles_2_ns(unsigned long 
long cyc)
return ns;
 }
 
-static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
+static void set_cyc2ns_scale(unsigned long khz, int cpu)
 {
unsigned long long tsc_now, ns_now;
struct cyc2ns_data *data;
@@ -243,7 +243,7 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
local_irq_save(flags);
sched_clock_idle_sleep_event();
 
-   if (!cpu_khz)
+   if (!khz)
goto done;
 
data = cyc2ns_write_begin(cpu);
@@ -256,7 +256,7 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
 * time function is continuous; see the comment near struct
 * cyc2ns_data.
 */
-   clocks_calc_mult_shift(>cyc2ns_mul, >cyc2ns_shift, cpu_khz,
+   clocks_calc_mult_shift(>cyc2ns_mul, >cyc2ns_shift, khz,
   NSEC_PER_MSEC, 0);
 
/*
@@ -660,10 +660,63 @@ success:
 }
 
 /**
- * native_calibrate_tsc - calibrate the tsc on boot
+ * native_calibrate_tsc
+ * Determine TSC frequency via CPUID, else return 0.
  */
 unsigned long native_calibrate_tsc(void)
 {
+   unsigned int eax_denominator, ebx_numerator, ecx_hz, edx;
+   unsigned int crystal_khz;
+
+   if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
+   return 0;
+
+   if (boot_cpu_data.cpuid_level < 0x15)
+   return 0;
+
+   eax_denominator = ebx_numerator = ecx_hz = edx = 0;
+
+   /* CPUID 15H TSC/Crystal ratio, plus optionally Crystal Hz */
+   cpuid(0x15, _denominator, _numerator, _hz, );
+
+   if (ebx_numerator == 0 || eax_denominator == 0)
+   return 0;
+
+   crystal_khz = ecx_hz / 1000;
+
+   if (crystal_khz == 0) {
+   switch (boot_cpu_data.x86_model) {
+   case 0x4E:  /* SKL */
+   case 0x5E:  /* SKL */
+   crystal_khz = 24000;/* 24 MHz */
+   }
+   }
+
+   return crystal_khz * ebx_numerator / eax_denominator;
+}
+
+static unsigned long cpu_khz_from_cpuid(void)
+{
+   unsigned int eax_base_mhz, ebx_max_mhz, ecx_bus_mhz, edx;
+
+   if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
+   return 0;
+
+   if (boot_cpu_data.cpuid_level < 0x16)
+   return 0;
+
+   eax_base_mhz = ebx_max_mhz = ecx_bus_mhz = edx = 0;
+
+   cpuid

Re: [linux-yocto] [PATCH 0/2] Use CPUID to estimate clock frequency for linux-yocto-4.1

2016-06-23 Thread Saul Wold
Bruce, I think we need these in 4.4 bxt-rebase also.

They are pending in Lenb's tree.

Sau!

On Thu, 2016-06-23 at 04:25 +, Yong, Jonathan wrote:
> 
> This patch allows clock frequencies to be calibrated if TSC and CPU
> frequencies differ. This is not in the latest kernel tree yet, so
> this
> should go into standard/intel/base.
> 
> Tested with Apollo Lake.
> 
> Bin Gao (1):
>   x86 tsc: enumerate BXT tsc_khz via CPUID
> 
> Len Brown (1):
>   x86 tsc: enumerate SKL cpu_khz and tsc_khz via CPUID
> 
>  arch/x86/include/asm/tsc.h  |  1 +
>  arch/x86/include/asm/x86_init.h |  4 +-
>  arch/x86/kernel/tsc.c   | 91
> +
>  arch/x86/kernel/x86_init.c  |  1 +
>  4 files changed, 89 insertions(+), 8 deletions(-)
> 
> -- 
> 2.7.3
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH 0/2] Use CPUID to estimate clock frequency for linux-yocto-4.1

2016-06-23 Thread Saul Wold

Bruce, I think we need these in 4.4 bxt-rebase also.

They are pending in Lenb's tree.

Sau!

On Thu, 2016-06-23 at 04:25 +, Yong, Jonathan wrote:
> This patch allows clock frequencies to be calibrated if TSC and CPU
> frequencies differ. This is not in the latest kernel tree yet, so
> this
> should go into standard/intel/base.
> 
> Tested with Apollo Lake.
> 
> Bin Gao (1):
>   x86 tsc: enumerate BXT tsc_khz via CPUID
> 
> Len Brown (1):
>   x86 tsc: enumerate SKL cpu_khz and tsc_khz via CPUID
> 
>  arch/x86/include/asm/tsc.h  |  1 +
>  arch/x86/include/asm/x86_init.h |  4 +-
>  arch/x86/kernel/tsc.c   | 91
> +
>  arch/x86/kernel/x86_init.c  |  1 +
>  4 files changed, 89 insertions(+), 8 deletions(-)
> 
> -- 
> 2.7.3
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PULL REQUEST] add standard/bxt-rebase branch

2016-06-01 Thread Saul Wold
On Tue, 2016-05-31 at 23:31 -0400, Bruce Ashfield wrote:
> 
> On 2016-05-31 6:24 PM, Ranostay, Matt wrote:
> > 
> > 
> > This pull request is for adding the standard/bxt-rebase branch with
> > has various backports from 4.6 and 4.5, which are have an
> > unacceptable risk of breaking other platforms.
> > This is based on standard/intel and will be rebased. Thus nobody
> > should expect the history to be linear.
> Seems sane to me.
> 
> One minor question though. To keep the branch naming and inheritance
> sane, I'd create this as standard/intel/bxt-rebase
> 
> Any objections ?
> 
This is actually what I had asked for (standard/intel/bxt-rebase) so no
objections here.

Sau!

> 
> Bruce
> 
> > 
> > 
> > 
> > The following changes since commit
> > 53e84104c5e68eb468823dd0d262a64623d01a55:
> > 
> >   mmc: mmc: Fix partition switch timeout for some eMMCs (2016-05-
> > 19 
> > 17:15:25 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://sandbox.sakoman.com/linux-yocto-4.4.git standard/bxt-rebase
> > 
> > for you to fetch changes up to
> > 1203930e034957e1fc9e0c4842ecd7922d5e0897:
> > 
> >   [UPSTREAM] ASoC: skylake: added WARN_ON invalid dsp (2016-05-27
> > 17:21:19 -0700)
> > 
> > 
> > Aaron Plattner (1):
> >   ALSA: hda - Add new GPU codec ID 0x10de0083 to snd-hda
> > 
> > Adrian Hunter (4):
> >   mmc: core: Add a facility to "pause" re-tuning
> >   mmc: block: Pause re-tuning while switched to the RPMB
> > partition
> >   mmc: block: Always switch back to main area after RPMB access
> >   mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel
> > controller
> > 
> > Alan (1):
> >   ASoC: Intel: Skylake: fix pointer scaling
> > 
> > Alan Cox (1):
> >   ASoC: Intel: Skylake: remove bogus comparison of an array
> > with NULL
> > 
> > Alex Dai (2):
> >   drm/i915/guc: Add GuC css header parser
> >   drm/i915/guc: Clean up locks in GuC
> > 
> > Alex Goins (2):
> >   i915: wait for fence in mmio_flip_work_func
> >   i915: wait for fence in prepare_plane_fb
> > 
> > Ander Conselvan de Oliveira (10):
> >   drm/i915: Don't pass *DP around to link training functions
> >   drm/i915: Split write of pattern to DP reg from
> > intel_dp_set_link_train
> >   drm/i915 Call get_adjust_train() from clock recovery and
> > channel eq
> >   drm/i915: Move register write into
> > intel_dp_set_signal_levels()
> >   drm/i915: Move generic link training code to a separate file
> >   drm/i915: Create intel_dp->prepare_link_retrain() hook
> >   drm/i915: Make intel_dp_source_supports_hbr2() take an
> > intel_dp pointer
> >   drm/i915: Fix SKL i_boost level
> >   drm/i915: Don't do edp panel detection in g4x_dp_detect()
> >   drm/i915: Remove platform specific *_dp_detect() functions
> > 
> > Andreas Ziegler (1):
> >   drm/i915: Remove select to deleted STOP_MACHINE from Kconfig
> > 
> > Animesh Manna (4):
> >   drm/i915/skl: Making DC6 entry is the last call in suspend
> > flow.
> >   drm/i915/gen9: csr_init after runtime pm enable
> >   drm/i915/gen9: Use flush_work to synchronize with dmc loader
> >   drm/i915/skl: Removed assert for csr-fw-loading check during
> > disabling dc6
> > 
> > Arun Siluvery (1):
> >   Revert "drm/i915: Initialize HWS page address after GPU
> > reset"
> > 
> > Bamvor Jian Zhang (1):
> >   gpiolib: make comment consistent with code
> > 
> > Chris Wilson (11):
> >   drm/i915: Map the ringbuffer using WB on LLC machines
> >   drm/i915: Report context GTT size
> >   drm/i915: Add soft-pinning API for execbuffer
> >   drm/i915: Recover all available ringbuffer space following
> > reset
> >   drm/i915: Serialise updates to GGTT with access through GGTT
> > on Braswell
> >   drm/i915: Fix RPS pointer passed from wait_ioctl to
> > i915_wait_request
> >   drm/i915: Add soft-pinning API for execbuffer
> >   drm/i915: Pin the ifbdev for the info->system_base GGTT
> > mmapping
> >   drm/i915: Move Braswell stop_machine GGTT insertion
> > workaround
> >   drm/i915: Allow i915_gem_object_get_page() on userptr as well
> >   drm/i915: Balance assert_rpm_wakelock_held() for
> > !IS_ENABLED(CONFIG_PM)
> > 
> > Damien Lespiau (4):
> >   drm/i915/skl: Store and print the DMC firmware version we
> > load
> >   drm/i915/skl: Print the DMC firmware status in debugfs
> >   drm/i915/skl: Expose DC5/DC6 entry counts
> >   drm/i915: Make turning on/off PW1 and Misc I/O part of the
> > init/fini sequences
> > 
> > Damien.Horsley (1):
> >   ASoC: Add SOC_DOUBLE_STS macro
> > 
> > Dan Carpenter (3):
> >   ASoC: Intel: Skylake: Fix a couple signedness bugs
> >   ASoC: Intel: Skylake: pointer math issue
> >   ASoC: Intel: sst: fix a loop timeout in
> > sst_hsw_stream_reset()
> > 
> > Daniel Stone (2):
> >   drm/i915/pm: Unstatic power_domain_str
> >   

Re: [linux-yocto] [PATCH 0/2] iio: Set correct iio name

2016-05-28 Thread Saul Wold
On Sat, 2016-05-28 at 12:34 +0800, Yong Li wrote:
> Hi Bruce Saul,
> 
> I had submitted the patches into Kernel mail list, the concern is the
> legacy application compatibility:
> http://www.spinics.net/lists/linux-iio/index.html#24331
> 
> For the Ostro OS, Using Soletta framrwork, we have tested/verified
> more more than 30 different I2C
> devices(https://ostroproject.org/documentation/hardware/sensors.html)
> .
> But only the two devices have incorrect device names(the IIO name
> does
> not match the I2C device name). QA team think it is a bug
> 
So is it possible to fix the test in this case to correctly handle the
legacy naming rather than make it fail?  I guess the concern here is if
we "fix" the name, we will really break the legacy applications.  It's
possible for those application to run in Ostro also and since Ostro is
newer, it would break those rather than the other way around.

Sau!

> Thanks,
> Yong
> 
> 2016-05-27 23:51 GMT+08:00 Saul Wold <s...@linux.intel.com>:
> > 
> > On Fri, 2016-05-27 at 10:24 -0400, Bruce Ashfield wrote:
> > > 
> > > On 2016-05-27 12:58 AM, Yong Li wrote:
> > > > 
> > > > 
> > > > Dear Maintainers,
> > > > 
> > > > This patch fixes the “incorrect IIO device name” issue.
> > > > 
> > > > Please merge it into standard/base branch for linux-yocto-4.4
> > > > if
> > > > this looks okay.
> > > The change looks technically correct, just a question about if
> > > these
> > > are also going upstream to the mainline kernel.
> > > 
> > Bruce,
> > 
> > These are possibly candidates for the standard/intel branch,
> > they where proposed upstream and deemed correct, but not merge-able 
> > due
> > to creating incompatible names.
> > 
> > Yong Li,
> > What is requiring the name change in Ostro, why can't Ostro
> > use the existing incorrect, but compatible name?
> > 
> > Sau!
> > > 
> > > Bruce
> > > 
> > > > 
> > > > 
> > > > 
> > > > Thanks
> > > > Yong Li
> > > > 
> > > > Yong Li (2):
> > > >    iio: tmp006: Set correct iio name
> > > >    iio: si7020: Set correct iio name
> > > > 
> > > >   drivers/iio/humidity/si7020.c| 2 +-
> > > >   drivers/iio/temperature/tmp006.c | 2 +-
> > > >   2 files changed, 2 insertions(+), 2 deletions(-)
> > > > 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PULL REQUEST] Broxton related backports for linux-yocto-4.4

2016-05-27 Thread Saul Wold
On Wed, 2016-05-25 at 12:17 -0400, Bruce Ashfield wrote:
> On 2016-05-24 4:19 PM, California Sullivan wrote:
> > 
> > Hi Bruce,
> > 
> > This is a set of backports from upstream. I have tested
> > allyesconfig,
> > allnoconfig, and standard builds and can't find anything wrong
> > there.
> > I have also tested running the kernel on MinnowBoard Max and there
> > are
> > no new errors or warnings.
> > 
> > Let me know if I need to make any modifications and send out a V2.
> No need for a v2. They look fine to me, and I've staged them on
> the kernel repo and have adjusted the SRCREVs. I'll send out the
> update in a day or so.
> 

Did you actually push them to the linux-yocto-4.4 repo yet?  Or are
they staged on your machine?

Sau!

> Bruce
> 
> > 
> > 
> > Thanks,
> > Cal Sullivan
> > 
> > 
> > he following changes since commit
> > 628bf627561c6285d99fb978e11d4c15fc29324b:
> > 
> >   Merge tag 'v4.4.11' into standard/base (2016-05-19 09:02:42
> > -0400)
> > 
> > are available in the git repository at:
> > 
> >   git://git.yoctoproject.org/linux-yocto-contrib
> > clsulliv/standard/base
> > 
> > for you to fetch changes up to
> > 53e84104c5e68eb468823dd0d262a64623d01a55:
> > 
> >   mmc: mmc: Fix partition switch timeout for some eMMCs (2016-05-19 
> > 17:15:25 -0700)
> > 
> > 
> > Adrian Hunter (3):
> >   mmc: sdhci: Remove SDHCI_SDR104_NEEDS_TUNING
> >   mmc: mmc: Attempt to flush cache before reset
> >   mmc: mmc: Fix partition switch timeout for some eMMCs
> > 
> > Andy Shevchenko (12):
> >   device property: always check for fwnode type
> >   device property: rename helper functions
> >   device property: refactor built-in properties support
> >   device property: keep single value inplace
> >   device property: improve readability of macros
> >   device property: return -EINVAL when property isn't found in
> > ACPI
> >   device property: Fallback to secondary fwnode if primary
> > misses the property
> >   mfd: core: propagate device properties to sub devices drivers
> >   mfd: intel-lpss: Pass HSUART configuration via properties
> >   device property: avoid allocations of 0 length
> >   lib/string: introduce match_string() helper
> >   device property: convert to use match_string() helper
> > 
> > Bamvor Jian Zhang (1):
> >   gpiolib: do not allow to insert an empty gpiochip
> > 
> > Christophe RICARD (2):
> >   ACPI: Rename acpi_gsi_get_irq_type to acpi_dev_get_irq_type
> > and export symbol
> >   ACPI / gpio: Add irq_type when a GPIO is used as an interrupt
> > 
> > Dasaratharaman Chandramouli (1):
> >   intel_idle: Support for Intel Xeon Phi Processor x200 Product
> > Family
> > 
> > Gwendal Grignou (1):
> >   mmc: core: Do regular power cycle when lacking eMMC HW reset
> > support
> > 
> > Heikki Krogerus (4):
> >   device property: helper macros for property entry creation
> >   device property: the secondary fwnode needs to depend on the
> > primary
> >   device property: fwnode->secondary may contain ERR_PTR(-
> > ENODEV)
> >   device property: fix for a case of use-after-free
> > 
> > Len Brown (2):
> >   intel_idle: Add SKX support
> >   intel_idle: add BXT support
> > 
> > Linus Walleij (1):
> >   Revert "gpio: revert get() to non-errorprogating behaviour"
> > 
> > Mika Westerberg (7):
> >   pwm: lpss: Remove ->free() callback
> >   pwm: lpss: Rework the sequence of programming PWM_SW_UPDATE
> >   device property: Take a copy of the property set
> >   driver core: platform: Add support for built-in device
> > properties
> >   mfd: intel-lpss: Add support for passing device properties
> >   mfd: intel-lpss: Pass SDA hold time to I2C host controller
> > driver
> >   mfd: intel-lpss: Pass I2C configuration via properties on BXT
> > 
> > Qipeng Zha (1):
> >   pinctrl: intel: make the high level interrupt working
> > 
> > Richard Cochran (10):
> >   intel_idle: remove useless return from void function.
> >   intel_idle: Fix a helper function's return value.
> >   intel_idle: Remove redundant initialization calls.
> >   intel_idle: Fix deallocation order on the driver exit path.
> >   intel_idle: Fix dangling registration on error path.
> >   intel_idle: Avoid a double free of the per-CPU data.
> >   intel_idle: Setup the timer broadcast only on successful
> > driver load.
> >   intel_idle: Don't overreact to a cpuidle registration
> > failure.
> >   intel_idle: Propagate hot plug errors.
> >   intel_idle: Clean up all registered devices on exit.
> > 
> > Wolfram Sang (1):
> >   mmc: make MAN_BKOPS_EN message a debug
> > 
> > qipeng.zha (1):
> >   pwm: lpss: Update PWM setting for Broxton
> > 
> >  arch/x86/include/asm/msr-index.h  |   8 +
> >  drivers/acpi/gsi.c|  21 +-
> >  drivers/acpi/property.c   |  10 +-
> >  

Re: [linux-yocto] [PATCH 0/2] iio: Set correct iio name

2016-05-27 Thread Saul Wold
On Fri, 2016-05-27 at 10:24 -0400, Bruce Ashfield wrote:
> On 2016-05-27 12:58 AM, Yong Li wrote:
> > 
> > Dear Maintainers,
> > 
> > This patch fixes the “incorrect IIO device name” issue.
> > 
> > Please merge it into standard/base branch for linux-yocto-4.4 if
> > this looks okay.
> The change looks technically correct, just a question about if these
> are also going upstream to the mainline kernel.
> 
Bruce, 

These are possibly candidates for the standard/intel branch,
they where proposed upstream and deemed correct, but not merge-able due
to creating incompatible names.

Yong Li, 
What is requiring the name change in Ostro, why can't Ostro
use the existing incorrect, but compatible name?

Sau!
> Bruce
> 
> > 
> > 
> > Thanks
> > Yong Li
> > 
> > Yong Li (2):
> >    iio: tmp006: Set correct iio name
> >    iio: si7020: Set correct iio name
> > 
> >   drivers/iio/humidity/si7020.c| 2 +-
> >   drivers/iio/temperature/tmp006.c | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> > 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [yocto] QA Test Report for YP - 1.8.2.rc3 build

2016-05-20 Thread Saul Wold
one    0.0%    none   
>  0.0%  none    100.0%  5836 5896   BSP/QEMU
> : fido branch  qemux86-64  98.5%   none   
>  1.5%  9656    0.0%    none    100.0%  
> 5856   Eclipse Plugin: fido branch     Kepler - Fedora 22
> x86_64     96.4%   none    3.6%    7054   
>  0.0%  none    100.0%  5857    Eclipse
> Plugin: fido branch    Luna on Fedora 22 X86_64    96.4% 
>    none    3.6%    7054    0.0%    none   
>  100.0%    5906 5907   Meta-yocto: fido branch     U
> buntu 14.04 x86_64     100.0%  6156    0.0%   
>  none  0.0%    none    100.0%  5874    O
> E-Core: fido branch    CentOS 7.1 x86_64   100.0% 
>  none  0.0%    none    0.0%    none    10
> 0.0%   5872    OE-Core: fido branch    Fedora 23
> x86_64 100.0%  none    0.0%    none   
>  0.0%  none    100.0%  5873    OE-Core: fido
> branch OpenSuse 13.2 x86_64    100.0%  none   
>  0.0%  none    0.0%    none    100.0%  
> 5871   OE-Core: fido branch    Ubuntu 15.04 x86_64    
>  100.0%    none    0.0%    none    0.0%   
>  none  100.0%  5845    BitBake: fido branch   
>  Debian 4.3.5-1~bpo8+1     100.0%  none    0.0%   
>  none  0.0%    none    100.0%  5850    A
> utomated Build Testing: fido branch    CentOS 7 x86_64 
> 100.0%     none    0.0%    none    0.0%    
> none   100.0%  5849    Automated Build Testing:
> fido branch    Fedora 23 x86-64    100.0%  none   
>  0.0%  none    0.0%    none    100.0%  
> 5848   Automated Build Testing: fido branch    OpenSuse
> 13.2 x86_64    100.0%  none    0.0%    none   
>  0.0%  none    100.0%  5847    Automated
> Build Testing: fido branch     Ubuntu 15.04 x86_64     100.
> 0%     none    0.0%    none    0.0%    none
>    100.0%  5908    Build Appliance: fido branch   
>  VMWare Player on Ubuntu   100.0%  none    0.0%   
>  none  0.0%    none    100.0%  Total: 31   
>  Test Case Status Report     Status    Count  
>  FAILED    16  PASSED  1840    Total: 1856  
>         
>  
> 
> Bugs Found during QA Test
> New and notable issues Found during QA Test & Community
>  ID    Summary (4 tasks) ⇒     P   Assignee    
> QA Milestone   Status  Resolution  cf_
> regression_type    Created 
>  BSPs
>  9520  test_parselogs failed on udevd[342] inotify_add_watch
> /dev/loop when running test image  Medium+     Saul Wold
>    Francisco Pedraza   2.1.1   NEW    
>  Regression (Found by QA test)     2016-04-25 
>  9652  boot and install from USB failed getting [sdc] error
> message    Medium+     Jianxun Zhang   Francisco Pe
> draza  1.8.2   NEW     Regression (Found
> by QA test)    2016-05-17 
>  9653  Boot and install from USB failed after GRUB black
> screen is displayed    Medium+     Jianxun Zhang   
> Francisco Pedraza  1.8.2   NEW     Regress
> ion (Found by QA test)     2016-05-17 
>  9654  Ogg media file audio is not working on NUC and MMax    
>  Medium+   Saul Wold   Francisco Pedraza   1.8.2  
>  NEW   Regression (Found by QA test)   2016-05-
> 17 
>  
> 
> Other Bugs found during QA Test (including regressions)
>  ID    Summary (4 tasks) ⇒     P   Assignee    
> QA Milestone   Status  Resolution  cf_r
> egression_type     Created 
>  Regression (Found by QA test)
>  9656  NFS boot failed due No working init found kernel panic
> on qemu    Medium  Alexandru Georgescu     Francis
> co Pedraza     1.8.2   NEEDINFO    Regressio
> n (Found by QA test)   2016-05-18 
>  Manual Testing
>  9650  Eject icon is displayed as "file" on SATO sdk NUC when
> plugging USB   Medium  Jussi Kukkonen  Francisc
> o Pedraza  1.8.3   NEW Regression
> (Found by QA test)     2016-05-17 
>  Regression (Used to work)
>  6156  [crosstap] no trace message output on qemuarm  
>  Medium    Tom Zanussi     2.2 ACCEPTED   
>    Regression (Used to work)   2014-04-14 
>  OE-Core
>  7054  OprofileUI needs to be updated to reflect new oprofile
> functionality  Medium  Ross Burton Valentin H
> angan  2.2 ACCEPTED    Regression (Used
> to work)   2014-12-09 
>  
>  
>  
> Regards,
> José
>  
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [linux-yocto] [PATCH] UVC: Add support for R200 depth camera

2016-04-01 Thread Saul Wold
On Fri, 2016-04-01 at 15:39 -0400, Bruce Ashfield wrote:
> On 2016-04-01 10:45 AM, Saul Wold wrote:
> > 
> > From: Aviv Greenberg <avi...@gmail.com>
> Remind me .. this is for 4.4, correct ?

Yup 4.4

Sau!


> Bruce
> 
> > 
> > 
> > Add support for Intel R200 depth camera in uvc driver.
> > This includes adding new uvc GUIDs for the new pixel formats,
> > adding new V4L pixel format definition to user api headers,
> > and updating the uvc driver GUID-to-4cc tables with the new
> > formats.
> > 
> > Tested-by: Greenberg, Aviv D <aviv.d.greenb...@intel.com>
> > Signed-off-by: Aviv Greenberg <aviv.d.greenb...@intel.com>
> > Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovet...@gmx.de>
> > Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
> > Signed-off-by: Saul Wold <s...@linux.intel.com>
> > ---
> >   drivers/media/usb/uvc/uvc_driver.c | 20 
> >   drivers/media/usb/uvc/uvcvideo.h   | 12 
> >   include/uapi/linux/videodev2.h |  3 +++
> >   3 files changed, 35 insertions(+)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c
> > index d11fd6a..5cefca9 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -148,6 +148,26 @@ static struct uvc_format_desc uvc_fmts[] = {
> >     .guid   = UVC_GUID_FORMAT_H264,
> >     .fcc= V4L2_PIX_FMT_H264,
> >     },
> > +   {
> > +   .name   = "Greyscale 8 L/R (Y8I)",
> > +   .guid   = UVC_GUID_FORMAT_Y8I,
> > +   .fcc= V4L2_PIX_FMT_Y8I,
> > +   },
> > +   {
> > +   .name   = "Greyscale 12 L/R (Y12I)",
> > +   .guid   = UVC_GUID_FORMAT_Y12I,
> > +   .fcc= V4L2_PIX_FMT_Y12I,
> > +   },
> > +   {
> > +   .name   = "Depth data 16-bit (Z16)",
> > +   .guid   = UVC_GUID_FORMAT_Z16,
> > +   .fcc= V4L2_PIX_FMT_Z16,
> > +   },
> > +   {
> > +   .name   = "Bayer 10-bit (SRGGB10P)",
> > +   .guid   = UVC_GUID_FORMAT_RW10,
> > +   .fcc= V4L2_PIX_FMT_SRGGB10P,
> > +   },
> >   };
> > 
> >   /* --
> > --
> > diff --git a/drivers/media/usb/uvc/uvcvideo.h
> > b/drivers/media/usb/uvc/uvcvideo.h
> > index f0f2391..7e4d3ee 100644
> > --- a/drivers/media/usb/uvc/uvcvideo.h
> > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > @@ -119,6 +119,18 @@
> >   #define UVC_GUID_FORMAT_H264 \
> >     { 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
> >      0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_Y8I \
> > +   { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > +    0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_Y12I \
> > +   { 'Y',  '1',  '2',  'I', 0x00, 0x00, 0x10, 0x00, \
> > +    0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_Z16 \
> > +   { 'Z',  '1',  '6',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > +    0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_RW10 \
> > +   { 'R',  'W',  '1',  '0', 0x00, 0x00, 0x10, 0x00, \
> > +    0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > 
> >   /* --
> > --
> >    * Driver specific constants.
> > diff --git a/include/uapi/linux/videodev2.h
> > b/include/uapi/linux/videodev2.h
> > index a0e87d1..421d274 100644
> > --- a/include/uapi/linux/videodev2.h
> > +++ b/include/uapi/linux/videodev2.h
> > @@ -621,6 +621,9 @@ struct v4l2_pix_format {
> >   #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L')
> > /* JPEG-Lite */
> >   #define V4L2_PIX_FMT_SE401  v4l2_fourcc('S', '4', '0', '1')
> > /* se401 janggu compressed rgb */
> >   #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I')
> > /* S5C73M3 interleaved UYVY/JPEG */
> > +#define V4L2_PIX_FMT_Y8I  v4l2_fourcc('Y', '8', 'I', ' ') /*
> > Greyscale 8-bit L/R interleaved */
> > +#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /*
> > Greyscale 12-bit L/R interleaved */
> > +#define V4L2_PIX_FMT_Z16  v4l2_fourcc('Z', '1', '6', ' ') /*
> > Depth data 16-bit */
> > 
> >   /* SDR formats - used only for Software Defined Radio devices */
> >   #define V4L2_SDR_FMT_CU8  v4l2_fourcc('C', 'U', '0', '8')
> > /* IQ u8 */
> > 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] UVC: Add support for R200 depth camera

2016-04-01 Thread Saul Wold
From: Aviv Greenberg <avi...@gmail.com>

Add support for Intel R200 depth camera in uvc driver.
This includes adding new uvc GUIDs for the new pixel formats,
adding new V4L pixel format definition to user api headers,
and updating the uvc driver GUID-to-4cc tables with the new formats.

Tested-by: Greenberg, Aviv D <aviv.d.greenb...@intel.com>
Signed-off-by: Aviv Greenberg <aviv.d.greenb...@intel.com>
Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovet...@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 20 
 drivers/media/usb/uvc/uvcvideo.h   | 12 
 include/uapi/linux/videodev2.h |  3 +++
 3 files changed, 35 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index d11fd6a..5cefca9 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -148,6 +148,26 @@ static struct uvc_format_desc uvc_fmts[] = {
.guid   = UVC_GUID_FORMAT_H264,
.fcc= V4L2_PIX_FMT_H264,
},
+   {
+   .name   = "Greyscale 8 L/R (Y8I)",
+   .guid   = UVC_GUID_FORMAT_Y8I,
+   .fcc= V4L2_PIX_FMT_Y8I,
+   },
+   {
+   .name   = "Greyscale 12 L/R (Y12I)",
+   .guid   = UVC_GUID_FORMAT_Y12I,
+   .fcc= V4L2_PIX_FMT_Y12I,
+   },
+   {
+   .name   = "Depth data 16-bit (Z16)",
+   .guid   = UVC_GUID_FORMAT_Z16,
+   .fcc= V4L2_PIX_FMT_Z16,
+   },
+   {
+   .name   = "Bayer 10-bit (SRGGB10P)",
+   .guid   = UVC_GUID_FORMAT_RW10,
+   .fcc= V4L2_PIX_FMT_SRGGB10P,
+   },
 };
 
 /* 
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index f0f2391..7e4d3ee 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -119,6 +119,18 @@
 #define UVC_GUID_FORMAT_H264 \
{ 'H',  '2',  '6',  '4', 0x00, 0x00, 0x10, 0x00, \
 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_Y8I \
+   { 'Y',  '8',  'I',  ' ', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_Y12I \
+   { 'Y',  '1',  '2',  'I', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_Z16 \
+   { 'Z',  '1',  '6',  ' ', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_RW10 \
+   { 'R',  'W',  '1',  '0', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 
 /* 
  * Driver specific constants.
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index a0e87d1..421d274 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -621,6 +621,9 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_JPGL  v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
 #define V4L2_PIX_FMT_SE401  v4l2_fourcc('S', '4', '0', '1') /* se401 
janggu compressed rgb */
 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 
interleaved UYVY/JPEG */
+#define V4L2_PIX_FMT_Y8I  v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 
8-bit L/R interleaved */
+#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 
12-bit L/R interleaved */
+#define V4L2_PIX_FMT_Z16  v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
16-bit */
 
 /* SDR formats - used only for Software Defined Radio devices */
 #define V4L2_SDR_FMT_CU8  v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[yocto] [PATCH] matchbox-keyboard-ui.c: Fix int -> long to address 32bit vs 64 bit addressing

2016-03-19 Thread Saul Wold
The soft keyboard was displaying incorrectly on 64bit machines

[YOCTO #9254]

Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 src/matchbox-keyboard-ui.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/matchbox-keyboard-ui.c b/src/matchbox-keyboard-ui.c
index 84bc375..988504e 100644
--- a/src/matchbox-keyboard-ui.c
+++ b/src/matchbox-keyboard-ui.c
@@ -125,7 +125,7 @@ get_desktop_area(MBKeyboardUI *ui, int *x, int *y, int 
*width, int *height)
   Atom   atom_area, type;
   intresult, format;
   unsigned long  nitems, bytes_after;
-  int   *geometry = NULL;
+  long   *geometry = NULL;
 
   atom_area = XInternAtom (ui->xdpy, "_NET_WORKAREA", False);
 
-- 
2.5.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[linux-yocto] [PATCH] gpio-pca953x: add "drive" property

2016-03-10 Thread Saul Wold
From: Jussi Laako <jussi.la...@linux.intel.com>

Galileo gen 2 has support for setting GPIO modes. Expose these
properties through the GPIO sysfs interface. This approach is bit hacky,
since it changes the interface semantics.

The original patch was by Josef Ahmad <josef.ah...@linux.intel.com> and
made on top of kernel 3.8.

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Jussi Laako <jussi.la...@linux.intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpio-pca953x.c   | 57 +++
 drivers/gpio/gpiolib-sysfs.c  | 78 +++
 drivers/gpio/gpiolib.c| 18 ++
 drivers/gpio/gpiolib.h|  4 +++
 include/asm-generic/gpio.h|  5 +++
 include/linux/gpio.h  | 10 ++
 include/linux/gpio/consumer.h | 11 ++
 include/linux/gpio/driver.h   |  2 ++
 8 files changed, 178 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index f23a4b4..f99706f 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -39,6 +39,9 @@
 #define PCA957X_MSK6
 #define PCA957X_INTS   7
 
+#define PCA953X_PUPD_EN35
+#define PCA953X_PUPD_SEL   36
+
 #define PCA_GPIO_MASK  0x00FF
 #define PCA_INT0x0100
 #define PCA953X_TYPE   0x1000
@@ -375,6 +378,43 @@ exit:
mutex_unlock(>i2c_lock);
 }
 
+static int pca953x_gpio_set_drive(struct gpio_chip *gc,
+unsigned off, unsigned mode)
+{
+   struct pca953x_chip *chip;
+   int ret = 0;
+   int val;
+
+   chip = container_of(gc, struct pca953x_chip, gpio_chip);
+
+   if (chip->chip_type != PCA953X_TYPE)
+   return -EINVAL;
+
+   mutex_lock(>i2c_lock);
+
+   switch (mode) {
+   case GPIOF_DRIVE_PULLUP:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 1, 
off);
+   break;
+   case GPIOF_DRIVE_PULLDOWN:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 0, 
off);
+   break;
+   case GPIOF_DRIVE_STRONG:
+   case GPIOF_DRIVE_HIZ:
+   ret = pca953x_read_single(chip, PCA953X_PUPD_EN, , off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_EN, 0, 
off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 
val, off);
+   break;
+   default:
+   ret = -EINVAL;
+   }
+
+   mutex_unlock(>i2c_lock);
+   return ret;
+}
+
 static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
 {
struct gpio_chip *gc;
@@ -393,6 +433,9 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, 
int gpios)
gc->dev = >client->dev;
gc->owner = THIS_MODULE;
gc->names = chip->names;
+
+   if (chip->chip_type == PCA953X_TYPE)
+   gc->set_drive = pca953x_gpio_set_drive;
 }
 
 #ifdef CONFIG_GPIO_PCA953X_IRQ
@@ -552,7 +595,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 }
 
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int irq_base)
 {
struct i2c_client *client = chip->client;
int ret, i, offset = 0;
@@ -595,10 +638,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
}
 
ret =  gpiochip_irqchip_add(>gpio_chip,
-   _irq_chip,
-   irq_base,
-   handle_simple_irq,
-   IRQ_TYPE_NONE);
+   _irq_chip,
+   irq_base,
+   handle_simple_irq,
+   IRQ_TYPE_NONE);
if (ret) {
dev_err(>dev,
"could not connect irqchip to gpiochip\n");
@@ -615,7 +658,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 
 #else /* CONFIG_GPIO_PCA953X_IRQ */
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int irq_base)
 {
struct i2c_client *client = chip->client;
 
@@ -636,7 +679,7 @@ static int device_pca953x_init(struct pca953x_chip *chip, 
u32 invert)
goto out;
 
ret = pca953x_read_regs(chip, PCA953X_DIRECTION,
-  chip->reg_direction);
+  chip->reg_direction);
   

[linux-yocto] [PATCH 3/7 v2] pca9685: PCA9685 PWM and GPIO multi-function device.

2016-02-19 Thread Saul Wold
From: Josef Ahmad <josef.ah...@linux.intel.com>

There is also a driver for the same chip in drivers/pwm. This version
has support for setting the output in GPIO mode in addition to the PWM
mode.

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP.
 Inappropriate to the upstream kernel, because the
 upstream kernel already uses a different (non-mfd)
 driver for handling the same chip, and doesn't need
 to be backwards compatible.

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/mfd/Kconfig   |  10 ++
 drivers/mfd/Makefile  |   2 +
 drivers/mfd/pca9685-core.c| 308 ++
 drivers/mfd/pca9685-gpio.c| 108 
 drivers/mfd/pca9685-pwm.c | 262 +
 drivers/mfd/pca9685.h | 110 
 include/linux/platform_data/pca9685.h |  51 ++
 7 files changed, 851 insertions(+)
 create mode 100644 drivers/mfd/pca9685-core.c
 create mode 100644 drivers/mfd/pca9685-gpio.c
 create mode 100644 drivers/mfd/pca9685-pwm.c
 create mode 100644 drivers/mfd/pca9685.h
 create mode 100644 include/linux/platform_data/pca9685.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index d5ad04d..a7983b2 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -334,6 +334,16 @@ config MFD_INTEL_MSIC
  Passage) chip. This chip embeds audio, battery, GPIO, etc.
  devices used in Intel Medfield platforms.
 
+config MFD_PCA9685
+   tristate "NPX Semiconductors PCA9685 (PWM/GPIO) driver"
+   depends on GPIOLIB && I2C && PWM
+   select REGMAP_I2C
+   help
+ NPX PCA9685 I2C-bus PWM controller with GPIO output interface support.
+ The I2C-bus LED controller provides 16-channel, 12-bit PWM Fm+.
+ Additionally, the driver allows the channels to be configured as GPIO
+ interface (output only).
+
 config MFD_IPAQ_MICRO
bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
depends on SA1100_H3100 || SA1100_H3600
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 0e5cfeb..d043a1b 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -138,6 +138,8 @@ obj-$(CONFIG_MFD_DB8500_PRCMU)  += db8500-prcmu.o
 obj-$(CONFIG_AB8500_CORE)  += ab8500-core.o ab8500-sysctrl.o
 obj-$(CONFIG_MFD_TIMBERDALE)+= timberdale.o
 obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
+pca9685-objs   := pca9685-core.o pca9685-gpio.o pca9685-pwm.o
+obj-$(CONFIG_MFD_PCA9685)  += pca9685.o
 obj-$(CONFIG_MFD_KEMPLD)   += kempld-core.o
 obj-$(CONFIG_MFD_INTEL_QUARK_I2C_GPIO) += intel_quark_i2c_gpio.o
 obj-$(CONFIG_LPC_SCH)  += lpc_sch.o
diff --git a/drivers/mfd/pca9685-core.c b/drivers/mfd/pca9685-core.c
new file mode 100644
index 000..3f63b6d
--- /dev/null
+++ b/drivers/mfd/pca9685-core.c
@@ -0,0 +1,308 @@
+/*
+ * Driver for NPX PCA9685 I2C-bus PWM controller with GPIO output interface
+ * support.
+ *
+ * Copyright(c) 2013-2015 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * The I2C-bus LED controller provides 16-channel, 12-bit PWM Fm+.
+ * Additionally, the driver allows the channels to be configured as GPIO
+ * interface (output only).
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pca9685.h"
+
+static unsigned int en_invrt;
+module_param(en_invrt, uint, 0);
+MODULE_PARM_DESC(en_invrt, "Enable output logic state inverted mode");
+
+static unsigned int en_open_dr;
+module_param(en_open_dr, uint, 0);
+MODULE_PARM_DESC(en_open_dr,
+   "The outputs are configured with an open-drain structure");
+
+static int gpio_base = -1; /*  requests dynamic ID allocation */
+module_param(gpio_base, int, 0);
+MODULE_PARM_DESC(gpio_base, "GPIO base number");
+
+static unsigned int pwm_period = PWM_PERIOD_DEF; /* PWM clock period */
+module_param(pwm_period, uint, 0);
+MODULE_PARM_DESC(pwm_period, "PWM clock period (nanoseconds)");
+
+static bool pca9685_register_volatile(struct device *dev, unsigned int reg)
+{
+   if (unlikely(reg == PCA9685_MODE1))
+   return true;
+   else
+   return false;
+}
+
+static struct regmap_config pca9685_regmap_i2c_config = {
+   .reg_bits = 8,
+   .val_

[linux-yocto] [PATCH 5/7 v2] staging:iio: add support for ADC1x8s102.

2016-02-19 Thread Saul Wold
From: Todor Minchev <to...@minchev.co.uk>

Adds new config and support for Texas Instruments ADC1x8S102 driver"

config ADC1x8S102
tristate "Texas Instruments ADC1x8S102 driver"
depends on SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Texas Instruments ADC1x8S102 
ADC.
Provides direct access via sysfs.

To compile this driver as a module, choose M here: the module 
will
be called adc1x8s102

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP

Original author is Bogdan Pricop <bogdan.pri...@emutex.com>.
Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/staging/iio/adc/Kconfig  |  13 ++
 drivers/staging/iio/adc/Makefile |   1 +
 drivers/staging/iio/adc/adc1x8s102.c | 387 +++
 include/linux/platform_data/adc1x8s102.h |  30 +++
 4 files changed, 431 insertions(+)
 create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
 create mode 100644 include/linux/platform_data/adc1x8s102.h

diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index d0016ce..7d295a6 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -115,4 +115,17 @@ config SPEAR_ADC
 
  To compile this driver as a module, choose M here: the
  module will be called spear_adc.
+
+config ADC1x8S102
+   tristate "Texas Instruments ADC1x8S102 driver"
+   depends on SPI
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+   help
+   Say yes here to build support for Texas Instruments ADC1x8S102 
ADC.
+   Provides direct access via sysfs.
+
+   To compile this driver as a module, choose M here: the module 
will
+   be called adc1x8s102
+
 endmenu
diff --git a/drivers/staging/iio/adc/Makefile b/drivers/staging/iio/adc/Makefile
index 1c4277d..3fe3880 100644
--- a/drivers/staging/iio/adc/Makefile
+++ b/drivers/staging/iio/adc/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_AD7280) += ad7280a.o
 obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o
 obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o
 obj-$(CONFIG_SPEAR_ADC) += spear_adc.o
+obj-$(CONFIG_ADC1x8S102) += adc1x8s102.o
diff --git a/drivers/staging/iio/adc/adc1x8s102.c 
b/drivers/staging/iio/adc/adc1x8s102.c
new file mode 100644
index 000..52472e2
--- /dev/null
+++ b/drivers/staging/iio/adc/adc1x8s102.c
@@ -0,0 +1,387 @@
+/*
+ * ADC1x8S102 SPI ADC driver
+ *
+ * Copyright(c) 2013 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * This IIO device driver is is designed to work with the following
+ * analog to digital converters from Texas Instruments:
+ *  ADC108S102
+ *  ADC128S102
+ * The communication with ADC chip is via the SPI bus (mode 3).
+ */
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/*
+ * Defining the ADC resolution being 12 bits, we can use the same driver for
+ * both ADC108S102 (10 bits resolution) and ADC128S102 (12 bits resolution)
+ * chips. The ADC108S102 effectively returns a 12-bit result with the 2
+ * least-significant bits unset.
+ */
+#define ADC1x8S102_BITS12
+#define ADC1x8S102_MAX_CHANNELS8
+
+/* 16-bit SPI command format:
+ *   [15:14] Ignored
+ *   [13:11] 3-bit channel address
+ *   [10:0]  Ignored
+ */
+#define ADC1x8S102_CMD(ch) (((ch) << (8)) << (3))
+
+/*
+ * 16-bit SPI response format:
+ *   [15:12] Zeros
+ *   [11:0]  12-bit ADC sample (for ADC108S102, [1:0] will always be 0).
+ */
+#define ADC1x8S102_RES_DATA(res)   (res & ((1 << ADC1x8S102_BITS) - 1))
+
+struct adc1x8s102_state {
+   struct spi_device   *spi;
+   struct regulator*reg;
+   u16 ext_vin;
+   /* SPI transfer used by triggered buffer handler*/
+   struct spi_transfer ring_xfer;
+   /* SPI transfer used by direct scan */
+   struct spi_transfer scan_single_xfer;
+   /* SPI message used by ring_xfer SPI transfer */
+   struct spi_message  ring_msg;
+   /* SPI message used by scan_single_xfer SPI transfer */
+   struct spi_message  scan_single_msg;
+
+   /* SPI message buffers:
+*  tx_buf: |C0|C1|C2|C3|C4|C5|C6|C7|XX|
+*  rx_buf: |X

[linux-yocto] [PATCH 7/7 v2] gpio-pca953x: add "drive" property.

2016-02-19 Thread Saul Wold
From: Ismo Puustinen <ismo.puusti...@intel.com>

Galileo gen 2 has support for setting GPIO modes. Expose these
properties through the GPIO sysfs interface. This approach is bit hacky,
since it changes the interface semantics.

Original patch by Josef Ahmad <josef.ah...@linux.intel.com>.

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP.
 Inappropriate for Linux upstream, since it changes the
 sysfs GPIO userspace API. We need to keep this for
 backwards compatibility. A better solution would be to
 implement a pin control driver to handle the drive
 states of the GPIO pins, but there isn't a userspace
 interface yet for that.

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpio-pca953x.c   | 57 +++
 drivers/gpio/gpiolib-sysfs.c  | 78 +++
 drivers/gpio/gpiolib.c| 18 ++
 drivers/gpio/gpiolib.h|  7 +++-
 include/asm-generic/gpio.h|  5 +++
 include/linux/gpio.h  | 10 ++
 include/linux/gpio/consumer.h | 11 ++
 include/linux/gpio/driver.h   |  2 ++
 8 files changed, 180 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 0227cde..8f49bd6 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -39,6 +39,9 @@
 #define PCA957X_MSK6
 #define PCA957X_INTS   7
 
+#define PCA953X_PUPD_EN35
+#define PCA953X_PUPD_SEL   36
+
 #define PCA_GPIO_MASK  0x00FF
 #define PCA_INT0x0100
 #define PCA953X_TYPE   0x1000
@@ -374,6 +377,43 @@ exit:
mutex_unlock(>i2c_lock);
 }
 
+static int pca953x_gpio_set_drive(struct gpio_chip *gc,
+unsigned off, unsigned mode)
+{
+   struct pca953x_chip *chip;
+   int ret = 0;
+   int val;
+
+   chip = container_of(gc, struct pca953x_chip, gpio_chip);
+
+   if (chip->chip_type != PCA953X_TYPE)
+   return -EINVAL;
+
+   mutex_lock(>i2c_lock);
+
+   switch (mode) {
+   case GPIOF_DRIVE_PULLUP:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 1, 
off);
+   break;
+   case GPIOF_DRIVE_PULLDOWN:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 0, 
off);
+   break;
+   case GPIOF_DRIVE_STRONG:
+   case GPIOF_DRIVE_HIZ:
+   ret = pca953x_read_single(chip, PCA953X_PUPD_EN, , off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_EN, 0, 
off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 
val, off);
+   break;
+   default:
+   ret = -EINVAL;
+   }
+
+   mutex_unlock(>i2c_lock);
+   return ret;
+}
+
 static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
 {
struct gpio_chip *gc;
@@ -392,6 +432,9 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, 
int gpios)
gc->dev = >client->dev;
gc->owner = THIS_MODULE;
gc->names = chip->names;
+
+   if (chip->chip_type == PCA953X_TYPE)
+   gc->set_drive = pca953x_gpio_set_drive;
 }
 
 #ifdef CONFIG_GPIO_PCA953X_IRQ
@@ -548,7 +591,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 }
 
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int irq_base)
 {
struct i2c_client *client = chip->client;
int ret, i, offset = 0;
@@ -591,10 +634,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
}
 
ret =  gpiochip_irqchip_add(>gpio_chip,
-   _irq_chip,
-   irq_base,
-   handle_simple_irq,
-   IRQ_TYPE_NONE);
+   _irq_chip,
+   irq_base,
+   handle_simple_irq,
+   IRQ_TYPE_NONE);
if (ret) {
dev_err(>dev,
"could not connect irqchip to gpiochip\n");
@@ -607,7 +650,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 
 #else /* CONFIG_GPIO_PCA953X_IRQ */
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int ir

[linux-yocto] [PATCH 1/7 v2] acpi: added a custom DSDT file.

2016-02-19 Thread Saul Wold
From: Ismo Puustinen <ismo.puusti...@intel.com>

The file has fixed GPIO IRQ assignment and moved SPI devices to be under
the SPI bus in the ACPI definitions as assumed by ACPI version 5.

Upstream-status: Inappropriate, custom firmware

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 include/DSDT.hex | 1191 ++
 1 file changed, 1191 insertions(+)
 create mode 100644 include/DSDT.hex

diff --git a/include/DSDT.hex b/include/DSDT.hex
new file mode 100644
index 000..b1e2960
--- /dev/null
+++ b/include/DSDT.hex
@@ -0,0 +1,1191 @@
+/*
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, 
this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * 
+ * Intel ACPI Component Architecture
+ * ASL+ Optimizing Compiler version 20150515-64
+ * Copyright (c) 2000 - 2015 Intel Corporation
+ * 
+ * Compilation of "dsdt-fixed-spi.dsl" - Wed Sep 23 12:49:37 2015
+ * 
+ * C source code output
+ * AML code block contains 0x23F5 bytes
+ *
+ */
+unsigned char AmlCode[] =
+{
+0x44,0x53,0x44,0x54,0xF5,0x23,0x00,0x00,  /* "DSDT.#.." */
+0x01,0xD3,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 0008"..INTEL " */
+0x51,0x75,0x61,0x72,0x6B,0x4E,0x63,0x53,  /* 0010"QuarkNcS" */
+0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 0018"INTL" */
+0x15,0x05,0x15,0x20,0x08,0x47,0x50,0x49,  /* 0020"... .GPI" */
+0x43,0x00,0x5B,0x80,0x44,0x42,0x47,0x30,  /* 0028"C.[.DBG0" */
+0x01,0x0A,0x80,0x01,0x5B,0x81,0x0B,0x44,  /* 0030"[..D" */
+0x42,0x47,0x30,0x01,0x49,0x4F,0x38,0x30,  /* 0038"BG0.IO80" */
+0x08,0x5B,0x80,0x41,0x43,0x4D,0x53,0x01,  /* 0040".[.ACMS." */
+0x0A,0x72,0x0A,0x02,0x5B,0x81,0x10,0x41,  /* 0048".r..[..A" */
+0x43,0x4D,0x53,0x01,0x49,0x4E,0x44,0x58,  /* 0050"CMS.INDX" */
+0x08,0x44,0x41,0x54,0x41,0x08,0x5B,0x80,  /* 0058".DATA.[." */
+0x4D,0x4E,0x56,0x53,0x00,0x0C,0x90,0x8C,  /* 0060"MNVS" */
+0x1C,0x0F,0x0B,0x00,0x02,0x5B,0x81,0x45,  /* 0068".[.E" */
+0x07,0x4D,0x4E,0x56,0x53,0x01,0x4F,0x53,  /* 0070".MNVS.OS" */
+0x54,0x50,0x20,0x43,0x46,0x47,0x44,0x20,  /* 0078"TP CFGD " */
+0x48,0x50,0x45,0x41,0x20,0x50,0x31,0x42,  /* 0080"HPEA P1B" */
+0x42,0x20,0x50,0x42,0x41,0x42,0x20,0x47,  /* 0088"B PBAB G" */
+0x50,0x30,0x42,0x20,0x47,0x50,0x41,0x42,  /* 0090"P0B GPAB" */
+0x20,0x53,0x4D,0x42,0x42,0x20,0x4E,0x52,  /* 0098" SMBB NR" */
+0x56,0x31,0x20,0x57,0x44,0x54,0x42,0x20,  /* 00A0"V1 WDTB " */
+0x48,0x50,0x54,0x42,0x20,0x48,0x50,0x54,  /* 00A8"HPTB HPT" */
+0x53,0x20,0x50,0x45,0x58,0x42,0x20,0x50,  /* 00B0"S PEXB P" */
+0x45,0x58,0x53,0x20,0x52,0x43,0x42,0x42,  /* 00B8"EXS RCBB" */
+0x20,0x52,0x43,0x42,0x53,0x20,0x41,0x50,  /* 00C0" RCBS AP" */
+0x43,0x42,0x20,0x41,0x50,0x43,0x53,0x20,  /* 00C8"CB APCS " */
+0x54,0x50,0x4D,0x50,0x20,0x44,0x42,0x47,  /* 00D0"TPMP DBG" */
+0x50,0x20,0x50,0x54,0x59,0x50,0x20,0x41,  /* 00D8"P PTYP A" */
+0x4C,0x54,0x53,0x20,0x5B,0x80,0x47,0x50,  /* 00E0"LTS [.GP" */
+0x45,0x42,0x01,0x0B,0x00,0x11,0x0A,0x40,  

[linux-yocto] [PATCH 4/7 v2] spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.

2016-02-19 Thread Saul Wold
From: Ismo Puustinen <ismo.puusti...@intel.com>

Slave devices were not enumerated by ACPI data because the ACPI handle
for the spi-pxa2xx controller was NULL if it was itself enumerated by
PCI.

Original patch by Mika Westerberg <mika.westerb...@intel.com>.

Upstream-status: Inappropriate, will be fixed with a bigger overhaul of
 SPI/ACPI interaction.

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/spi/spi-pxa2xx-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index fa7399e..c5a7111 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -170,6 +170,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
memset(, 0, sizeof(pi));
pi.parent = >dev;
pi.name = "pxa2xx-spi";
+   pi.fwnode = dev->dev.fwnode;
pi.id = ssp->port_id;
pi.data = _pdata;
pi.size_data = sizeof(spi_pdata);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/7 v2] gpio: pca953x: provide GPIO base based on _UID

2016-02-19 Thread Saul Wold
From: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Custom kernel for Intel Galileo Gen2 provides and moreover libmraa relies on
the continuous GPIO space. To do such we have to configure GPIO base per each
GPIO expander. The only value we can use is the ACPI _UID.

Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Upstream-status: Inappropriate, custom code for legacy userspace
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpio-pca953x.c | 44 +---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 32a56d5..0227cde 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -76,12 +76,6 @@ static const struct i2c_device_id pca953x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pca953x_id);
 
-static const struct acpi_device_id pca953x_acpi_ids[] = {
-   { "INT3491", 16 | PCA953X_TYPE | PCA_INT, },
-   { }
-};
-MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
-
 #define MAX_BANK 5
 #define BANK_SZ 8
 
@@ -108,6 +102,35 @@ struct pca953x_chip {
unsigned long driver_data;
 };
 
+struct pca953x_info {
+   kernel_ulong_t driver_data;
+   void (*setup)(struct pca953x_chip *chip);
+};
+
+static void pca953x_setup_int3491(struct pca953x_chip *chip)
+{
+   struct acpi_device *adev = ACPI_COMPANION(>client->dev);
+   unsigned int uid;
+
+   if (kstrtouint(acpi_device_uid(adev), 0, ) || !uid--)
+   return;
+
+   chip->gpio_start = 8 /* sch_gpio */ +
+  8 /* gpio-dwapb */ +
+ 16 /* pca9535 */ * uid;
+}
+
+static const struct pca953x_info pca953x_info_int3491 = {
+   .driver_data = 16 | PCA953X_TYPE | PCA_INT,
+   .setup = pca953x_setup_int3491,
+};
+
+static const struct acpi_device_id pca953x_acpi_ids[] = {
+   { "INT3491",  (kernel_ulong_t)_info_int3491 },
+   { }
+};
+MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
+
 static inline struct pca953x_chip *to_pca(struct gpio_chip *gc)
 {
return container_of(gc, struct pca953x_chip, gpio_chip);
@@ -679,12 +702,19 @@ static int pca953x_probe(struct i2c_client *client,
chip->driver_data = id->driver_data;
} else {
const struct acpi_device_id *id;
+   const struct pca953x_info *info;
 
id = acpi_match_device(pca953x_acpi_ids, >dev);
if (!id)
return -ENODEV;
 
-   chip->driver_data = id->driver_data;
+   info = (struct pca953x_info *)id->driver_data;
+   if (!info)
+   return -ENODEV;
+
+   chip->driver_data = info->driver_data;
+   if (info->setup)
+   info->setup(chip);
}
 
chip->chip_type = PCA_CHIP_TYPE(chip->driver_data);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 6/7 v2] adc1x8s102: support ACPI-based enumeration.

2016-02-19 Thread Saul Wold
From: Ismo Puustinen <ismo.puusti...@intel.com>

Upstream-status: Pending for ADC1x8s102 patch upstreaming to Linux kernel

Signed-off-by: Ismo Puustinen <ismo.puusti...@intel.com>
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/staging/iio/adc/adc1x8s102.c | 76 ++--
 1 file changed, 63 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/iio/adc/adc1x8s102.c 
b/drivers/staging/iio/adc/adc1x8s102.c
index 52472e2..881b145 100644
--- a/drivers/staging/iio/adc/adc1x8s102.c
+++ b/drivers/staging/iio/adc/adc1x8s102.c
@@ -1,7 +1,7 @@
 /*
  * ADC1x8S102 SPI ADC driver
  *
- * Copyright(c) 2013 Intel Corporation.
+ * Copyright(c) 2013-2015 Intel Corporation.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -33,6 +33,13 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
 /*
  * Defining the ADC resolution being 12 bits, we can use the same driver for
  * both ADC108S102 (10 bits resolution) and ADC128S102 (12 bits resolution)
@@ -259,14 +266,60 @@ static const struct iio_info adc1x8s102_info = {
.driver_module  = THIS_MODULE,
 };
 
+struct adc1x8s102_spi_info {
+   kernel_ulong_t driver_data;
+   void (*setup)(struct spi_device *spi);
+};
+
+static void adc1x8s102_setup_int3495(struct spi_device *spi)
+{
+   /* Galileo Gen 2 SPI setup */
+
+#define ADC1x8S102_GALILEO2_CS 8
+
+   struct pxa2xx_spi_chip *chip_data;
+   chip_data = devm_kzalloc(>dev, sizeof(*chip_data), GFP_KERNEL);
+
+   if (chip_data) {
+   chip_data->gpio_cs = ADC1x8S102_GALILEO2_CS;
+   spi->controller_data = chip_data;
+   dev_info(>dev, "setting GPIO CS value to %d\n", 
chip_data->gpio_cs);
+   spi_setup(spi);
+   }
+}
+
+static const struct adc1x8s102_spi_info adc1x8s102_info_int3495 = {
+   .driver_data = 0,
+   .setup = adc1x8s102_setup_int3495,
+};
+
+static const struct acpi_device_id adc1x8s102_acpi_ids[] = {
+   { "INT3495",  (kernel_ulong_t)_info_int3495 },
+   { }
+};
+MODULE_DEVICE_TABLE(acpi, adc1x8s102_acpi_ids);
 
 static int adc1x8s102_probe(struct spi_device *spi)
 {
struct adc1x8s102_platform_data *pdata = spi->dev.platform_data;
struct adc1x8s102_state *st;
struct iio_dev *indio_dev = iio_device_alloc(sizeof(*st));
+   const struct acpi_device_id *id;
int ret;
 
+   id = acpi_match_device(adc1x8s102_acpi_ids, >dev);
+
+   if (id) {
+   const struct adc1x8s102_spi_info *info =
+   (struct adc1x8s102_spi_info *)id->driver_data;
+
+   if (!info)
+   return -ENODEV;
+
+   if (info->setup)
+   info->setup(spi);
+   }
+
if (NULL == indio_dev) {
dev_crit(>dev, "Cannot allocate memory for indio_dev\n");
return -ENOMEM;
@@ -274,10 +327,13 @@ static int adc1x8s102_probe(struct spi_device *spi)
 
st = iio_priv(indio_dev);
if (NULL == pdata) {
-   dev_err(>dev, "Cannot get adc1x8s102 platform data\n");
-   return -EFAULT;
+   dev_warn(>dev, "Cannot get adc1x8s102 platform data\n");
+   /* FIXME: make this ACPI-dependent */
+   st->ext_vin = 5000;
+   }
+   else {
+   st->ext_vin = pdata->ext_vin;
}
-   st->ext_vin = pdata->ext_vin;
 
/* Use regulator, if available. */
st->reg = regulator_get(>dev, "vref");
@@ -297,7 +353,7 @@ static int adc1x8s102_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->spi = spi;
 
-   indio_dev->name = spi_get_device_id(spi)->name;
+   indio_dev->name = spi->modalias;
indio_dev->dev.parent = >dev;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = adc1x8s102_channels;
@@ -365,20 +421,14 @@ static int adc1x8s102_remove(struct spi_device *spi)
 }
 
 
-static const struct spi_device_id adc1x8s102_id[] = {
-   {"adc1x8s102", 0},
-   {}
-};
-MODULE_DEVICE_TABLE(spi, adc1x8s102_id);
-
 static struct spi_driver adc1x8s102_driver = {
.driver = {
-   .name   = "adc1x8s102",
+   .name   = "adc1x8s102",
.owner  = THIS_MODULE,
+   .acpi_match_table = ACPI_PTR(adc1x8s102_acpi_ids),
},
.probe  = adc1x8s102_probe,
.remove = adc1x8s102_remove,
-   .id_table   = adc1x8s102_id,
 };
 module_spi_driver(adc1x8s102_driver);
 
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 0/7 v2] Galileo Patches - non-upstreamed

2016-02-19 Thread Saul Wold
Bruce,

This is  this is a set of patches for 4.1, there is another similar 
that I will be sending shortly for 4.4. The only difference between 
the 4.1 and 4.4 patch set is 07/07 gpio-pca953x does not apply to 4.4,
the other 6 do

These patches are mostly targeted to Galileo Gen2 and deal with the
SPI/PWN/GPIO devices.

Sau!

Andy Shevchenko (1):
  gpio: pca953x: provide GPIO base based on _UID

Ismo Puustinen (4):
  acpi: added a custom DSDT file.
  spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.
  adc1x8s102: support ACPI-based enumeration.
  gpio-pca953x: add "drive" property.

Josef Ahmad (1):
  pca9685: PCA9685 PWM and GPIO multi-function device.

Todor Minchev (1):
  staging:iio: add support for ADC1x8s102.

 drivers/gpio/gpio-pca953x.c  |  101 ++-
 drivers/gpio/gpiolib-sysfs.c |   78 ++
 drivers/gpio/gpiolib.c   |   18 +
 drivers/gpio/gpiolib.h   |7 +-
 drivers/mfd/Kconfig  |   10 +
 drivers/mfd/Makefile |2 +
 drivers/mfd/pca9685-core.c   |  308 
 drivers/mfd/pca9685-gpio.c   |  108 +++
 drivers/mfd/pca9685-pwm.c|  262 +++
 drivers/mfd/pca9685.h|  110 +++
 drivers/spi/spi-pxa2xx-pci.c |1 +
 drivers/staging/iio/adc/Kconfig  |   13 +
 drivers/staging/iio/adc/Makefile |1 +
 drivers/staging/iio/adc/adc1x8s102.c |  437 +++
 include/DSDT.hex | 1191 ++
 include/asm-generic/gpio.h   |5 +
 include/linux/gpio.h |   10 +
 include/linux/gpio/consumer.h|   11 +
 include/linux/gpio/driver.h  |2 +
 include/linux/platform_data/adc1x8s102.h |   30 +
 include/linux/platform_data/pca9685.h|   51 ++
 21 files changed, 2741 insertions(+), 15 deletions(-)
 create mode 100644 drivers/mfd/pca9685-core.c
 create mode 100644 drivers/mfd/pca9685-gpio.c
 create mode 100644 drivers/mfd/pca9685-pwm.c
 create mode 100644 drivers/mfd/pca9685.h
 create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
 create mode 100644 include/DSDT.hex
 create mode 100644 include/linux/platform_data/adc1x8s102.h
 create mode 100644 include/linux/platform_data/pca9685.h

-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH 0/7] Galileo Patches - non-upstreamed

2016-02-17 Thread Saul Wold
On Wed, 2016-02-17 at 11:25 -0500, Bruce Ashfield wrote:
> On 16-02-16 05:01 PM, Saul Wold wrote:
> > Bruce,
> > 
> > This is  this is a set of patches for 4.1, there is another similar
> > that I will be sending shortly for 4.4. The only difference between
> > the 4.1 and 4.4 patch set is 07/07 gpio-pca953x does not apply to
> > 4.4,
> > the other 6 do
> > 
> > These patches are mostly targeted to Galileo Gen2 and deal with the
> > SPI/PWN/GPIO devices.
> 
> At a glance, the patches seem reasonable, but I can't say that I know
> if there are any other users of those same devices. In the linux-
> yocto
> context, I doubt very much that there are any other users.
> 
> I made some minor comments on the way through the series.
> 
> One other comment is that your Signed-off-by: isn't on the patches.
> Since you've handled them, and know their source, it is worth adding
> your name to the Sign offs.
> 
Yeah, agreed, I will add them for a v2 set once I get the updated
commit messages from Ismo who as been doing most of the legwork on
tracking the source of these patches.

Sau!

> > 
> > If we need to put these in a Galiloe branch vs standard/base, let
> > me know how to proceed.
> 
> We'd only need a BSP branch, if there turns out to be any conflicts
> with other users.
> 
> I'm willing to keep it simple and just use standard/base and deal
> with
> any runtime issues if they pop up.
> 
> Bruce
> 
> > 
> > Sau!
> > 
> > Andy Shevchenko (1):
> >    gpio: pca953x: provide GPIO base based on _UID
> > 
> > Ismo Puustinen (4):
> >    acpi: added a custom DSDT file.
> >    spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.
> >    adc1x8s102: support ACPI-based enumeration.
> >    gpio-pca953x: add "drive" property.
> > 
> > Josef Ahmad (1):
> >    pca9685: PCA9685 PWM and GPIO multi-function device.
> > 
> > Todor Minchev (1):
> >    staging:iio: add support for ADC1x8s102.
> > 
> >   drivers/gpio/gpio-pca953x.c  |  101 ++-
> >   drivers/gpio/gpiolib-sysfs.c |   78 ++
> >   drivers/gpio/gpiolib.c   |   18 +
> >   drivers/gpio/gpiolib.h   |7 +-
> >   drivers/mfd/Kconfig  |   10 +
> >   drivers/mfd/Makefile |2 +
> >   drivers/mfd/pca9685-core.c   |  308 
> >   drivers/mfd/pca9685-gpio.c   |  108 +++
> >   drivers/mfd/pca9685-pwm.c|  262 +++
> >   drivers/mfd/pca9685.h|  110 +++
> >   drivers/spi/spi-pxa2xx-pci.c |1 +
> >   drivers/staging/iio/adc/Kconfig  |   13 +
> >   drivers/staging/iio/adc/Makefile |1 +
> >   drivers/staging/iio/adc/adc1x8s102.c |  437 +++
> >   include/DSDT.hex | 1191
> > ++
> >   include/asm-generic/gpio.h   |5 +
> >   include/linux/gpio.h |   10 +
> >   include/linux/gpio/consumer.h|   11 +
> >   include/linux/gpio/driver.h  |2 +
> >   include/linux/platform_data/adc1x8s102.h |   30 +
> >   include/linux/platform_data/pca9685.h|   51 ++
> >   21 files changed, 2741 insertions(+), 15 deletions(-)
> >   create mode 100644 drivers/mfd/pca9685-core.c
> >   create mode 100644 drivers/mfd/pca9685-gpio.c
> >   create mode 100644 drivers/mfd/pca9685-pwm.c
> >   create mode 100644 drivers/mfd/pca9685.h
> >   create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
> >   create mode 100644 include/DSDT.hex
> >   create mode 100644 include/linux/platform_data/adc1x8s102.h
> >   create mode 100644 include/linux/platform_data/pca9685.h
> > 
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 3/7] pca9685: PCA9685 PWM and GPIO multi-function device.

2016-02-16 Thread Saul Wold
From: Josef Ahmad 

There is also a driver for the same chip in drivers/pwm. This version
has support for setting the output in GPIO mode in addition to the PWM
mode.

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP

Signed-off-by: Ismo Puustinen 
---
 drivers/mfd/Kconfig   |  10 ++
 drivers/mfd/Makefile  |   2 +
 drivers/mfd/pca9685-core.c| 308 ++
 drivers/mfd/pca9685-gpio.c| 108 
 drivers/mfd/pca9685-pwm.c | 262 +
 drivers/mfd/pca9685.h | 110 
 include/linux/platform_data/pca9685.h |  51 ++
 7 files changed, 851 insertions(+)
 create mode 100644 drivers/mfd/pca9685-core.c
 create mode 100644 drivers/mfd/pca9685-gpio.c
 create mode 100644 drivers/mfd/pca9685-pwm.c
 create mode 100644 drivers/mfd/pca9685.h
 create mode 100644 include/linux/platform_data/pca9685.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index d5ad04d..a7983b2 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -334,6 +334,16 @@ config MFD_INTEL_MSIC
  Passage) chip. This chip embeds audio, battery, GPIO, etc.
  devices used in Intel Medfield platforms.
 
+config MFD_PCA9685
+   tristate "NPX Semiconductors PCA9685 (PWM/GPIO) driver"
+   depends on GPIOLIB && I2C && PWM
+   select REGMAP_I2C
+   help
+ NPX PCA9685 I2C-bus PWM controller with GPIO output interface support.
+ The I2C-bus LED controller provides 16-channel, 12-bit PWM Fm+.
+ Additionally, the driver allows the channels to be configured as GPIO
+ interface (output only).
+
 config MFD_IPAQ_MICRO
bool "Atmel Micro ASIC (iPAQ h3100/h3600/h3700) Support"
depends on SA1100_H3100 || SA1100_H3600
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 0e5cfeb..d043a1b 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -138,6 +138,8 @@ obj-$(CONFIG_MFD_DB8500_PRCMU)  += db8500-prcmu.o
 obj-$(CONFIG_AB8500_CORE)  += ab8500-core.o ab8500-sysctrl.o
 obj-$(CONFIG_MFD_TIMBERDALE)+= timberdale.o
 obj-$(CONFIG_PMIC_ADP5520) += adp5520.o
+pca9685-objs   := pca9685-core.o pca9685-gpio.o pca9685-pwm.o
+obj-$(CONFIG_MFD_PCA9685)  += pca9685.o
 obj-$(CONFIG_MFD_KEMPLD)   += kempld-core.o
 obj-$(CONFIG_MFD_INTEL_QUARK_I2C_GPIO) += intel_quark_i2c_gpio.o
 obj-$(CONFIG_LPC_SCH)  += lpc_sch.o
diff --git a/drivers/mfd/pca9685-core.c b/drivers/mfd/pca9685-core.c
new file mode 100644
index 000..3f63b6d
--- /dev/null
+++ b/drivers/mfd/pca9685-core.c
@@ -0,0 +1,308 @@
+/*
+ * Driver for NPX PCA9685 I2C-bus PWM controller with GPIO output interface
+ * support.
+ *
+ * Copyright(c) 2013-2015 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * The I2C-bus LED controller provides 16-channel, 12-bit PWM Fm+.
+ * Additionally, the driver allows the channels to be configured as GPIO
+ * interface (output only).
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pca9685.h"
+
+static unsigned int en_invrt;
+module_param(en_invrt, uint, 0);
+MODULE_PARM_DESC(en_invrt, "Enable output logic state inverted mode");
+
+static unsigned int en_open_dr;
+module_param(en_open_dr, uint, 0);
+MODULE_PARM_DESC(en_open_dr,
+   "The outputs are configured with an open-drain structure");
+
+static int gpio_base = -1; /*  requests dynamic ID allocation */
+module_param(gpio_base, int, 0);
+MODULE_PARM_DESC(gpio_base, "GPIO base number");
+
+static unsigned int pwm_period = PWM_PERIOD_DEF; /* PWM clock period */
+module_param(pwm_period, uint, 0);
+MODULE_PARM_DESC(pwm_period, "PWM clock period (nanoseconds)");
+
+static bool pca9685_register_volatile(struct device *dev, unsigned int reg)
+{
+   if (unlikely(reg == PCA9685_MODE1))
+   return true;
+   else
+   return false;
+}
+
+static struct regmap_config pca9685_regmap_i2c_config = {
+   .reg_bits = 8,
+   .val_bits = 8,
+   .max_register = PCA9685_NUMREGS,
+   .volatile_reg = pca9685_register_volatile,
+   .cache_type   = REGCACHE_RBTREE,
+};
+
+ssize_t pca9685_pwm_period_sysfs_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+   struct pca9685 *pca = dev_get_drvdata(dev);
+
+   return 

[linux-yocto] [PATCH 1/7] acpi: added a custom DSDT file.

2016-02-16 Thread Saul Wold
From: Ismo Puustinen 

The file has fixed GPIO IRQ assignment and moved SPI devices to be under
the SPI bus in the ACPI definitions as assumed by ACPI version 5.

Upstream-status: Inappropriate, custom firmware

Signed-off-by: Ismo Puustinen 
---
 include/DSDT.hex | 1191 ++
 1 file changed, 1191 insertions(+)
 create mode 100644 include/DSDT.hex

diff --git a/include/DSDT.hex b/include/DSDT.hex
new file mode 100644
index 000..b1e2960
--- /dev/null
+++ b/include/DSDT.hex
@@ -0,0 +1,1191 @@
+/*
+ * Copyright (c) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, 
this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * 
+ * Intel ACPI Component Architecture
+ * ASL+ Optimizing Compiler version 20150515-64
+ * Copyright (c) 2000 - 2015 Intel Corporation
+ * 
+ * Compilation of "dsdt-fixed-spi.dsl" - Wed Sep 23 12:49:37 2015
+ * 
+ * C source code output
+ * AML code block contains 0x23F5 bytes
+ *
+ */
+unsigned char AmlCode[] =
+{
+0x44,0x53,0x44,0x54,0xF5,0x23,0x00,0x00,  /* "DSDT.#.." */
+0x01,0xD3,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 0008"..INTEL " */
+0x51,0x75,0x61,0x72,0x6B,0x4E,0x63,0x53,  /* 0010"QuarkNcS" */
+0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 0018"INTL" */
+0x15,0x05,0x15,0x20,0x08,0x47,0x50,0x49,  /* 0020"... .GPI" */
+0x43,0x00,0x5B,0x80,0x44,0x42,0x47,0x30,  /* 0028"C.[.DBG0" */
+0x01,0x0A,0x80,0x01,0x5B,0x81,0x0B,0x44,  /* 0030"[..D" */
+0x42,0x47,0x30,0x01,0x49,0x4F,0x38,0x30,  /* 0038"BG0.IO80" */
+0x08,0x5B,0x80,0x41,0x43,0x4D,0x53,0x01,  /* 0040".[.ACMS." */
+0x0A,0x72,0x0A,0x02,0x5B,0x81,0x10,0x41,  /* 0048".r..[..A" */
+0x43,0x4D,0x53,0x01,0x49,0x4E,0x44,0x58,  /* 0050"CMS.INDX" */
+0x08,0x44,0x41,0x54,0x41,0x08,0x5B,0x80,  /* 0058".DATA.[." */
+0x4D,0x4E,0x56,0x53,0x00,0x0C,0x90,0x8C,  /* 0060"MNVS" */
+0x1C,0x0F,0x0B,0x00,0x02,0x5B,0x81,0x45,  /* 0068".[.E" */
+0x07,0x4D,0x4E,0x56,0x53,0x01,0x4F,0x53,  /* 0070".MNVS.OS" */
+0x54,0x50,0x20,0x43,0x46,0x47,0x44,0x20,  /* 0078"TP CFGD " */
+0x48,0x50,0x45,0x41,0x20,0x50,0x31,0x42,  /* 0080"HPEA P1B" */
+0x42,0x20,0x50,0x42,0x41,0x42,0x20,0x47,  /* 0088"B PBAB G" */
+0x50,0x30,0x42,0x20,0x47,0x50,0x41,0x42,  /* 0090"P0B GPAB" */
+0x20,0x53,0x4D,0x42,0x42,0x20,0x4E,0x52,  /* 0098" SMBB NR" */
+0x56,0x31,0x20,0x57,0x44,0x54,0x42,0x20,  /* 00A0"V1 WDTB " */
+0x48,0x50,0x54,0x42,0x20,0x48,0x50,0x54,  /* 00A8"HPTB HPT" */
+0x53,0x20,0x50,0x45,0x58,0x42,0x20,0x50,  /* 00B0"S PEXB P" */
+0x45,0x58,0x53,0x20,0x52,0x43,0x42,0x42,  /* 00B8"EXS RCBB" */
+0x20,0x52,0x43,0x42,0x53,0x20,0x41,0x50,  /* 00C0" RCBS AP" */
+0x43,0x42,0x20,0x41,0x50,0x43,0x53,0x20,  /* 00C8"CB APCS " */
+0x54,0x50,0x4D,0x50,0x20,0x44,0x42,0x47,  /* 00D0"TPMP DBG" */
+0x50,0x20,0x50,0x54,0x59,0x50,0x20,0x41,  /* 00D8"P PTYP A" */
+0x4C,0x54,0x53,0x20,0x5B,0x80,0x47,0x50,  /* 00E0"LTS [.GP" */
+0x45,0x42,0x01,0x0B,0x00,0x11,0x0A,0x40,  /* 00E8"EB.@" */
+0x5B,0x81,0x13,0x47,0x50,0x45,0x42,0x00,  /* 00F0"[..GPEB." */
+0x00,0x40,0x08,0x53,0x4D,0x49,0x45,0x20,  /* 00F8".@.SMIE " */
+0x53,0x4D,0x49,0x53,0x20,0x10,0x12,0x5F,  /* 0100"SMIS .._" */
+0x50,0x52,0x5F,0x5B,0x83,0x0B,0x43,0x50,  /* 0108"PR_[..CP" */
+0x55,0x30,0x01,0x10,0x10,0x00,0x00,0x06,  /* 0110"U0.." */
+

[linux-yocto] [PATCH 5/7] staging:iio: add support for ADC1x8s102.

2016-02-16 Thread Saul Wold
From: Todor Minchev 

Original author is Bogdan Pricop .

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP

Signed-off-by: Ismo Puustinen 
---
 drivers/staging/iio/adc/Kconfig  |  13 ++
 drivers/staging/iio/adc/Makefile |   1 +
 drivers/staging/iio/adc/adc1x8s102.c | 387 +++
 include/linux/platform_data/adc1x8s102.h |  30 +++
 4 files changed, 431 insertions(+)
 create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
 create mode 100644 include/linux/platform_data/adc1x8s102.h

diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index d0016ce..7d295a6 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -115,4 +115,17 @@ config SPEAR_ADC
 
  To compile this driver as a module, choose M here: the
  module will be called spear_adc.
+
+config ADC1x8S102
+   tristate "Texas Instruments ADC1x8S102 driver"
+   depends on SPI
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+   help
+   Say yes here to build support for Texas Instruments ADC1x8S102 
ADC.
+   Provides direct access via sysfs.
+
+   To compile this driver as a module, choose M here: the module 
will
+   be called adc1x8s102
+
 endmenu
diff --git a/drivers/staging/iio/adc/Makefile b/drivers/staging/iio/adc/Makefile
index 1c4277d..3fe3880 100644
--- a/drivers/staging/iio/adc/Makefile
+++ b/drivers/staging/iio/adc/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_AD7280) += ad7280a.o
 obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o
 obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o
 obj-$(CONFIG_SPEAR_ADC) += spear_adc.o
+obj-$(CONFIG_ADC1x8S102) += adc1x8s102.o
diff --git a/drivers/staging/iio/adc/adc1x8s102.c 
b/drivers/staging/iio/adc/adc1x8s102.c
new file mode 100644
index 000..52472e2
--- /dev/null
+++ b/drivers/staging/iio/adc/adc1x8s102.c
@@ -0,0 +1,387 @@
+/*
+ * ADC1x8S102 SPI ADC driver
+ *
+ * Copyright(c) 2013 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * This IIO device driver is is designed to work with the following
+ * analog to digital converters from Texas Instruments:
+ *  ADC108S102
+ *  ADC128S102
+ * The communication with ADC chip is via the SPI bus (mode 3).
+ */
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/*
+ * Defining the ADC resolution being 12 bits, we can use the same driver for
+ * both ADC108S102 (10 bits resolution) and ADC128S102 (12 bits resolution)
+ * chips. The ADC108S102 effectively returns a 12-bit result with the 2
+ * least-significant bits unset.
+ */
+#define ADC1x8S102_BITS12
+#define ADC1x8S102_MAX_CHANNELS8
+
+/* 16-bit SPI command format:
+ *   [15:14] Ignored
+ *   [13:11] 3-bit channel address
+ *   [10:0]  Ignored
+ */
+#define ADC1x8S102_CMD(ch) (((ch) << (8)) << (3))
+
+/*
+ * 16-bit SPI response format:
+ *   [15:12] Zeros
+ *   [11:0]  12-bit ADC sample (for ADC108S102, [1:0] will always be 0).
+ */
+#define ADC1x8S102_RES_DATA(res)   (res & ((1 << ADC1x8S102_BITS) - 1))
+
+struct adc1x8s102_state {
+   struct spi_device   *spi;
+   struct regulator*reg;
+   u16 ext_vin;
+   /* SPI transfer used by triggered buffer handler*/
+   struct spi_transfer ring_xfer;
+   /* SPI transfer used by direct scan */
+   struct spi_transfer scan_single_xfer;
+   /* SPI message used by ring_xfer SPI transfer */
+   struct spi_message  ring_msg;
+   /* SPI message used by scan_single_xfer SPI transfer */
+   struct spi_message  scan_single_msg;
+
+   /* SPI message buffers:
+*  tx_buf: |C0|C1|C2|C3|C4|C5|C6|C7|XX|
+*  rx_buf: |XX|R0|R1|R2|R3|R4|R5|R6|R7|tt|tt|tt|tt|
+*
+*  tx_buf: 8 channel read commands, plus 1 dummy command
+*  rx_buf: 1 dummy response, 8 channel responses, plus 64-bit timestamp
+*/
+   __be16  rx_buf[13] cacheline_aligned;
+   __be16  tx_buf[9];
+
+};
+
+#define ADC1X8S102_V_CHAN(index)   \
+   {   \
+   .type = IIO_VOLTAGE,\
+   .indexed = 1, 

[linux-yocto] [PATCH 7/7] gpio-pca953x: add "drive" property.

2016-02-16 Thread Saul Wold
From: Ismo Puustinen 

Galileo gen 2 has support for setting GPIO modes. Expose these
properties through the GPIO sysfs interface. This approach is bit hacky,
since it changes the interface semantics.

The original patch was by Josef Ahmad  and
made on top of kernel 3.8.

Upstream-status: Forward-ported from Intel IOT Develper Kit Quark BSP

Signed-off-by: Ismo Puustinen 
---
 drivers/gpio/gpio-pca953x.c   | 57 +++
 drivers/gpio/gpiolib-sysfs.c  | 78 +++
 drivers/gpio/gpiolib.c| 18 ++
 drivers/gpio/gpiolib.h|  7 +++-
 include/asm-generic/gpio.h|  5 +++
 include/linux/gpio.h  | 10 ++
 include/linux/gpio/consumer.h | 11 ++
 include/linux/gpio/driver.h   |  2 ++
 8 files changed, 180 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 0227cde..8f49bd6 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -39,6 +39,9 @@
 #define PCA957X_MSK6
 #define PCA957X_INTS   7
 
+#define PCA953X_PUPD_EN35
+#define PCA953X_PUPD_SEL   36
+
 #define PCA_GPIO_MASK  0x00FF
 #define PCA_INT0x0100
 #define PCA953X_TYPE   0x1000
@@ -374,6 +377,43 @@ exit:
mutex_unlock(>i2c_lock);
 }
 
+static int pca953x_gpio_set_drive(struct gpio_chip *gc,
+unsigned off, unsigned mode)
+{
+   struct pca953x_chip *chip;
+   int ret = 0;
+   int val;
+
+   chip = container_of(gc, struct pca953x_chip, gpio_chip);
+
+   if (chip->chip_type != PCA953X_TYPE)
+   return -EINVAL;
+
+   mutex_lock(>i2c_lock);
+
+   switch (mode) {
+   case GPIOF_DRIVE_PULLUP:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 1, 
off);
+   break;
+   case GPIOF_DRIVE_PULLDOWN:
+   ret = pca953x_write_single(chip, PCA953X_PUPD_EN, 1, off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 0, 
off);
+   break;
+   case GPIOF_DRIVE_STRONG:
+   case GPIOF_DRIVE_HIZ:
+   ret = pca953x_read_single(chip, PCA953X_PUPD_EN, , off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_EN, 0, 
off) ||
+   pca953x_write_single(chip, PCA953X_PUPD_SEL, 
val, off);
+   break;
+   default:
+   ret = -EINVAL;
+   }
+
+   mutex_unlock(>i2c_lock);
+   return ret;
+}
+
 static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
 {
struct gpio_chip *gc;
@@ -392,6 +432,9 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, 
int gpios)
gc->dev = >client->dev;
gc->owner = THIS_MODULE;
gc->names = chip->names;
+
+   if (chip->chip_type == PCA953X_TYPE)
+   gc->set_drive = pca953x_gpio_set_drive;
 }
 
 #ifdef CONFIG_GPIO_PCA953X_IRQ
@@ -548,7 +591,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 }
 
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int irq_base)
 {
struct i2c_client *client = chip->client;
int ret, i, offset = 0;
@@ -591,10 +634,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
}
 
ret =  gpiochip_irqchip_add(>gpio_chip,
-   _irq_chip,
-   irq_base,
-   handle_simple_irq,
-   IRQ_TYPE_NONE);
+   _irq_chip,
+   irq_base,
+   handle_simple_irq,
+   IRQ_TYPE_NONE);
if (ret) {
dev_err(>dev,
"could not connect irqchip to gpiochip\n");
@@ -607,7 +650,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 
 #else /* CONFIG_GPIO_PCA953X_IRQ */
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-int irq_base)
+int irq_base)
 {
struct i2c_client *client = chip->client;
 
@@ -628,7 +671,7 @@ static int device_pca953x_init(struct pca953x_chip *chip, 
u32 invert)
goto out;
 
ret = pca953x_read_regs(chip, PCA953X_DIRECTION,
-  chip->reg_direction);
+  chip->reg_direction);
if (ret)
goto out;
 
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index af3bc7a..4f90f69 

[linux-yocto] [PATCH 2/7] gpio: pca953x: provide GPIO base based on _UID

2016-02-16 Thread Saul Wold
From: Andy Shevchenko 

Custom kernel for Intel Galileo Gen2 provides and moreover libmraa relies on
the continuous GPIO space. To do such we have to configure GPIO base per each
GPIO expander. The only value we can use is the ACPI _UID.

Signed-off-by: Andy Shevchenko 

Upstream-status: Inappropriate, custom code for legacy userspace
---
 drivers/gpio/gpio-pca953x.c | 44 +---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 32a56d5..0227cde 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -76,12 +76,6 @@ static const struct i2c_device_id pca953x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pca953x_id);
 
-static const struct acpi_device_id pca953x_acpi_ids[] = {
-   { "INT3491", 16 | PCA953X_TYPE | PCA_INT, },
-   { }
-};
-MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
-
 #define MAX_BANK 5
 #define BANK_SZ 8
 
@@ -108,6 +102,35 @@ struct pca953x_chip {
unsigned long driver_data;
 };
 
+struct pca953x_info {
+   kernel_ulong_t driver_data;
+   void (*setup)(struct pca953x_chip *chip);
+};
+
+static void pca953x_setup_int3491(struct pca953x_chip *chip)
+{
+   struct acpi_device *adev = ACPI_COMPANION(>client->dev);
+   unsigned int uid;
+
+   if (kstrtouint(acpi_device_uid(adev), 0, ) || !uid--)
+   return;
+
+   chip->gpio_start = 8 /* sch_gpio */ +
+  8 /* gpio-dwapb */ +
+ 16 /* pca9535 */ * uid;
+}
+
+static const struct pca953x_info pca953x_info_int3491 = {
+   .driver_data = 16 | PCA953X_TYPE | PCA_INT,
+   .setup = pca953x_setup_int3491,
+};
+
+static const struct acpi_device_id pca953x_acpi_ids[] = {
+   { "INT3491",  (kernel_ulong_t)_info_int3491 },
+   { }
+};
+MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
+
 static inline struct pca953x_chip *to_pca(struct gpio_chip *gc)
 {
return container_of(gc, struct pca953x_chip, gpio_chip);
@@ -679,12 +702,19 @@ static int pca953x_probe(struct i2c_client *client,
chip->driver_data = id->driver_data;
} else {
const struct acpi_device_id *id;
+   const struct pca953x_info *info;
 
id = acpi_match_device(pca953x_acpi_ids, >dev);
if (!id)
return -ENODEV;
 
-   chip->driver_data = id->driver_data;
+   info = (struct pca953x_info *)id->driver_data;
+   if (!info)
+   return -ENODEV;
+
+   chip->driver_data = info->driver_data;
+   if (info->setup)
+   info->setup(chip);
}
 
chip->chip_type = PCA_CHIP_TYPE(chip->driver_data);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 4/7] spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.

2016-02-16 Thread Saul Wold
From: Ismo Puustinen 

Slave devices were not enumerated by ACPI data because the ACPI handle
for the spi-pxa2xx controller was NULL if it was itself enumerated by
PCI.

Upstream-status: Inappropriate, real fix forthcoming

Signed-off-by: Ismo Puustinen 
---
 drivers/spi/spi-pxa2xx-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index fa7399e..c5a7111 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -170,6 +170,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
memset(, 0, sizeof(pi));
pi.parent = >dev;
pi.name = "pxa2xx-spi";
+   pi.fwnode = dev->dev.fwnode;
pi.id = ssp->port_id;
pi.data = _pdata;
pi.size_data = sizeof(spi_pdata);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 0/7] Galileo Patches - non-upstreamed

2016-02-16 Thread Saul Wold
Bruce,

This is  this is a set of patches for 4.1, there is another similar 
that I will be sending shortly for 4.4. The only difference between 
the 4.1 and 4.4 patch set is 07/07 gpio-pca953x does not apply to 4.4,
the other 6 do

These patches are mostly targeted to Galileo Gen2 and deal with the
SPI/PWN/GPIO devices.

If we need to put these in a Galiloe branch vs standard/base, let 
me know how to proceed.

Sau!

Andy Shevchenko (1):
  gpio: pca953x: provide GPIO base based on _UID

Ismo Puustinen (4):
  acpi: added a custom DSDT file.
  spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.
  adc1x8s102: support ACPI-based enumeration.
  gpio-pca953x: add "drive" property.

Josef Ahmad (1):
  pca9685: PCA9685 PWM and GPIO multi-function device.

Todor Minchev (1):
  staging:iio: add support for ADC1x8s102.

 drivers/gpio/gpio-pca953x.c  |  101 ++-
 drivers/gpio/gpiolib-sysfs.c |   78 ++
 drivers/gpio/gpiolib.c   |   18 +
 drivers/gpio/gpiolib.h   |7 +-
 drivers/mfd/Kconfig  |   10 +
 drivers/mfd/Makefile |2 +
 drivers/mfd/pca9685-core.c   |  308 
 drivers/mfd/pca9685-gpio.c   |  108 +++
 drivers/mfd/pca9685-pwm.c|  262 +++
 drivers/mfd/pca9685.h|  110 +++
 drivers/spi/spi-pxa2xx-pci.c |1 +
 drivers/staging/iio/adc/Kconfig  |   13 +
 drivers/staging/iio/adc/Makefile |1 +
 drivers/staging/iio/adc/adc1x8s102.c |  437 +++
 include/DSDT.hex | 1191 ++
 include/asm-generic/gpio.h   |5 +
 include/linux/gpio.h |   10 +
 include/linux/gpio/consumer.h|   11 +
 include/linux/gpio/driver.h  |2 +
 include/linux/platform_data/adc1x8s102.h |   30 +
 include/linux/platform_data/pca9685.h|   51 ++
 21 files changed, 2741 insertions(+), 15 deletions(-)
 create mode 100644 drivers/mfd/pca9685-core.c
 create mode 100644 drivers/mfd/pca9685-gpio.c
 create mode 100644 drivers/mfd/pca9685-pwm.c
 create mode 100644 drivers/mfd/pca9685.h
 create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
 create mode 100644 include/DSDT.hex
 create mode 100644 include/linux/platform_data/adc1x8s102.h
 create mode 100644 include/linux/platform_data/pca9685.h

-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


Re: [linux-yocto] [PATCH 0/3] Backport Capabilities Patches to 4.1

2016-02-16 Thread Saul Wold
On Tue, 2016-02-16 at 09:38 -0500, Bruce Ashfield wrote:
> On 16-02-11 11:16 AM, Saul Wold wrote:
> > 
> > Add the Capabilities support that some projects would like to use
> > in the linux-yocto-4.1 kernel.
> > 
> > These 3 are all upstream in 4.3 or later
> 
> I've staged the patches, and pushed them out. SRCREV updates to
> follow
> shortly (preferably after the 4.4 issues with PAT are sorted out).
> 
I am also working on the final set of Galileo Gen2 patches that are not
backportes, doing build and test currently.

Sau!

> Bruce
> 
> > 
> > Thanks
> > Sau!
> > 
> > 
> > Andy Lutomirski (3):
> >    capabilities: ambient capabilities
> >    selftests/capabilities: Add tests for capability evolution
> >    capabilities: add a securebit to disable PR_CAP_AMBIENT_RAISE
> > 
> >   fs/proc/array.c|   5 +-
> >   include/linux/cred.h   |   8 +
> >   include/uapi/linux/prctl.h |   7 +
> >   include/uapi/linux/securebits.h|  11 +-
> >   kernel/user_namespace.c|   1 +
> >   security/commoncap.c   | 103 -
> >   security/keys/process_keys.c   |   1 +
> >   tools/testing/selftests/capabilities/.gitignore|   2 +
> >   tools/testing/selftests/capabilities/Makefile  |  18 +
> >   tools/testing/selftests/capabilities/test_execve.c | 427
> > +
> >   .../testing/selftests/capabilities/validate_cap.c  |  73 
> >   11 files changed, 644 insertions(+), 12 deletions(-)
> >   create mode 100644
> > tools/testing/selftests/capabilities/.gitignore
> >   create mode 100644 tools/testing/selftests/capabilities/Makefile
> >   create mode 100644
> > tools/testing/selftests/capabilities/test_execve.c
> >   create mode 100644
> > tools/testing/selftests/capabilities/validate_cap.c
> > 
> 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] selftests/capabilities: Add tests for capability evolution

2016-02-11 Thread Saul Wold
From: Andy Lutomirski 

commit 32ae976ed3b5ba39c9208ace41bcdf4157d21db3 upstream.

This test focuses on ambient capabilities.  It requires either root or
the ability to create user namespaces.  Some of the test cases will be
skipped for nonroot users.

Signed-off-by: Andy Lutomirski 
Acked-by: Kees Cook 
Cc: Christoph Lameter  # Original author
Cc: Serge E. Hallyn 
Cc: James Morris 
Cc: Shuah Khan 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 

diff --git a/tools/testing/selftests/capabilities/.gitignore 
b/tools/testing/selftests/capabilities/.gitignore
new file mode 100644
index 000..b732dd0
--- /dev/null
+++ b/tools/testing/selftests/capabilities/.gitignore
@@ -0,0 +1,2 @@
+test_execve
+validate_cap
diff --git a/tools/testing/selftests/capabilities/Makefile 
b/tools/testing/selftests/capabilities/Makefile
new file mode 100644
index 000..8c8f0c1
--- /dev/null
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -0,0 +1,18 @@
+all:
+
+include ../lib.mk
+
+.PHONY: all clean
+
+TARGETS := validate_cap test_execve
+TEST_PROGS := test_execve
+
+CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
+
+all: $(TARGETS)
+
+clean:
+   $(RM) $(TARGETS)
+
+$(TARGETS): %: %.c
+   $(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
diff --git a/tools/testing/selftests/capabilities/test_execve.c 
b/tools/testing/selftests/capabilities/test_execve.c
new file mode 100644
index 000..10a21a9
--- /dev/null
+++ b/tools/testing/selftests/capabilities/test_execve.c
@@ -0,0 +1,427 @@
+#define _GNU_SOURCE
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef PR_CAP_AMBIENT
+#define PR_CAP_AMBIENT 47
+# define PR_CAP_AMBIENT_IS_SET 1
+# define PR_CAP_AMBIENT_RAISE  2
+# define PR_CAP_AMBIENT_LOWER  3
+# define PR_CAP_AMBIENT_CLEAR_ALL  4
+#endif
+
+static int nerrs;
+
+static void vmaybe_write_file(bool enoent_ok, char *filename, char *fmt, 
va_list ap)
+{
+   char buf[4096];
+   int fd;
+   ssize_t written;
+   int buf_len;
+
+   buf_len = vsnprintf(buf, sizeof(buf), fmt, ap);
+   if (buf_len < 0) {
+   err(1, "vsnprintf failed");
+   }
+   if (buf_len >= sizeof(buf)) {
+   errx(1, "vsnprintf output truncated");
+   }
+
+   fd = open(filename, O_WRONLY);
+   if (fd < 0) {
+   if ((errno == ENOENT) && enoent_ok)
+   return;
+   err(1, "open of %s failed", filename);
+   }
+   written = write(fd, buf, buf_len);
+   if (written != buf_len) {
+   if (written >= 0) {
+   errx(1, "short write to %s", filename);
+   } else {
+   err(1, "write to %s failed", filename);
+   }
+   }
+   if (close(fd) != 0) {
+   err(1, "close of %s failed", filename);
+   }
+}
+
+static void maybe_write_file(char *filename, char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+   vmaybe_write_file(true, filename, fmt, ap);
+   va_end(ap);
+}
+
+static void write_file(char *filename, char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+   vmaybe_write_file(false, filename, fmt, ap);
+   va_end(ap);
+}
+
+static bool create_and_enter_ns(uid_t inner_uid)
+{
+   uid_t outer_uid;
+   gid_t outer_gid;
+   int i;
+   bool have_outer_privilege;
+
+   outer_uid = getuid();
+   outer_gid = getgid();
+
+   /*
+* TODO: If we're already root, we could skip creating the userns.
+*/
+
+   if (unshare(CLONE_NEWNS) == 0) {
+   printf("[NOTE]\tUsing global UIDs for tests\n");
+   if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) != 0)
+   err(1, "PR_SET_KEEPCAPS");
+   if (setresuid(inner_uid, inner_uid, -1) != 0)
+   err(1, "setresuid");
+
+   // Re-enable effective caps
+   capng_get_caps_process();
+   for (i = 0; i < CAP_LAST_CAP; i++)
+   if (capng_have_capability(CAPNG_PERMITTED, i))
+   capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, i);
+   if (capng_apply(CAPNG_SELECT_CAPS) != 0)
+   err(1, "capng_apply");
+
+   have_outer_privilege = true;
+   } else if (unshare(CLONE_NEWUSER | CLONE_NEWNS) == 0) {
+   printf("[NOTE]\tUsing a user namespace for tests\n");
+   maybe_write_file("/proc/self/setgroups", "deny");
+   write_file("/proc/self/uid_map", "%d %d 1", inner_uid, 
outer_uid);
+   

[linux-yocto] [PATCH v2] iio: light: add support for ROHM BH1710/BH1715/BH1721/BH1750/BH1751 ambient light sensors

2016-02-08 Thread Saul Wold
From: Tomasz Duszynski 

commit 3a11fbb037a1ecd3e1070ee484f1ea887133f21b upstream

Add support for ROHM BH1710/BH1715/BH1721/BH1750/BH1751 ambient light
sensors.

Signed-off-by: Tomasz Duszynski 
Signed-off-by: Jonathan Cameron 
---
v2: seperate from larger set and add upstream commit info

 drivers/iio/light/Kconfig  |  10 ++
 drivers/iio/light/Makefile |   1 +
 drivers/iio/light/bh1750.c | 334 +
 3 files changed, 345 insertions(+)
 create mode 100644 drivers/iio/light/bh1750.c

diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
index 3d7bafa..0ce46fd 100644
--- a/drivers/iio/light/Kconfig
+++ b/drivers/iio/light/Kconfig
@@ -37,6 +37,16 @@ config APDS9300
 To compile this driver as a module, choose M here: the
 module will be called apds9300.
 
+config BH1750
+   tristate "ROHM BH1750 ambient light sensor"
+   depends on I2C
+   help
+Say Y here to build support for the ROHM BH1710, BH1715, BH1721,
+BH1750, BH1751 ambient light sensors.
+
+To compile this driver as a module, choose M here: the module will
+be called bh1750.
+
 config CM32181
depends on I2C
tristate "CM32181 driver"
diff --git a/drivers/iio/light/Makefile b/drivers/iio/light/Makefile
index 90e7fd2..11c181c 100644
--- a/drivers/iio/light/Makefile
+++ b/drivers/iio/light/Makefile
@@ -6,6 +6,7 @@
 obj-$(CONFIG_ADJD_S311)+= adjd_s311.o
 obj-$(CONFIG_AL3320A)  += al3320a.o
 obj-$(CONFIG_APDS9300) += apds9300.o
+obj-$(CONFIG_BH1750)   += bh1750.o
 obj-$(CONFIG_CM32181)  += cm32181.o
 obj-$(CONFIG_CM3232)   += cm3232.o
 obj-$(CONFIG_CM3323)   += cm3323.o
diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c
new file mode 100644
index 000..564c2b3
--- /dev/null
+++ b/drivers/iio/light/bh1750.c
@@ -0,0 +1,334 @@
+/*
+ * ROHM BH1710/BH1715/BH1721/BH1750/BH1751 ambient light sensor driver
+ *
+ * Copyright (c) Tomasz Duszynski 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Data sheets:
+ *  
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1710fvc-e.pdf
+ *  
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1715fvc-e.pdf
+ *  
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1721fvc-e.pdf
+ *  
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
+ *  
http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1751fvi-e.pdf
+ *
+ * 7-bit I2C slave addresses:
+ *  0x23 (ADDR pin low)
+ *  0x5C (ADDR pin high)
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define BH1750_POWER_DOWN  0x00
+#define BH1750_ONE_TIME_H_RES_MODE 0x20 /* auto-mode for BH1721 */
+#define BH1750_CHANGE_INT_TIME_H_BIT   0x40
+#define BH1750_CHANGE_INT_TIME_L_BIT   0x60
+
+enum {
+   BH1710,
+   BH1721,
+   BH1750,
+};
+
+struct bh1750_chip_info;
+struct bh1750_data {
+   struct i2c_client *client;
+   struct mutex lock;
+   const struct bh1750_chip_info *chip_info;
+   u16 mtreg;
+};
+
+struct bh1750_chip_info {
+   u16 mtreg_min;
+   u16 mtreg_max;
+   u16 mtreg_default;
+   int mtreg_to_usec;
+   int mtreg_to_scale;
+
+   /*
+* For BH1710/BH1721 all possible integration time values won't fit
+* into one page so displaying is limited to every second one.
+* Note, that user can still write proper values which were not
+* listed.
+*/
+   int inc;
+
+   u16 int_time_low_mask;
+   u16 int_time_high_mask;
+}
+
+static const bh1750_chip_info_tbl[] = {
+   [BH1710] = { 140, 1022, 300, 400,  25000, 2, 0x001F, 0x03E0 },
+   [BH1721] = { 140, 1020, 300, 400,  25000, 2, 0x0010, 0x03E0 },
+   [BH1750] = { 31,  254,  69,  1740, 5750,  1, 0x001F, 0x00E0 },
+};
+
+static int bh1750_change_int_time(struct bh1750_data *data, int usec)
+{
+   int ret;
+   u16 val;
+   u8 regval;
+   const struct bh1750_chip_info *chip_info = data->chip_info;
+
+   if ((usec % chip_info->mtreg_to_usec) != 0)
+   return -EINVAL;
+
+   val = usec / chip_info->mtreg_to_usec;
+   if (val < chip_info->mtreg_min || val > chip_info->mtreg_max)
+   return -EINVAL;
+
+   ret = i2c_smbus_write_byte(data->client, BH1750_POWER_DOWN);
+   if (ret < 0)
+   return ret;
+
+   regval = (val & chip_info->int_time_high_mask) >> 5;
+   ret = i2c_smbus_write_byte(data->client,
+  BH1750_CHANGE_INT_TIME_H_BIT | regval);
+   if (ret < 0)
+   return ret;
+
+   regval = val & 

Re: [linux-yocto] [PATCH 01/29] i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned

2016-02-08 Thread Saul Wold
On Sun, 2016-02-07 at 17:09 -0500, Paul Gortmaker wrote:
> [[linux-yocto] [PATCH 01/29] i2c / ACPI: Use 0 to indicate that
> device does not have interrupt assigned] On 05/02/2016 (Fri 06:53)
> Saul Wold wrote:
> 
> > From: Mika Westerberg <mika.westerb...@linux.intel.com>
> 
> Normally here at this point it is nice to see:
> 
> commit dab472eb931bc2916fa779e56deccd0ec319cf5b upstream.
> 
> This is the convention used by all the stable kernel maintenance
> trees.

Paul, Thanks!  This is the first kernel patch set I am sending,
appreciate the feedback, I send patches elsewhere but the conventions
are different.

I will break this series up and add the upstream note where I find
them.

> It makes it much easier to decide when later that we can toss it
> based
> on moving to a new kernel version.  For example:
> 
> paul@yow-builder:~/git/linux-head$ git describe dab472eb931
> v4.1-rc3-44-gdab472eb931b
> 
> ...so the commit was created on a 4.1-rc3 baseline, but...
> 
> paul@yow-builder:~/git/linux-head$ git describe --contains
> dab472eb931
> v4.2-rc1~158^2~28
> 
> ...not merged to mainline until 158 commits before the 4.2-rc1 tag
> marked the end of the 4.2 development cycle.  So anything pre-4.2
> will
> need to carry this.
> 
> Normally I use some script to toss the output of the above two lines
> into a comment above the commit in the scc file, which also eases the
> carry forward load of bigger BSP patch series.
> 
Willing to share your script?

> It also permits automated "reviewbots" that can do things like look
> at
> the diffstat of the original and compare it to the backport and flag
> glaring differences.
> 
> > 
> > This is the convention used in most parts of the kernel including
> > DT
> > counterpart of I2C slave enumeration. To make things consistent do
> > the same
> > for ACPI I2C slave enumeration path as well.
> > 
> > Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
> > Acked-by: Wolfram Sang <w...@the-dreams.de>
> > Signed-off-by: Linus Walleij <linus.wall...@linaro.org>
> 
> I wonder about the auto-Cc collection of mail addresses in the
> linux-yocto case.  It might be a bit of a coin toss; but I'm leaning
> towards leaving them off, esp. when the 0/N didn't include all the
> ppl
> to give them context.  Maintainers/authors probably get enough
> revisit
> spam from all the "official" stable trees, hence why I'd lean towards
> leaving them out for other custom/forked projects like this.
> 

I will ensure not to send to the Cc list in the future.

Thanks
  Sau!

> So, no real problem with the patch itself, but just a couple of
> process
> steps that I've found definitely helpful in the past.
> 
> Paul.
> --
> 
> > 
> > Upstream-status: Backport
> > Signed-off-by: Saul Wold <s...@linux.intel.com>
> > ---
> >  drivers/i2c/i2c-core.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> > index 987c124..c21b3de 100644
> > --- a/drivers/i2c/i2c-core.c
> > +++ b/drivers/i2c/i2c-core.c
> > @@ -107,7 +107,7 @@ static int acpi_i2c_add_resource(struct
> > acpi_resource *ares, void *data)
> >     if (sb->access_mode ==
> > ACPI_I2C_10BIT_MODE)
> >     info->flags |= I2C_CLIENT_TEN;
> >     }
> > -   } else if (info->irq < 0) {
> > +   } else if (!info->irq) {
> >     struct resource r;
> >  
> >     if (acpi_dev_resource_interrupt(ares, 0, ))
> > @@ -134,7 +134,6 @@ static acpi_status
> > acpi_i2c_add_device(acpi_handle handle, u32 level,
> >  
> >     memset(, 0, sizeof(info));
> >     info.fwnode = acpi_fwnode_handle(adev);
> > -   info.irq = -1;
> >  
> >     INIT_LIST_HEAD(_list);
> >     ret = acpi_dev_get_resources(adev, _list,
> > -- 
> > 2.5.0
> > 
-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 15/19] mfd: intel_quark_i2c_gpio: support devices behind i2c bus

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit 9b00926f46d882429bee435960c40b49d39e6a4f upstream.

On Intel Galileo Gen2 the GPIO expanders are connected to the i2c bus. For
those devices the ACPI table has specific parameters that refer to an actual
i2c host controller. Since MFD now copes with that specific configuration we
have to provide a necessary information how to distinguish devices in ACPI
namespace. Here the _ADR values are provided.

Acked-by: Lee Jones 
Signed-off-by: Andy Shevchenko 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 918fe70cf4750e21350a8a40b28117b9e2991a10)
---
 drivers/mfd/intel_quark_i2c_gpio.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c 
b/drivers/mfd/intel_quark_i2c_gpio.c
index 958c134..0421374 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -31,6 +31,10 @@
 #define MFD_I2C_BAR0
 #define MFD_GPIO_BAR   1
 
+/* ACPI _ADR value to match the child node */
+#define MFD_ACPI_MATCH_GPIO0ULL
+#define MFD_ACPI_MATCH_I2C 1ULL
+
 /* The base GPIO number under GPIOLIB framework */
 #define INTEL_QUARK_MFD_GPIO_BASE  8
 
@@ -82,16 +86,25 @@ static struct resource intel_quark_i2c_res[] = {
},
 };
 
+static struct mfd_cell_acpi_match intel_quark_acpi_match_i2c = {
+   .adr = MFD_ACPI_MATCH_I2C,
+};
+
 static struct resource intel_quark_gpio_res[] = {
[INTEL_QUARK_IORES_MEM] = {
.flags = IORESOURCE_MEM,
},
 };
 
+static struct mfd_cell_acpi_match intel_quark_acpi_match_gpio = {
+   .adr = MFD_ACPI_MATCH_GPIO,
+};
+
 static struct mfd_cell intel_quark_mfd_cells[] = {
{
.id = MFD_GPIO_BAR,
.name = "gpio-dwapb",
+   .acpi_match = _quark_acpi_match_gpio,
.num_resources = ARRAY_SIZE(intel_quark_gpio_res),
.resources = intel_quark_gpio_res,
.ignore_resource_conflicts = true,
@@ -99,6 +112,7 @@ static struct mfd_cell intel_quark_mfd_cells[] = {
{
.id = MFD_I2C_BAR,
.name = "i2c_designware",
+   .acpi_match = _quark_acpi_match_i2c,
.num_resources = ARRAY_SIZE(intel_quark_i2c_res),
.resources = intel_quark_i2c_res,
.ignore_resource_conflicts = true,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 07/19] i2c: core: only use set_scl for bus recovery after calling prepare_recovery

2016-02-08 Thread Saul Wold
From: Jan Luebbe 

commit 49c46cd7bf99f5a5af5df9a92b73db54b94f46f0 upstream.

Using set_scl may be ineffective before calling the driver specific
prepare_recovery callback, which might change into a test mode. So
instead of setting SCL in i2c_generic_scl_recovery, move it to
i2c_generic_recovery (after the optional prepare_recovery).

Signed-off-by: Jan Luebbe 
Acked-by: Alexander Sverdlin 
Tested-by: Alexander Sverdlin 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 8b06260836ab47abbb5ea49d889660a0ed8adf90)
---
 drivers/i2c/i2c-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 069a41f..be992b3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -567,6 +567,9 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
if (bri->prepare_recovery)
bri->prepare_recovery(adap);
 
+   bri->set_scl(adap, val);
+   ndelay(RECOVERY_NDELAY);
+
/*
 * By this time SCL is high, as we need to give 9 falling-rising edges
 */
@@ -597,7 +600,6 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
 
 int i2c_generic_scl_recovery(struct i2c_adapter *adap)
 {
-   adap->bus_recovery_info->set_scl(adap, 1);
return i2c_generic_recovery(adap);
 }
 EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 10/19] GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module use

2016-02-08 Thread Saul Wold
From: Hanjun Guo 

commit dd8f9d05019c5c086113b967850bf8e2f2a964e6 upstream.

acpi_gpiochip_request(free)_interrupts can be used for modules,
so export them. This also fixs a compile error when xgene-sb
configured as kernel module.

Fixes: 733cf014f020 "gpio: xgene: add ACPI support for APM X-Gene GPIO standby 
driver"
Reviewed-by: Mark Brown 
Signed-off-by: Hanjun Guo 
(cherry picked from commit 2b528fff0905497c96566d671d47f2bbf3ae295c)
---
 drivers/gpio/gpiolib-acpi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 19b99d0..980a996 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -307,6 +307,7 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip 
*chip)
acpi_walk_resources(handle, "_AEI",
acpi_gpiochip_request_interrupt, acpi_gpio);
 }
+EXPORT_SYMBOL_GPL(acpi_gpiochip_request_interrupts);
 
 /**
  * acpi_gpiochip_free_interrupts() - Free GPIO ACPI event interrupts.
@@ -346,6 +347,7 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
kfree(event);
}
 }
+EXPORT_SYMBOL_GPL(acpi_gpiochip_free_interrupts);
 
 int acpi_dev_add_driver_gpios(struct acpi_device *adev,
  const struct acpi_gpio_mapping *gpios)
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 00/19 v2] Galileo patches that are upstreamed or pending

2016-02-08 Thread Saul Wold
Bruce,

I am refactoring the large patchset I sent earlier, this includes just the
patches that have upstream commits, I have already sent one general iio, 
these are More galileo specific.

These should all have the upstream commit info in them.  These are all for
the 4.1 linux-yocto, I will send another series for the 4.4 branch tomorrow.

Thanks

Sau!

Andy Shevchenko (7):
  mfd: core: redo ACPI matching of the children devices
  mfd: intel_quark_i2c_gpio: load gpio driver first
  mfd: intel_quark_i2c_gpio: support devices behind i2c bus
  gpio: pca953x: store driver_data for future use
  gpio: pca953x: support ACPI devices found on Galileo Gen2
  at24: enable ACPI device found on Galileo Gen2
  pwm-pca9685: enable ACPI device found on Galileo Gen2

Hanjun Guo (1):
  GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module
use

Jan Luebbe (1):
  i2c: core: only use set_scl for bus recovery after calling
prepare_recovery

Jarkko Nikula (1):
  i2c: core: Reduce stack size of acpi_i2c_space_handler()

Mika Westerberg (5):
  i2c / ACPI: Use 0 to indicate that device does not have interrupt
assigned
  i2c / ACPI: Assign IRQ for devices that have GpioInt automatically
  gpio / ACPI: Add support for retrieving GpioInt resources from a
device
  gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
  i2c / ACPI: Rework I2C device scanning

Shailendra Verma (1):
  i2c: core: fix typo in comment

Vladimir Zapolskiy (1):
  i2c: fix leaked device refcount on of_find_i2c_* error path

Wolfram Sang (2):
  i2c: slave: add error messages to slave core
  i2c: check for proper length of the reg property

 Documentation/acpi/enumeration.txt |  11 ++-
 drivers/gpio/gpio-pca953x.c|  36 ++--
 drivers/gpio/gpiolib-acpi.c|  40 -
 drivers/i2c/i2c-core.c | 179 +
 drivers/mfd/intel_quark_i2c_gpio.c |  33 ---
 drivers/mfd/mfd-core.c |  52 +++
 drivers/misc/eeprom/at24.c |  22 -
 drivers/pwm/Kconfig|   2 +-
 drivers/pwm/pwm-pca9685.c  |  20 -
 include/linux/acpi.h   |   7 ++
 include/linux/mfd/core.h   |  10 ++-
 11 files changed, 306 insertions(+), 106 deletions(-)

-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 14/19] mfd: intel_quark_i2c_gpio: load gpio driver first

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit b91b0d397c3b35a039867ca0f43f1a0d5965cad6 upstream.

On Intel Galileo boards the GPIO expander is connected to i2c bus. Moreover it
is able to generate interrupt, but interrupt line is connected to GPIO. That's
why we have to have GPIO driver in place when we will probe i2c host with
device connected to it.

Acked-by: Lee Jones 
Signed-off-by: Andy Shevchenko 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 236fd469f4d1beb59a47875fa3f222d514173ad0)
---
 drivers/mfd/intel_quark_i2c_gpio.c | 19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/mfd/intel_quark_i2c_gpio.c 
b/drivers/mfd/intel_quark_i2c_gpio.c
index 1ce1603..958c134 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -90,19 +90,19 @@ static struct resource intel_quark_gpio_res[] = {
 
 static struct mfd_cell intel_quark_mfd_cells[] = {
{
-   .id = MFD_I2C_BAR,
-   .name = "i2c_designware",
-   .num_resources = ARRAY_SIZE(intel_quark_i2c_res),
-   .resources = intel_quark_i2c_res,
-   .ignore_resource_conflicts = true,
-   },
-   {
.id = MFD_GPIO_BAR,
.name = "gpio-dwapb",
.num_resources = ARRAY_SIZE(intel_quark_gpio_res),
.resources = intel_quark_gpio_res,
.ignore_resource_conflicts = true,
},
+   {
+   .id = MFD_I2C_BAR,
+   .name = "i2c_designware",
+   .num_resources = ARRAY_SIZE(intel_quark_i2c_res),
+   .resources = intel_quark_i2c_res,
+   .ignore_resource_conflicts = true,
+   },
 };
 
 static const struct pci_device_id intel_quark_mfd_ids[] = {
@@ -248,12 +248,11 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
 
dev_set_drvdata(>dev, quark_mfd);
 
-   ret = intel_quark_i2c_setup(pdev, _quark_mfd_cells[MFD_I2C_BAR]);
+   ret = intel_quark_i2c_setup(pdev, _quark_mfd_cells[1]);
if (ret)
return ret;
 
-   ret = intel_quark_gpio_setup(pdev,
-_quark_mfd_cells[MFD_GPIO_BAR]);
+   ret = intel_quark_gpio_setup(pdev, _quark_mfd_cells[0]);
if (ret)
return ret;
 
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 11/19] gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found

2016-02-08 Thread Saul Wold
From: Mika Westerberg 

commit d8213ae03aebde8074f071d1da48007d55e3b41d upstream.

If a driver requests a GPIO described in its _CRS but the GPIO host
controller (gpiochip) driver providing the GPIO has not been loaded yet
acpi_get_gpiod() returns -ENODEV which causes the calling driver to fail.

If the gpiochip driver is loaded afterwards the driver requesting the GPIO
will not notice this.

Better approach is to return -EPROBE_DEFER in such case. Then when the
gpiochip driver appears the driver requesting the GPIO will be probed
again. This also aligns ACPI GPIO lookup code closer to DT as it does
pretty much the same when no gpiochip driver was found.

Reported-by: Tobias Diedrich 
Signed-off-by: Mika Westerberg 
Acked-by: Rafael J. Wysocki 
Signed-off-by: Tobias Diedrich 
Reviewed-by: Amos Kong 
Signed-off-by: Linus Walleij 
(cherry picked from commit f35bbf61ab772cc312f641c89ab161893cee)
---
 drivers/gpio/gpiolib-acpi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 980a996..533fe5d 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -114,10 +114,11 @@ static inline int acpi_gpiochip_pin_to_gpio_offset(struct 
gpio_chip *chip,
  * @path:  ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1")
  * @pin:   ACPI GPIO pin number (0-based, controller-relative)
  *
- * Returns GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR
- * error value
+ * Return: GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR
+ * error value. Specifically returns %-EPROBE_DEFER if the referenced GPIO
+ * controller does not have gpiochip registered at the moment. This is to
+ * support probe deferral.
  */
-
 static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
 {
struct gpio_chip *chip;
@@ -131,7 +132,7 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
 
chip = gpiochip_find(handle, acpi_gpiochip_find);
if (!chip)
-   return ERR_PTR(-ENODEV);
+   return ERR_PTR(-EPROBE_DEFER);
 
offset = acpi_gpiochip_pin_to_gpio_offset(chip, pin);
if (offset < 0)
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 12/19] i2c / ACPI: Rework I2C device scanning

2016-02-08 Thread Saul Wold
From: Mika Westerberg 

commit 4bba25bbe10ace5ad135020c1e6d621872d5faf5 upstream.

The way we currently scan I2C devices behind an I2C host controller does not
work in cases where the I2C device in question is not declared directly below
the host controller ACPI node.

This is perfectly legal according the ACPI 6.0 specification and some existing
systems are doing this.

To be able to enumerate all devices which are connected to a certain I2C host
controller we need to rework the current I2C scanning routine a bit. Instead of
scanning directly below the host controller we scan the whole ACPI namespace
for present devices with valid I2cSerialBus() connection pointing to the host
controller in question.

Signed-off-by: Mika Westerberg 
Acked-by: Rafael J. Wysocki 
Signed-off-by: Andy Shevchenko 
Tested-by: Dustin Byford 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 166c2ba398640278ae6037be4aa5562c03cf3d24)
---
 drivers/i2c/i2c-core.c | 82 --
 1 file changed, 59 insertions(+), 23 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e93dc38..372da32 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -94,27 +94,40 @@ struct gsb_buffer {
};
 } __packed;
 
-static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data)
+struct acpi_i2c_lookup {
+   struct i2c_board_info *info;
+   acpi_handle adapter_handle;
+   acpi_handle device_handle;
+};
+
+static int acpi_i2c_find_address(struct acpi_resource *ares, void *data)
 {
-   struct i2c_board_info *info = data;
+   struct acpi_i2c_lookup *lookup = data;
+   struct i2c_board_info *info = lookup->info;
+   struct acpi_resource_i2c_serialbus *sb;
+   acpi_handle adapter_handle;
+   acpi_status status;
 
-   if (ares->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
-   struct acpi_resource_i2c_serialbus *sb;
+   if (info->addr || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS)
+   return 1;
 
-   sb = >data.i2c_serial_bus;
-   if (!info->addr && sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) {
-   info->addr = sb->slave_address;
-   if (sb->access_mode == ACPI_I2C_10BIT_MODE)
-   info->flags |= I2C_CLIENT_TEN;
-   }
-   } else if (!info->irq) {
-   struct resource r;
+   sb = >data.i2c_serial_bus;
+   if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C)
+   return 1;
 
-   if (acpi_dev_resource_interrupt(ares, 0, ))
-   info->irq = r.start;
+   /*
+* Extract the ResourceSource and make sure that the handle matches
+* with the I2C adapter handle.
+*/
+   status = acpi_get_handle(lookup->device_handle,
+sb->resource_source.string_ptr,
+_handle);
+   if (ACPI_SUCCESS(status) && adapter_handle == lookup->adapter_handle) {
+   info->addr = sb->slave_address;
+   if (sb->access_mode == ACPI_I2C_10BIT_MODE)
+   info->flags |= I2C_CLIENT_TEN;
}
 
-   /* Tell the ACPI core to skip this resource */
return 1;
 }
 
@@ -123,6 +136,8 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, 
u32 level,
 {
struct i2c_adapter *adapter = data;
struct list_head resource_list;
+   struct acpi_i2c_lookup lookup;
+   struct resource_entry *entry;
struct i2c_board_info info;
struct acpi_device *adev;
int ret;
@@ -135,14 +150,37 @@ static acpi_status acpi_i2c_add_device(acpi_handle 
handle, u32 level,
memset(, 0, sizeof(info));
info.fwnode = acpi_fwnode_handle(adev);
 
+   memset(, 0, sizeof(lookup));
+   lookup.adapter_handle = ACPI_HANDLE(adapter->dev.parent);
+   lookup.device_handle = handle;
+   lookup.info = 
+
+   /*
+* Look up for I2cSerialBus resource with ResourceSource that
+* matches with this adapter.
+*/
INIT_LIST_HEAD(_list);
ret = acpi_dev_get_resources(adev, _list,
-acpi_i2c_add_resource, );
+acpi_i2c_find_address, );
acpi_dev_free_resource_list(_list);
 
if (ret < 0 || !info.addr)
return AE_OK;
 
+   /* Then fill IRQ number if any */
+   ret = acpi_dev_get_resources(adev, _list, NULL, NULL);
+   if (ret < 0)
+   return AE_OK;
+
+   resource_list_for_each_entry(entry, _list) {
+   if (resource_type(entry->res) == IORESOURCE_IRQ) {
+   info.irq = entry->res->start;
+   break;
+   }
+ 

[linux-yocto] [PATCH 13/19] mfd: core: redo ACPI matching of the children devices

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit 541019157c6b5951f2a488dbf4f7fa5f4b8f9b98 upstream.

There is at least one board on the market, i.e. Intel Galileo Gen2, that uses
_ADR to distinguish the devices under one actual device. Due to this we have to
improve the quirk in the MFD core to handle that board.

Acked-by: Rafael J. Wysocki 
Acked-by: Lee Jones 
Signed-off-by: Andy Shevchenko 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 98a3be44ffa67b812de7aa7aed9f2331edcfb1a5)
---
 Documentation/acpi/enumeration.txt | 11 +---
 drivers/mfd/mfd-core.c | 52 ++
 include/linux/mfd/core.h   | 10 ++--
 3 files changed, 52 insertions(+), 21 deletions(-)

diff --git a/Documentation/acpi/enumeration.txt 
b/Documentation/acpi/enumeration.txt
index 15dfce7..afd34d0 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -347,13 +347,18 @@ For the first case, the MFD drivers do not need to do 
anything. The
 resulting child platform device will have its ACPI_COMPANION() set to point
 to the parent device.
 
-If the ACPI namespace has a device that we can match using an ACPI id,
-the id should be set like:
+If the ACPI namespace has a device that we can match using an ACPI id or ACPI
+adr, the cell should be set like:
+
+   static struct mfd_cell_acpi_match my_subdevice_cell_acpi_match = {
+   .pnpid = "XYZ0001",
+   .adr = 0,
+   };
 
static struct mfd_cell my_subdevice_cell = {
.name = "my_subdevice",
/* set the resources relative to the parent */
-   .acpi_pnpid = "XYZ0001",
+   .acpi_match = _subdevice_cell_acpi_match,
};
 
 The ACPI id "XYZ0001" is then used to lookup an ACPI device directly under
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 1aed3b7..ea844dc 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -82,29 +82,49 @@ static int mfd_platform_add_cell(struct platform_device 
*pdev,
 static void mfd_acpi_add_device(const struct mfd_cell *cell,
struct platform_device *pdev)
 {
-   struct acpi_device *parent_adev;
+   const struct mfd_cell_acpi_match *match = cell->acpi_match;
+   struct acpi_device *parent, *child;
struct acpi_device *adev;
 
-   parent_adev = ACPI_COMPANION(pdev->dev.parent);
-   if (!parent_adev)
+   parent = ACPI_COMPANION(pdev->dev.parent);
+   if (!parent)
return;
 
/*
-* MFD child device gets its ACPI handle either from the ACPI
-* device directly under the parent that matches the acpi_pnpid or
-* it will use the parent handle if is no acpi_pnpid is given.
+* MFD child device gets its ACPI handle either from the ACPI device
+* directly under the parent that matches the either _HID or _CID, or
+* _ADR or it will use the parent handle if is no ID is given.
+*
+* Note that use of _ADR is a grey area in the ACPI specification,
+* though Intel Galileo Gen2 is using it to distinguish the children
+* devices.
 */
-   adev = parent_adev;
-   if (cell->acpi_pnpid) {
-   struct acpi_device_id ids[2] = {};
-   struct acpi_device *child_adev;
-
-   strlcpy(ids[0].id, cell->acpi_pnpid, sizeof(ids[0].id));
-   list_for_each_entry(child_adev, _adev->children, node)
-   if (acpi_match_device_ids(child_adev, ids)) {
-   adev = child_adev;
-   break;
+   adev = parent;
+   if (match) {
+   if (match->pnpid) {
+   struct acpi_device_id ids[2] = {};
+
+   strlcpy(ids[0].id, match->pnpid, sizeof(ids[0].id));
+   list_for_each_entry(child, >children, node) {
+   if (acpi_match_device_ids(child, ids)) {
+   adev = child;
+   break;
+   }
+   }
+   } else {
+   unsigned long long adr;
+   acpi_status status;
+
+   list_for_each_entry(child, >children, node) {
+   status = acpi_evaluate_integer(child->handle,
+  "_ADR", NULL,
+  );
+   if (ACPI_SUCCESS(status) && match->adr == adr) {
+   adev = child;
+   break;
+   }
}
+   }

[linux-yocto] [PATCH 17/19] gpio: pca953x: support ACPI devices found on Galileo Gen2

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit 99e17e265a9df3b2ef8fbc1a568cbb2b05a1b977 upstream.

This patch adds a support of the expandes found on Intel Galileo Gen2 board.
The platform information comes from ACPI.

Signed-off-by: Andy Shevchenko 
Signed-off-by: Linus Walleij 
(cherry picked from commit f32517bf1ae0a2de72b3f27200233bd3ad65bfeb)
---
 drivers/gpio/gpio-pca953x.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 56f679b..32a56d5 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -21,6 +21,7 @@
 #ifdef CONFIG_OF_GPIO
 #include 
 #endif
+#include 
 
 #define PCA953X_INPUT  0
 #define PCA953X_OUTPUT 1
@@ -75,6 +76,12 @@ static const struct i2c_device_id pca953x_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pca953x_id);
 
+static const struct acpi_device_id pca953x_acpi_ids[] = {
+   { "INT3491", 16 | PCA953X_TYPE | PCA_INT, },
+   { }
+};
+MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
+
 #define MAX_BANK 5
 #define BANK_SZ 8
 
@@ -668,7 +675,18 @@ static int pca953x_probe(struct i2c_client *client,
 
chip->client = client;
 
-   chip->driver_data = id->driver_data;
+   if (id) {
+   chip->driver_data = id->driver_data;
+   } else {
+   const struct acpi_device_id *id;
+
+   id = acpi_match_device(pca953x_acpi_ids, >dev);
+   if (!id)
+   return -ENODEV;
+
+   chip->driver_data = id->driver_data;
+   }
+
chip->chip_type = PCA_CHIP_TYPE(chip->driver_data);
 
mutex_init(>i2c_lock);
@@ -761,6 +779,7 @@ static struct i2c_driver pca953x_driver = {
.driver = {
.name   = "pca953x",
.of_match_table = pca953x_dt_ids,
+   .acpi_match_table = ACPI_PTR(pca953x_acpi_ids),
},
.probe  = pca953x_probe,
.remove = pca953x_remove,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 08/19] i2c: fix leaked device refcount on of_find_i2c_* error path

2016-02-08 Thread Saul Wold
From: Vladimir Zapolskiy 

commit 6b5d9d07c7ea4df3cf27f9eeb2fbb9c48a0c034b upstream.

If of_find_i2c_device_by_node() or of_find_i2c_adapter_by_node() find
a device by node, but its type does not match, a reference to that
device is still held. This change fixes the problem.

Signed-off-by: Vladimir Zapolskiy 
Signed-off-by: Wolfram Sang 
(cherry picked from commit e3311469734093724b10c2a81c1193197db03b78)
---
 drivers/i2c/i2c-core.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index be992b3..e93dc38 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1335,13 +1335,17 @@ static int of_dev_node_match(struct device *dev, void 
*data)
 struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
 {
struct device *dev;
+   struct i2c_client *client;
 
-   dev = bus_find_device(_bus_type, NULL, node,
-of_dev_node_match);
+   dev = bus_find_device(_bus_type, NULL, node, of_dev_node_match);
if (!dev)
return NULL;
 
-   return i2c_verify_client(dev);
+   client = i2c_verify_client(dev);
+   if (!client)
+   put_device(dev);
+
+   return client;
 }
 EXPORT_SYMBOL(of_find_i2c_device_by_node);
 
@@ -1349,13 +1353,17 @@ EXPORT_SYMBOL(of_find_i2c_device_by_node);
 struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
 {
struct device *dev;
+   struct i2c_adapter *adapter;
 
-   dev = bus_find_device(_bus_type, NULL, node,
-of_dev_node_match);
+   dev = bus_find_device(_bus_type, NULL, node, of_dev_node_match);
if (!dev)
return NULL;
 
-   return i2c_verify_adapter(dev);
+   adapter = i2c_verify_adapter(dev);
+   if (!adapter)
+   put_device(dev);
+
+   return adapter;
 }
 EXPORT_SYMBOL(of_find_i2c_adapter_by_node);
 #else
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 04/19] i2c: check for proper length of the reg property

2016-02-08 Thread Saul Wold
From: Wolfram Sang 

commit bc280e47bc3944af5c7ca3cebaaf07819805ecb6 upstream.

int is vague, let's simply use the type of the variable in question.

Signed-off-by: Wolfram Sang 
Reviewed-by: Simon Horman 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 4c1344f105b626c222ea64669dc6dcfe100ccf3b)
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 77a2ec6..bfd8e1c 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1276,7 +1276,7 @@ static struct i2c_client *of_i2c_register_device(struct 
i2c_adapter *adap,
}
 
addr = of_get_property(node, "reg", );
-   if (!addr || (len < sizeof(int))) {
+   if (!addr || (len < sizeof(*addr))) {
dev_err(>dev, "of_i2c: invalid reg on %s\n",
node->full_name);
return ERR_PTR(-EINVAL);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 03/19] i2c: slave: add error messages to slave core

2016-02-08 Thread Saul Wold
From: Wolfram Sang 

commit 429d57334d73b2c515363d21ad58be16c01d8d25 upstream.

Inform users what went wrong from the core, so drivers don't have to do
it.

Signed-off-by: Wolfram Sang 
Acked-by: Geert Uytterhoeven 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 0c7cab96ec413a69af86965d94fb650f01c5887a)
---
 drivers/i2c/i2c-core.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index fc2ee82..77a2ec6 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -2918,18 +2918,24 @@ int i2c_slave_register(struct i2c_client *client, 
i2c_slave_cb_t slave_cb)
 {
int ret;
 
-   if (!client || !slave_cb)
+   if (!client || !slave_cb) {
+   WARN(1, "insufficent data\n");
return -EINVAL;
+   }
 
if (!(client->flags & I2C_CLIENT_TEN)) {
/* Enforce stricter address checking */
ret = i2c_check_addr_validity(client->addr);
-   if (ret)
+   if (ret) {
+   dev_err(>dev, "%s: invalid address\n", 
__func__);
return ret;
+   }
}
 
-   if (!client->adapter->algo->reg_slave)
+   if (!client->adapter->algo->reg_slave) {
+   dev_err(>dev, "%s: not supported by adapter\n", 
__func__);
return -EOPNOTSUPP;
+   }
 
client->slave_cb = slave_cb;
 
@@ -2937,8 +2943,10 @@ int i2c_slave_register(struct i2c_client *client, 
i2c_slave_cb_t slave_cb)
ret = client->adapter->algo->reg_slave(client);
i2c_unlock_adapter(client->adapter);
 
-   if (ret)
+   if (ret) {
client->slave_cb = NULL;
+   dev_err(>dev, "%s: adapter returned error %d\n", 
__func__, ret);
+   }
 
return ret;
 }
@@ -2948,8 +2956,10 @@ int i2c_slave_unregister(struct i2c_client *client)
 {
int ret;
 
-   if (!client->adapter->algo->unreg_slave)
+   if (!client->adapter->algo->unreg_slave) {
+   dev_err(>dev, "%s: not supported by adapter\n", 
__func__);
return -EOPNOTSUPP;
+   }
 
i2c_lock_adapter(client->adapter);
ret = client->adapter->algo->unreg_slave(client);
@@ -2957,6 +2967,8 @@ int i2c_slave_unregister(struct i2c_client *client)
 
if (ret == 0)
client->slave_cb = NULL;
+   else
+   dev_err(>dev, "%s: adapter returned error %d\n", 
__func__, ret);
 
return ret;
 }
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 09/19] gpio / ACPI: Add support for retrieving GpioInt resources from a device

2016-02-08 Thread Saul Wold
From: Mika Westerberg 

commit ad5b1c69a4ed2cc8486c6afa4d2545b21e5acd9b upstream.

ACPI specification knows two types of GPIOs: GpioIo and GpioInt. The latter
is used to describe that a given device interrupt line is connected to a
specific GPIO pin. Typical ACPI _CRS entry for such device looks like
below:

Name (_CRS, ResourceTemplate ()
{
I2cSerialBus (0x004A, ControllerInitiated, 0x00061A80,
  AddressingMode7Bit, "\\_SB.PCI0.I2C6",
  0x00, ResourceConsumer)
GpioIo (Exclusive, PullDefault, 0x, 0x,
IoRestrictionOutputOnly, "\\_SB.GPO0",
0x00, ResourceConsumer)
{
0x004B
}
GpioInt (Level, ActiveLow, Shared, PullDefault, 0x,
 "\\_SB.GPO0", 0x00, ResourceConsumer)
{
0x004C
}
})

Currently drivers need to request a GPIO corresponding to the right GpioInt
and then translate that to Linux IRQ number. This adds unnecessary lines of
boiler-plate code.

We can ease this a bit by introducing acpi_dev_gpio_irq_get() analogous to
of_irq_get(). This function translates given GpioInt resource under the
device in question to the suitable Linux IRQ number.

Signed-off-by: Mika Westerberg 
Acked-by: Rafael J. Wysocki 
Signed-off-by: Linus Walleij 
(cherry picked from commit c884fbd452147e952ae160e750553d00ea4dc4c9)
---
 drivers/gpio/gpiolib-acpi.c | 29 +
 include/linux/acpi.h|  7 +++
 2 files changed, 36 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 725d161..19b99d0 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -514,6 +514,35 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct 
acpi_device *adev,
return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
 }
 
+/**
+ * acpi_dev_gpio_irq_get() - Find GpioInt and translate it to Linux IRQ number
+ * @adev: pointer to a ACPI device to get IRQ from
+ * @index: index of GpioInt resource (starting from %0)
+ *
+ * If the device has one or more GpioInt resources, this function can be
+ * used to translate from the GPIO offset in the resource to the Linux IRQ
+ * number.
+ *
+ * Return: Linux IRQ number (>%0) on success, negative errno on failure.
+ */
+int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
+{
+   int idx, i;
+
+   for (i = 0, idx = 0; idx <= index; i++) {
+   struct acpi_gpio_info info;
+   struct gpio_desc *desc;
+
+   desc = acpi_get_gpiod_by_index(adev, NULL, i, );
+   if (IS_ERR(desc))
+   break;
+   if (info.gpioint && idx++ == index)
+   return gpiod_to_irq(desc);
+   }
+   return -ENOENT;
+}
+EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get);
+
 static acpi_status
 acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
u32 bits, u64 *value, void *handler_context,
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 808c43a..2a662cb 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -723,6 +723,8 @@ static inline void acpi_dev_remove_driver_gpios(struct 
acpi_device *adev)
if (adev)
adev->driver_gpios = NULL;
 }
+
+int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);
 #else
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
  const struct acpi_gpio_mapping *gpios)
@@ -730,6 +732,11 @@ static inline int acpi_dev_add_driver_gpios(struct 
acpi_device *adev,
return -ENXIO;
 }
 static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
+
+static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
+{
+   return -ENXIO;
+}
 #endif
 
 /* Device properties */
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 05/19] i2c: core: fix typo in comment

2016-02-08 Thread Saul Wold
From: Shailendra Verma 

commit 891e1f106f375232431587baa8a72e2be39a845a upstream.

Signed-off-by: Shailendra Verma 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 95cc1e3d76398c4e8003dafe652285e43be90ee7)
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index bfd8e1c..eefb200 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1677,7 +1677,7 @@ void i2c_del_adapter(struct i2c_adapter *adap)
 * FIXME: This is old code and should ideally be replaced by an
 * alternative which results in decoupling the lifetime of the struct
 * device from the i2c_adapter, like spi or netdev do. Any solution
-* should be throughly tested with DEBUG_KOBJECT_RELEASE enabled!
+* should be thoroughly tested with DEBUG_KOBJECT_RELEASE enabled!
 */
init_completion(>dev_released);
device_unregister(>dev);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 01/19] i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned

2016-02-08 Thread Saul Wold
From: Mika Westerberg 

commit ad5f75aed7f6241aeaf4de293b7caedbc794dcae upstream.

This is the convention used in most parts of the kernel including DT
counterpart of I2C slave enumeration. To make things consistent do the same
for ACPI I2C slave enumeration path as well.

Signed-off-by: Mika Westerberg 
Acked-by: Wolfram Sang 
Signed-off-by: Linus Walleij 
(cherry picked from commit dab472eb931bc2916fa779e56deccd0ec319cf5b)
---
 drivers/i2c/i2c-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 987c124..c21b3de 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -107,7 +107,7 @@ static int acpi_i2c_add_resource(struct acpi_resource 
*ares, void *data)
if (sb->access_mode == ACPI_I2C_10BIT_MODE)
info->flags |= I2C_CLIENT_TEN;
}
-   } else if (info->irq < 0) {
+   } else if (!info->irq) {
struct resource r;
 
if (acpi_dev_resource_interrupt(ares, 0, ))
@@ -134,7 +134,6 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, 
u32 level,
 
memset(, 0, sizeof(info));
info.fwnode = acpi_fwnode_handle(adev);
-   info.irq = -1;
 
INIT_LIST_HEAD(_list);
ret = acpi_dev_get_resources(adev, _list,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 06/19] i2c: core: Reduce stack size of acpi_i2c_space_handler()

2016-02-08 Thread Saul Wold
From: Jarkko Nikula 

commit 8e5d11906f6409f0374527d181808411fa6001e1 upstream.

sizeof(struct i2c_client) is 1088 bytes on a CONFIG_X86_64=y build and
produces following warning when CONFIG_FRAME_WARN is set to 1024:

drivers/i2c/i2c-core.c: In function ‘acpi_i2c_space_handler’:
drivers/i2c/i2c-core.c:367:1: warning: the frame size of 1152 bytes is
larger than 1024 bytes [-Wframe-larger-than=]

This is not critical given that kernel stack is 16 kB on x86_64 but lets
reduce the stack usage by allocating the struct i2c_client from the heap.

Signed-off-by: Jarkko Nikula 
Acked-by: Mika Westerberg 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 7ef85f5fdd081b982d43b95b06272f8646a98818)
---
 drivers/i2c/i2c-core.c | 37 +
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index eefb200..069a41f 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -257,7 +257,7 @@ acpi_i2c_space_handler(u32 function, acpi_physical_address 
command,
struct acpi_connection_info *info = >info;
struct acpi_resource_i2c_serialbus *sb;
struct i2c_adapter *adapter = data->adapter;
-   struct i2c_client client;
+   struct i2c_client *client;
struct acpi_resource *ares;
u32 accessor_type = function >> 16;
u8 action = function & ACPI_IO_MASK;
@@ -268,6 +268,12 @@ acpi_i2c_space_handler(u32 function, acpi_physical_address 
command,
if (ACPI_FAILURE(ret))
return ret;
 
+   client = kzalloc(sizeof(*client), GFP_KERNEL);
+   if (!client) {
+   ret = AE_NO_MEMORY;
+   goto err;
+   }
+
if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
ret = AE_BAD_PARAMETER;
goto err;
@@ -279,75 +285,73 @@ acpi_i2c_space_handler(u32 function, 
acpi_physical_address command,
goto err;
}
 
-   memset(, 0, sizeof(client));
-   client.adapter = adapter;
-   client.addr = sb->slave_address;
-   client.flags = 0;
+   client->adapter = adapter;
+   client->addr = sb->slave_address;
 
if (sb->access_mode == ACPI_I2C_10BIT_MODE)
-   client.flags |= I2C_CLIENT_TEN;
+   client->flags |= I2C_CLIENT_TEN;
 
switch (accessor_type) {
case ACPI_GSB_ACCESS_ATTRIB_SEND_RCV:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_byte();
+   status = i2c_smbus_read_byte(client);
if (status >= 0) {
gsb->bdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_byte(, gsb->bdata);
+   status = i2c_smbus_write_byte(client, gsb->bdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_BYTE:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_byte_data(, command);
+   status = i2c_smbus_read_byte_data(client, command);
if (status >= 0) {
gsb->bdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_byte_data(, command,
+   status = i2c_smbus_write_byte_data(client, command,
gsb->bdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_WORD:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_word_data(, command);
+   status = i2c_smbus_read_word_data(client, command);
if (status >= 0) {
gsb->wdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_word_data(, command,
+   status = i2c_smbus_write_word_data(client, command,
gsb->wdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_BLOCK:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_block_data(, command,
+   status = i2c_smbus_read_block_data(client, command,
gsb->data);
if (status >= 0) {
gsb->len = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_block_data(, command,
+   status = 

[linux-yocto] [PATCH 02/19] i2c / ACPI: Assign IRQ for devices that have GpioInt automatically

2016-02-08 Thread Saul Wold
From: Mika Westerberg 

commit ed457856e712370c6e77303d103ec0103a44e4e9 upstream.

Following what DT already does. If the device does not have ACPI Interrupt
resource but instead it has one or more GpioInt resources listed below it,
we take the first GpioInt resource, convert it to suitable Linux IRQ number
and pass it to the driver instead.

This makes drivers simpler because the don't need to care about GPIOs at
all if only thing they need is interrupt.

Signed-off-by: Mika Westerberg 
Acked-by: Wolfram Sang 
Signed-off-by: Linus Walleij 
(cherry picked from commit 845c877009cf014b971aab7f54613f9185a824b0)
---
 drivers/i2c/i2c-core.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c21b3de..fc2ee82 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -631,8 +631,13 @@ static int i2c_device_probe(struct device *dev)
if (!client)
return 0;
 
-   if (!client->irq && dev->of_node) {
-   int irq = of_irq_get(dev->of_node, 0);
+   if (!client->irq) {
+   int irq = -ENOENT;
+
+   if (dev->of_node)
+   irq = of_irq_get(dev->of_node, 0);
+   else if (ACPI_COMPANION(dev))
+   irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
 
if (irq == -EPROBE_DEFER)
return irq;
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 18/19] at24: enable ACPI device found on Galileo Gen2

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit afbc80ff5adf081edaa2ecb62e291580988f6643 upstream.

There is a 24c08 chip connected to i2c bus on Intel Galileo Gen2 board. Enable
it via ACPI ID INT3499.

Signed-off-by: Andy Shevchenko 
Signed-off-by: Wolfram Sang 
(cherry picked from commit 40d8edc9bf056ea83e50152a4ccd33048d26ccde)
---
 drivers/misc/eeprom/at24.c | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 2d3db81..f837060 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -131,6 +132,12 @@ static const struct i2c_device_id at24_ids[] = {
 };
 MODULE_DEVICE_TABLE(i2c, at24_ids);
 
+static const struct acpi_device_id at24_acpi_ids[] = {
+   { "INT3499", AT24_DEVICE_MAGIC(8192 / 8, 0) },
+   { }
+};
+MODULE_DEVICE_TABLE(acpi, at24_acpi_ids);
+
 /*-*/
 
 /*
@@ -495,21 +502,29 @@ static void at24_get_ofdata(struct i2c_client *client,
 static int at24_probe(struct i2c_client *client, const struct i2c_device_id 
*id)
 {
struct at24_platform_data chip;
+   kernel_ulong_t magic = 0;
bool writable;
int use_smbus = 0;
int use_smbus_write = 0;
struct at24_data *at24;
int err;
unsigned i, num_addresses;
-   kernel_ulong_t magic;
 
if (client->dev.platform_data) {
chip = *(struct at24_platform_data *)client->dev.platform_data;
} else {
-   if (!id->driver_data)
+   if (id) {
+   magic = id->driver_data;
+   } else {
+   const struct acpi_device_id *aid;
+
+   aid = acpi_match_device(at24_acpi_ids, >dev);
+   if (aid)
+   magic = aid->driver_data;
+   }
+   if (!magic)
return -ENODEV;
 
-   magic = id->driver_data;
chip.byte_len = BIT(magic & AT24_BITMASK(AT24_SIZE_BYTELEN));
magic >>= AT24_SIZE_BYTELEN;
chip.flags = magic & AT24_BITMASK(AT24_SIZE_FLAGS);
@@ -690,6 +705,7 @@ static struct i2c_driver at24_driver = {
.driver = {
.name = "at24",
.owner = THIS_MODULE,
+   .acpi_match_table = ACPI_PTR(at24_acpi_ids),
},
.probe = at24_probe,
.remove = at24_remove,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 19/19] pwm-pca9685: enable ACPI device found on Galileo Gen2

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit c28d0a843b44f79f71249d5612804c29483b586d upstream.

There is a chip connected to i2c bus on Intel Galileo Gen2 board. Enable it via
ACPI ID INT3492.

Cc: Thierry Reding 
Signed-off-by: Andy Shevchenko 
Signed-off-by: Thierry Reding 
(cherry picked from commit 912b8439041317a0562609ad892eeab9ba2f0cb2)
---
 drivers/pwm/Kconfig   |  2 +-
 drivers/pwm/pwm-pca9685.c | 20 
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index b1541f4..749198f 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -223,7 +223,7 @@ config PWM_MXS
 
 config PWM_PCA9685
tristate "NXP PCA9685 PWM driver"
-   depends on OF && I2C
+   depends on I2C
select REGMAP_I2C
help
  Generic PWM framework driver for NXP PCA9685 LED controller.
diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c
index 34b5c27..8a1bd49 100644
--- a/drivers/pwm/pwm-pca9685.c
+++ b/drivers/pwm/pwm-pca9685.c
@@ -18,9 +18,11 @@
  * this program.  If not, see .
  */
 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -212,7 +214,6 @@ static const struct regmap_config pca9685_regmap_i2c_config 
= {
 static int pca9685_pwm_probe(struct i2c_client *client,
const struct i2c_device_id *id)
 {
-   struct device_node *np = client->dev.of_node;
struct pca9685 *pca;
int ret;
int mode2;
@@ -233,12 +234,12 @@ static int pca9685_pwm_probe(struct i2c_client *client,
 
regmap_read(pca->regmap, PCA9685_MODE2, );
 
-   if (of_property_read_bool(np, "invert"))
+   if (device_property_read_bool(>dev, "invert"))
mode2 |= MODE2_INVRT;
else
mode2 &= ~MODE2_INVRT;
 
-   if (of_property_read_bool(np, "open-drain"))
+   if (device_property_read_bool(>dev, "open-drain"))
mode2 &= ~MODE2_OUTDRV;
else
mode2 |= MODE2_OUTDRV;
@@ -276,17 +277,28 @@ static const struct i2c_device_id pca9685_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pca9685_id);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id pca9685_acpi_ids[] = {
+   { "INT3492", 0 },
+   { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(acpi, pca9685_acpi_ids);
+#endif
+
+#ifdef CONFIG_OF
 static const struct of_device_id pca9685_dt_ids[] = {
{ .compatible = "nxp,pca9685-pwm", },
{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, pca9685_dt_ids);
+#endif
 
 static struct i2c_driver pca9685_i2c_driver = {
.driver = {
.name = "pca9685-pwm",
.owner = THIS_MODULE,
-   .of_match_table = pca9685_dt_ids,
+   .acpi_match_table = ACPI_PTR(pca9685_acpi_ids),
+   .of_match_table = of_match_ptr(pca9685_dt_ids),
},
.probe = pca9685_pwm_probe,
.remove = pca9685_pwm_remove,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 16/19] gpio: pca953x: store driver_data for future use

2016-02-08 Thread Saul Wold
From: Andy Shevchenko 

commit e0599e216341d4e0b69b57145c956a7028f06a81 upstream.

Instead of using id->driver_data directly we copied it to the internal
structure. This will help to adapt driver for ACPI use.

Signed-off-by: Andy Shevchenko 
Signed-off-by: Linus Walleij 
(cherry picked from commit c6664149af2939b8bbaef0711b3ca5469bed33fb)
---
 drivers/gpio/gpio-pca953x.c | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index e2da64a..56f679b 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -42,6 +42,9 @@
 #define PCA_INT0x0100
 #define PCA953X_TYPE   0x1000
 #define PCA957X_TYPE   0x2000
+#define PCA_TYPE_MASK  0xF000
+
+#define PCA_CHIP_TYPE(x)   ((x) & PCA_TYPE_MASK)
 
 static const struct i2c_device_id pca953x_id[] = {
{ "pca9505", 40 | PCA953X_TYPE | PCA_INT, },
@@ -95,6 +98,7 @@ struct pca953x_chip {
struct gpio_chip gpio_chip;
const char *const *names;
int chip_type;
+   unsigned long driver_data;
 };
 
 static inline struct pca953x_chip *to_pca(struct gpio_chip *gc)
@@ -514,14 +518,13 @@ static irqreturn_t pca953x_irq_handler(int irq, void 
*devid)
 }
 
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-const struct i2c_device_id *id,
 int irq_base)
 {
struct i2c_client *client = chip->client;
int ret, i, offset = 0;
 
if (client->irq && irq_base != -1
-   && (id->driver_data & PCA_INT)) {
+   && (chip->driver_data & PCA_INT)) {
 
switch (chip->chip_type) {
case PCA953X_TYPE:
@@ -574,12 +577,11 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 
 #else /* CONFIG_GPIO_PCA953X_IRQ */
 static int pca953x_irq_setup(struct pca953x_chip *chip,
-const struct i2c_device_id *id,
 int irq_base)
 {
struct i2c_client *client = chip->client;
 
-   if (irq_base != -1 && (id->driver_data & PCA_INT))
+   if (irq_base != -1 && (chip->driver_data & PCA_INT))
dev_warn(>dev, "interrupt support not compiled in\n");
 
return 0;
@@ -666,14 +668,15 @@ static int pca953x_probe(struct i2c_client *client,
 
chip->client = client;
 
-   chip->chip_type = id->driver_data & (PCA953X_TYPE | PCA957X_TYPE);
+   chip->driver_data = id->driver_data;
+   chip->chip_type = PCA_CHIP_TYPE(chip->driver_data);
 
mutex_init(>i2c_lock);
 
/* initialize cached registers from their original values.
 * we can't share this chip with another i2c master.
 */
-   pca953x_setup_gpio(chip, id->driver_data & PCA_GPIO_MASK);
+   pca953x_setup_gpio(chip, chip->driver_data & PCA_GPIO_MASK);
 
if (chip->chip_type == PCA953X_TYPE)
ret = device_pca953x_init(chip, invert);
@@ -686,7 +689,7 @@ static int pca953x_probe(struct i2c_client *client,
if (ret)
return ret;
 
-   ret = pca953x_irq_setup(chip, id, irq_base);
+   ret = pca953x_irq_setup(chip, irq_base);
if (ret)
return ret;
 
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 05/29] i2c: core: fix typo in comment

2016-02-05 Thread Saul Wold
From: Shailendra Verma <shailendra.capric...@gmail.com>

Signed-off-by: Shailendra Verma <shailendra.capric...@gmail.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index bfd8e1c..eefb200 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1677,7 +1677,7 @@ void i2c_del_adapter(struct i2c_adapter *adap)
 * FIXME: This is old code and should ideally be replaced by an
 * alternative which results in decoupling the lifetime of the struct
 * device from the i2c_adapter, like spi or netdev do. Any solution
-* should be throughly tested with DEBUG_KOBJECT_RELEASE enabled!
+* should be thoroughly tested with DEBUG_KOBJECT_RELEASE enabled!
 */
init_completion(>dev_released);
device_unregister(>dev);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 04/29] i2c: check for proper length of the reg property

2016-02-05 Thread Saul Wold
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

int is vague, let's simply use the type of the variable in question.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 77a2ec6..bfd8e1c 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1276,7 +1276,7 @@ static struct i2c_client *of_i2c_register_device(struct 
i2c_adapter *adap,
}
 
addr = of_get_property(node, "reg", );
-   if (!addr || (len < sizeof(int))) {
+   if (!addr || (len < sizeof(*addr))) {
dev_err(>dev, "of_i2c: invalid reg on %s\n",
node->full_name);
return ERR_PTR(-EINVAL);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 00/29] Backports and other features for Galileo

2016-02-05 Thread Saul Wold
Bruce,

This is a set of patches that are currently being maintained in the
meta-intel-galileo BSP which we are working to merge into meta-intel
proper.

These include items that are backported from newer versions as well 
as some galileo specific items.

There is one ARM patch that touches i2c and is related to handling sensors.

I pushed this patch set to linux-yocto-contrib/sgw/patched

Thanks
   Sau!

Andy Shevchenko (8):
  mfd: core: redo ACPI matching of the children devices
  mfd: intel_quark_i2c_gpio: load gpio driver first
  mfd: intel_quark_i2c_gpio: support devices behind i2c bus
  gpio: pca953x: store driver_data for future use
  gpio: pca953x: support ACPI devices found on Galileo Gen2
  at24: enable ACPI device found on Galileo Gen2
  pwm-pca9685: enable ACPI device found on Galileo Gen2
  gpio: pca953x: provide GPIO base based on _UID

Hanjun Guo (1):
  GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module
use

Ismo Puustinen (5):
  acpi: added a custom DSDT file.
  acpi: updated DSDT table for SPI devices.
  spi-pxa2xx: fixed ACPI-based enumeration of SPI devices.
  adc1x8s102: support ACPI-based enumeration.
  gpio-pca953x: add "drive" property.

Jan Luebbe (1):
  i2c: core: only use set_scl for bus recovery after calling
prepare_recovery

Jarkko Nikula (1):
  i2c: core: Reduce stack size of acpi_i2c_space_handler()

Josef Ahmad (1):
  pca9685: PCA9685 PWM and GPIO multi-function device.

Mika Westerberg (5):
  i2c / ACPI: Use 0 to indicate that device does not have interrupt
assigned
  i2c / ACPI: Assign IRQ for devices that have GpioInt automatically
  gpio / ACPI: Add support for retrieving GpioInt resources from a
device
  gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
  i2c / ACPI: Rework I2C device scanning

Nishanth Menon (1):
  ARM: dts: am335x-boneblack: configure i2c1 and 2

Shailendra Verma (1):
  i2c: core: fix typo in comment

Todor Minchev (1):
  staging:iio: add support for ADC1x8s102.

Tomasz Duszynski (1):
  iio: light: add support for ROHM BH1710/BH1715/BH1721/BH1750/BH1751
ambient light sensors

Vladimir Zapolskiy (1):
  i2c: fix leaked device refcount on of_find_i2c_* error path

Wolfram Sang (2):
  i2c: slave: add error messages to slave core
  i2c: check for proper length of the reg property

 Documentation/acpi/enumeration.txt   |   11 +-
 arch/arm/boot/dts/am335x-boneblack.dts   |   30 +
 drivers/gpio/gpio-pca953x.c  |  123 +++-
 drivers/gpio/gpiolib-acpi.c  |   40 +-
 drivers/gpio/gpiolib-sysfs.c |   78 ++
 drivers/gpio/gpiolib.c   |   18 +
 drivers/gpio/gpiolib.h   |7 +-
 drivers/i2c/i2c-core.c   |  179 +++--
 drivers/iio/light/Kconfig|   10 +
 drivers/iio/light/Makefile   |1 +
 drivers/iio/light/bh1750.c   |  334 +
 drivers/mfd/Kconfig  |   10 +
 drivers/mfd/Makefile |2 +
 drivers/mfd/intel_quark_i2c_gpio.c   |   32 +-
 drivers/mfd/mfd-core.c   |   52 +-
 drivers/mfd/pca9685-core.c   |  308 
 drivers/mfd/pca9685-gpio.c   |  108 +++
 drivers/mfd/pca9685-pwm.c|  262 +++
 drivers/mfd/pca9685.h|  110 +++
 drivers/misc/eeprom/at24.c   |   22 +-
 drivers/pwm/Kconfig  |2 +-
 drivers/pwm/pwm-pca9685.c|   20 +-
 drivers/spi/spi-pxa2xx-pci.c |1 +
 drivers/staging/iio/adc/Kconfig  |   13 +
 drivers/staging/iio/adc/Makefile |1 +
 drivers/staging/iio/adc/adc1x8s102.c |  437 +++
 include/DSDT.hex | 1166 ++
 include/asm-generic/gpio.h   |5 +
 include/linux/acpi.h |7 +
 include/linux/gpio.h |   10 +
 include/linux/gpio/consumer.h|   11 +
 include/linux/gpio/driver.h  |2 +
 include/linux/mfd/core.h |   10 +-
 include/linux/platform_data/adc1x8s102.h |   30 +
 include/linux/platform_data/pca9685.h|   51 ++
 35 files changed, 3390 insertions(+), 113 deletions(-)
 create mode 100644 drivers/iio/light/bh1750.c
 create mode 100644 drivers/mfd/pca9685-core.c
 create mode 100644 drivers/mfd/pca9685-gpio.c
 create mode 100644 drivers/mfd/pca9685-pwm.c
 create mode 100644 drivers/mfd/pca9685.h
 create mode 100644 drivers/staging/iio/adc/adc1x8s102.c
 create mode 100644 include/DSDT.hex
 create mode 100644 include/linux/platform_data/adc1x8s102.h
 create mode 100644 include/linux/platform_data/pca9685.h

-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 07/29] i2c: core: only use set_scl for bus recovery after calling prepare_recovery

2016-02-05 Thread Saul Wold
From: Jan Luebbe <j...@pengutronix.de>

Using set_scl may be ineffective before calling the driver specific
prepare_recovery callback, which might change into a test mode. So
instead of setting SCL in i2c_generic_scl_recovery, move it to
i2c_generic_recovery (after the optional prepare_recovery).

Signed-off-by: Jan Luebbe <j...@pengutronix.de>
Acked-by: Alexander Sverdlin <alexander.sverd...@nokia.com>
Tested-by: Alexander Sverdlin <alexander.sverd...@gmail.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 069a41f..be992b3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -567,6 +567,9 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
if (bri->prepare_recovery)
bri->prepare_recovery(adap);
 
+   bri->set_scl(adap, val);
+   ndelay(RECOVERY_NDELAY);
+
/*
 * By this time SCL is high, as we need to give 9 falling-rising edges
 */
@@ -597,7 +600,6 @@ static int i2c_generic_recovery(struct i2c_adapter *adap)
 
 int i2c_generic_scl_recovery(struct i2c_adapter *adap)
 {
-   adap->bus_recovery_info->set_scl(adap, 1);
return i2c_generic_recovery(adap);
 }
 EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery);
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 10/29] GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module use

2016-02-05 Thread Saul Wold
From: Hanjun Guo <hanjun@linaro.org>

acpi_gpiochip_request(free)_interrupts can be used for modules,
so export them. This also fixs a compile error when xgene-sb
configured as kernel module.

Fixes: 733cf014f020 "gpio: xgene: add ACPI support for APM X-Gene GPIO standby 
driver"
Reviewed-by: Mark Brown <broo...@kernel.org>
Signed-off-by: Hanjun Guo <hanjun@linaro.org>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 19b99d0..980a996 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -307,6 +307,7 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip 
*chip)
acpi_walk_resources(handle, "_AEI",
acpi_gpiochip_request_interrupt, acpi_gpio);
 }
+EXPORT_SYMBOL_GPL(acpi_gpiochip_request_interrupts);
 
 /**
  * acpi_gpiochip_free_interrupts() - Free GPIO ACPI event interrupts.
@@ -346,6 +347,7 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
kfree(event);
}
 }
+EXPORT_SYMBOL_GPL(acpi_gpiochip_free_interrupts);
 
 int acpi_dev_add_driver_gpios(struct acpi_device *adev,
  const struct acpi_gpio_mapping *gpios)
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 02/29] i2c / ACPI: Assign IRQ for devices that have GpioInt automatically

2016-02-05 Thread Saul Wold
From: Mika Westerberg <mika.westerb...@linux.intel.com>

Following what DT already does. If the device does not have ACPI Interrupt
resource but instead it has one or more GpioInt resources listed below it,
we take the first GpioInt resource, convert it to suitable Linux IRQ number
and pass it to the driver instead.

This makes drivers simpler because the don't need to care about GPIOs at
all if only thing they need is interrupt.

Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Acked-by: Wolfram Sang <w...@the-dreams.de>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c21b3de..fc2ee82 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -631,8 +631,13 @@ static int i2c_device_probe(struct device *dev)
if (!client)
return 0;
 
-   if (!client->irq && dev->of_node) {
-   int irq = of_irq_get(dev->of_node, 0);
+   if (!client->irq) {
+   int irq = -ENOENT;
+
+   if (dev->of_node)
+   irq = of_irq_get(dev->of_node, 0);
+   else if (ACPI_COMPANION(dev))
+   irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
 
if (irq == -EPROBE_DEFER)
return irq;
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 06/29] i2c: core: Reduce stack size of acpi_i2c_space_handler()

2016-02-05 Thread Saul Wold
From: Jarkko Nikula <jarkko.nik...@linux.intel.com>

sizeof(struct i2c_client) is 1088 bytes on a CONFIG_X86_64=y build and
produces following warning when CONFIG_FRAME_WARN is set to 1024:

drivers/i2c/i2c-core.c: In function ‘acpi_i2c_space_handler’:
drivers/i2c/i2c-core.c:367:1: warning: the frame size of 1152 bytes is
larger than 1024 bytes [-Wframe-larger-than=]

This is not critical given that kernel stack is 16 kB on x86_64 but lets
reduce the stack usage by allocating the struct i2c_client from the heap.

Signed-off-by: Jarkko Nikula <jarkko.nik...@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 37 +
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index eefb200..069a41f 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -257,7 +257,7 @@ acpi_i2c_space_handler(u32 function, acpi_physical_address 
command,
struct acpi_connection_info *info = >info;
struct acpi_resource_i2c_serialbus *sb;
struct i2c_adapter *adapter = data->adapter;
-   struct i2c_client client;
+   struct i2c_client *client;
struct acpi_resource *ares;
u32 accessor_type = function >> 16;
u8 action = function & ACPI_IO_MASK;
@@ -268,6 +268,12 @@ acpi_i2c_space_handler(u32 function, acpi_physical_address 
command,
if (ACPI_FAILURE(ret))
return ret;
 
+   client = kzalloc(sizeof(*client), GFP_KERNEL);
+   if (!client) {
+   ret = AE_NO_MEMORY;
+   goto err;
+   }
+
if (!value64 || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS) {
ret = AE_BAD_PARAMETER;
goto err;
@@ -279,75 +285,73 @@ acpi_i2c_space_handler(u32 function, 
acpi_physical_address command,
goto err;
}
 
-   memset(, 0, sizeof(client));
-   client.adapter = adapter;
-   client.addr = sb->slave_address;
-   client.flags = 0;
+   client->adapter = adapter;
+   client->addr = sb->slave_address;
 
if (sb->access_mode == ACPI_I2C_10BIT_MODE)
-   client.flags |= I2C_CLIENT_TEN;
+   client->flags |= I2C_CLIENT_TEN;
 
switch (accessor_type) {
case ACPI_GSB_ACCESS_ATTRIB_SEND_RCV:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_byte();
+   status = i2c_smbus_read_byte(client);
if (status >= 0) {
gsb->bdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_byte(, gsb->bdata);
+   status = i2c_smbus_write_byte(client, gsb->bdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_BYTE:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_byte_data(, command);
+   status = i2c_smbus_read_byte_data(client, command);
if (status >= 0) {
gsb->bdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_byte_data(, command,
+   status = i2c_smbus_write_byte_data(client, command,
gsb->bdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_WORD:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_word_data(, command);
+   status = i2c_smbus_read_word_data(client, command);
if (status >= 0) {
gsb->wdata = status;
status = 0;
}
} else {
-   status = i2c_smbus_write_word_data(, command,
+   status = i2c_smbus_write_word_data(client, command,
gsb->wdata);
}
break;
 
case ACPI_GSB_ACCESS_ATTRIB_BLOCK:
if (action == ACPI_READ) {
-   status = i2c_smbus_read_block_data(, command,
+   status = i2c_smbus_read_block_data(client, command,
gsb->data);
if (status >= 0) {
gsb->len = status;
status = 0;
}
} else {
-   status = i2c_smb

[linux-yocto] [PATCH 01/29] i2c / ACPI: Use 0 to indicate that device does not have interrupt assigned

2016-02-05 Thread Saul Wold
From: Mika Westerberg <mika.westerb...@linux.intel.com>

This is the convention used in most parts of the kernel including DT
counterpart of I2C slave enumeration. To make things consistent do the same
for ACPI I2C slave enumeration path as well.

Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Acked-by: Wolfram Sang <w...@the-dreams.de>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 987c124..c21b3de 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -107,7 +107,7 @@ static int acpi_i2c_add_resource(struct acpi_resource 
*ares, void *data)
if (sb->access_mode == ACPI_I2C_10BIT_MODE)
info->flags |= I2C_CLIENT_TEN;
}
-   } else if (info->irq < 0) {
+   } else if (!info->irq) {
struct resource r;
 
if (acpi_dev_resource_interrupt(ares, 0, ))
@@ -134,7 +134,6 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, 
u32 level,
 
memset(, 0, sizeof(info));
info.fwnode = acpi_fwnode_handle(adev);
-   info.irq = -1;
 
INIT_LIST_HEAD(_list);
ret = acpi_dev_get_resources(adev, _list,
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 12/29] i2c / ACPI: Rework I2C device scanning

2016-02-05 Thread Saul Wold
From: Mika Westerberg <mika.westerb...@linux.intel.com>

The way we currently scan I2C devices behind an I2C host controller does not
work in cases where the I2C device in question is not declared directly below
the host controller ACPI node.

This is perfectly legal according the ACPI 6.0 specification and some existing
systems are doing this.

To be able to enumerate all devices which are connected to a certain I2C host
controller we need to rework the current I2C scanning routine a bit. Instead of
scanning directly below the host controller we scan the whole ACPI namespace
for present devices with valid I2cSerialBus() connection pointing to the host
controller in question.

Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Upstream-status: Submitted
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 82 --
 1 file changed, 59 insertions(+), 23 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e93dc38..372da32 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -94,27 +94,40 @@ struct gsb_buffer {
};
 } __packed;
 
-static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data)
+struct acpi_i2c_lookup {
+   struct i2c_board_info *info;
+   acpi_handle adapter_handle;
+   acpi_handle device_handle;
+};
+
+static int acpi_i2c_find_address(struct acpi_resource *ares, void *data)
 {
-   struct i2c_board_info *info = data;
+   struct acpi_i2c_lookup *lookup = data;
+   struct i2c_board_info *info = lookup->info;
+   struct acpi_resource_i2c_serialbus *sb;
+   acpi_handle adapter_handle;
+   acpi_status status;
 
-   if (ares->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
-   struct acpi_resource_i2c_serialbus *sb;
+   if (info->addr || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS)
+   return 1;
 
-   sb = >data.i2c_serial_bus;
-   if (!info->addr && sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) {
-   info->addr = sb->slave_address;
-   if (sb->access_mode == ACPI_I2C_10BIT_MODE)
-   info->flags |= I2C_CLIENT_TEN;
-   }
-   } else if (!info->irq) {
-   struct resource r;
+   sb = >data.i2c_serial_bus;
+   if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C)
+   return 1;
 
-   if (acpi_dev_resource_interrupt(ares, 0, ))
-   info->irq = r.start;
+   /*
+* Extract the ResourceSource and make sure that the handle matches
+* with the I2C adapter handle.
+*/
+   status = acpi_get_handle(lookup->device_handle,
+sb->resource_source.string_ptr,
+_handle);
+   if (ACPI_SUCCESS(status) && adapter_handle == lookup->adapter_handle) {
+   info->addr = sb->slave_address;
+   if (sb->access_mode == ACPI_I2C_10BIT_MODE)
+   info->flags |= I2C_CLIENT_TEN;
}
 
-   /* Tell the ACPI core to skip this resource */
return 1;
 }
 
@@ -123,6 +136,8 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, 
u32 level,
 {
struct i2c_adapter *adapter = data;
struct list_head resource_list;
+   struct acpi_i2c_lookup lookup;
+   struct resource_entry *entry;
struct i2c_board_info info;
struct acpi_device *adev;
int ret;
@@ -135,14 +150,37 @@ static acpi_status acpi_i2c_add_device(acpi_handle 
handle, u32 level,
memset(, 0, sizeof(info));
info.fwnode = acpi_fwnode_handle(adev);
 
+   memset(, 0, sizeof(lookup));
+   lookup.adapter_handle = ACPI_HANDLE(adapter->dev.parent);
+   lookup.device_handle = handle;
+   lookup.info = 
+
+   /*
+* Look up for I2cSerialBus resource with ResourceSource that
+* matches with this adapter.
+*/
INIT_LIST_HEAD(_list);
ret = acpi_dev_get_resources(adev, _list,
-acpi_i2c_add_resource, );
+acpi_i2c_find_address, );
acpi_dev_free_resource_list(_list);
 
if (ret < 0 || !info.addr)
return AE_OK;
 
+   /* Then fill IRQ number if any */
+   ret = acpi_dev_get_resources(adev, _list, NULL, NULL);
+   if (ret < 0)
+   return AE_OK;
+
+   resource_list_for_each_entry(entry, _list) {
+   if (resource_type(entry->res) == IORESOURCE_IRQ) {
+   info.irq = entry->res->start;
+   break;
+   }
+   }
+
+   acpi_dev_free_resource_list(_list);
+
adev->power

[linux-yocto] [PATCH 13/29] mfd: core: redo ACPI matching of the children devices

2016-02-05 Thread Saul Wold
From: Andy Shevchenko <andriy.shevche...@linux.intel.com>

There is at least one board on the market, i.e. Intel Galileo Gen2, that uses
_ADR to distinguish the devices under one actual device. Due to this we have to
improve the quirk in the MFD core to handle that board.

Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Upstream-status: Submitted
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 Documentation/acpi/enumeration.txt | 11 +---
 drivers/mfd/mfd-core.c | 52 ++
 include/linux/mfd/core.h   | 10 ++--
 3 files changed, 52 insertions(+), 21 deletions(-)

diff --git a/Documentation/acpi/enumeration.txt 
b/Documentation/acpi/enumeration.txt
index 15dfce7..afd34d0 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -347,13 +347,18 @@ For the first case, the MFD drivers do not need to do 
anything. The
 resulting child platform device will have its ACPI_COMPANION() set to point
 to the parent device.
 
-If the ACPI namespace has a device that we can match using an ACPI id,
-the id should be set like:
+If the ACPI namespace has a device that we can match using an ACPI id or ACPI
+adr, the cell should be set like:
+
+   static struct mfd_cell_acpi_match my_subdevice_cell_acpi_match = {
+   .pnpid = "XYZ0001",
+   .adr = 0,
+   };
 
static struct mfd_cell my_subdevice_cell = {
.name = "my_subdevice",
/* set the resources relative to the parent */
-   .acpi_pnpid = "XYZ0001",
+   .acpi_match = _subdevice_cell_acpi_match,
};
 
 The ACPI id "XYZ0001" is then used to lookup an ACPI device directly under
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 1aed3b7..ea844dc 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -82,29 +82,49 @@ static int mfd_platform_add_cell(struct platform_device 
*pdev,
 static void mfd_acpi_add_device(const struct mfd_cell *cell,
struct platform_device *pdev)
 {
-   struct acpi_device *parent_adev;
+   const struct mfd_cell_acpi_match *match = cell->acpi_match;
+   struct acpi_device *parent, *child;
struct acpi_device *adev;
 
-   parent_adev = ACPI_COMPANION(pdev->dev.parent);
-   if (!parent_adev)
+   parent = ACPI_COMPANION(pdev->dev.parent);
+   if (!parent)
return;
 
/*
-* MFD child device gets its ACPI handle either from the ACPI
-* device directly under the parent that matches the acpi_pnpid or
-* it will use the parent handle if is no acpi_pnpid is given.
+* MFD child device gets its ACPI handle either from the ACPI device
+* directly under the parent that matches the either _HID or _CID, or
+* _ADR or it will use the parent handle if is no ID is given.
+*
+* Note that use of _ADR is a grey area in the ACPI specification,
+* though Intel Galileo Gen2 is using it to distinguish the children
+* devices.
 */
-   adev = parent_adev;
-   if (cell->acpi_pnpid) {
-   struct acpi_device_id ids[2] = {};
-   struct acpi_device *child_adev;
-
-   strlcpy(ids[0].id, cell->acpi_pnpid, sizeof(ids[0].id));
-   list_for_each_entry(child_adev, _adev->children, node)
-   if (acpi_match_device_ids(child_adev, ids)) {
-   adev = child_adev;
-   break;
+   adev = parent;
+   if (match) {
+   if (match->pnpid) {
+   struct acpi_device_id ids[2] = {};
+
+   strlcpy(ids[0].id, match->pnpid, sizeof(ids[0].id));
+   list_for_each_entry(child, >children, node) {
+   if (acpi_match_device_ids(child, ids)) {
+   adev = child;
+   break;
+   }
+   }
+   } else {
+   unsigned long long adr;
+   acpi_status status;
+
+   list_for_each_entry(child, >children, node) {
+   status = acpi_evaluate_integer(child->handle,
+  "_ADR", NULL,
+  );
+   if (ACPI_SUCCESS(status) && match->adr == adr) {
+   adev = child;
+   break;
+   }
}
+   }
}
 
ACPI_COMPANION_SET(>dev, adev);
diff --git a/include/linux/mfd/core.h b/i

[linux-yocto] [PATCH 03/29] i2c: slave: add error messages to slave core

2016-02-05 Thread Saul Wold
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Inform users what went wrong from the core, so drivers don't have to do
it.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+rene...@glider.be>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index fc2ee82..77a2ec6 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -2918,18 +2918,24 @@ int i2c_slave_register(struct i2c_client *client, 
i2c_slave_cb_t slave_cb)
 {
int ret;
 
-   if (!client || !slave_cb)
+   if (!client || !slave_cb) {
+   WARN(1, "insufficent data\n");
return -EINVAL;
+   }
 
if (!(client->flags & I2C_CLIENT_TEN)) {
/* Enforce stricter address checking */
ret = i2c_check_addr_validity(client->addr);
-   if (ret)
+   if (ret) {
+   dev_err(>dev, "%s: invalid address\n", 
__func__);
return ret;
+   }
}
 
-   if (!client->adapter->algo->reg_slave)
+   if (!client->adapter->algo->reg_slave) {
+   dev_err(>dev, "%s: not supported by adapter\n", 
__func__);
return -EOPNOTSUPP;
+   }
 
client->slave_cb = slave_cb;
 
@@ -2937,8 +2943,10 @@ int i2c_slave_register(struct i2c_client *client, 
i2c_slave_cb_t slave_cb)
ret = client->adapter->algo->reg_slave(client);
i2c_unlock_adapter(client->adapter);
 
-   if (ret)
+   if (ret) {
client->slave_cb = NULL;
+   dev_err(>dev, "%s: adapter returned error %d\n", 
__func__, ret);
+   }
 
return ret;
 }
@@ -2948,8 +2956,10 @@ int i2c_slave_unregister(struct i2c_client *client)
 {
int ret;
 
-   if (!client->adapter->algo->unreg_slave)
+   if (!client->adapter->algo->unreg_slave) {
+   dev_err(>dev, "%s: not supported by adapter\n", 
__func__);
return -EOPNOTSUPP;
+   }
 
i2c_lock_adapter(client->adapter);
ret = client->adapter->algo->unreg_slave(client);
@@ -2957,6 +2967,8 @@ int i2c_slave_unregister(struct i2c_client *client)
 
if (ret == 0)
client->slave_cb = NULL;
+   else
+   dev_err(>dev, "%s: adapter returned error %d\n", 
__func__, ret);
 
return ret;
 }
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 09/29] gpio / ACPI: Add support for retrieving GpioInt resources from a device

2016-02-05 Thread Saul Wold
From: Mika Westerberg <mika.westerb...@linux.intel.com>

ACPI specification knows two types of GPIOs: GpioIo and GpioInt. The latter
is used to describe that a given device interrupt line is connected to a
specific GPIO pin. Typical ACPI _CRS entry for such device looks like
below:

Name (_CRS, ResourceTemplate ()
{
I2cSerialBus (0x004A, ControllerInitiated, 0x00061A80,
  AddressingMode7Bit, "\\_SB.PCI0.I2C6",
  0x00, ResourceConsumer)
GpioIo (Exclusive, PullDefault, 0x, 0x,
IoRestrictionOutputOnly, "\\_SB.GPO0",
0x00, ResourceConsumer)
{
0x004B
}
GpioInt (Level, ActiveLow, Shared, PullDefault, 0x,
 "\\_SB.GPO0", 0x00, ResourceConsumer)
{
0x004C
}
})

Currently drivers need to request a GPIO corresponding to the right GpioInt
and then translate that to Linux IRQ number. This adds unnecessary lines of
boiler-plate code.

We can ease this a bit by introducing acpi_dev_gpio_irq_get() analogous to
of_irq_get(). This function translates given GpioInt resource under the
device in question to the suitable Linux IRQ number.

Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 29 +
 include/linux/acpi.h|  7 +++
 2 files changed, 36 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 725d161..19b99d0 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -514,6 +514,35 @@ struct gpio_desc *acpi_get_gpiod_by_index(struct 
acpi_device *adev,
return lookup.desc ? lookup.desc : ERR_PTR(-ENOENT);
 }
 
+/**
+ * acpi_dev_gpio_irq_get() - Find GpioInt and translate it to Linux IRQ number
+ * @adev: pointer to a ACPI device to get IRQ from
+ * @index: index of GpioInt resource (starting from %0)
+ *
+ * If the device has one or more GpioInt resources, this function can be
+ * used to translate from the GPIO offset in the resource to the Linux IRQ
+ * number.
+ *
+ * Return: Linux IRQ number (>%0) on success, negative errno on failure.
+ */
+int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
+{
+   int idx, i;
+
+   for (i = 0, idx = 0; idx <= index; i++) {
+   struct acpi_gpio_info info;
+   struct gpio_desc *desc;
+
+   desc = acpi_get_gpiod_by_index(adev, NULL, i, );
+   if (IS_ERR(desc))
+   break;
+   if (info.gpioint && idx++ == index)
+   return gpiod_to_irq(desc);
+   }
+   return -ENOENT;
+}
+EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get);
+
 static acpi_status
 acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
u32 bits, u64 *value, void *handler_context,
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 808c43a..2a662cb 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -723,6 +723,8 @@ static inline void acpi_dev_remove_driver_gpios(struct 
acpi_device *adev)
if (adev)
adev->driver_gpios = NULL;
 }
+
+int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);
 #else
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
  const struct acpi_gpio_mapping *gpios)
@@ -730,6 +732,11 @@ static inline int acpi_dev_add_driver_gpios(struct 
acpi_device *adev,
return -ENXIO;
 }
 static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
+
+static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
+{
+   return -ENXIO;
+}
 #endif
 
 /* Device properties */
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 08/29] i2c: fix leaked device refcount on of_find_i2c_* error path

2016-02-05 Thread Saul Wold
From: Vladimir Zapolskiy <vladimir_zapols...@mentor.com>

If of_find_i2c_device_by_node() or of_find_i2c_adapter_by_node() find
a device by node, but its type does not match, a reference to that
device is still held. This change fixes the problem.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapols...@mentor.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/i2c/i2c-core.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index be992b3..e93dc38 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1335,13 +1335,17 @@ static int of_dev_node_match(struct device *dev, void 
*data)
 struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
 {
struct device *dev;
+   struct i2c_client *client;
 
-   dev = bus_find_device(_bus_type, NULL, node,
-of_dev_node_match);
+   dev = bus_find_device(_bus_type, NULL, node, of_dev_node_match);
if (!dev)
return NULL;
 
-   return i2c_verify_client(dev);
+   client = i2c_verify_client(dev);
+   if (!client)
+   put_device(dev);
+
+   return client;
 }
 EXPORT_SYMBOL(of_find_i2c_device_by_node);
 
@@ -1349,13 +1353,17 @@ EXPORT_SYMBOL(of_find_i2c_device_by_node);
 struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
 {
struct device *dev;
+   struct i2c_adapter *adapter;
 
-   dev = bus_find_device(_bus_type, NULL, node,
-of_dev_node_match);
+   dev = bus_find_device(_bus_type, NULL, node, of_dev_node_match);
if (!dev)
return NULL;
 
-   return i2c_verify_adapter(dev);
+   adapter = i2c_verify_adapter(dev);
+   if (!adapter)
+   put_device(dev);
+
+   return adapter;
 }
 EXPORT_SYMBOL(of_find_i2c_adapter_by_node);
 #else
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 11/29] gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found

2016-02-05 Thread Saul Wold
From: Mika Westerberg <mika.westerb...@linux.intel.com>

If a driver requests a GPIO described in its _CRS but the GPIO host
controller (gpiochip) driver providing the GPIO has not been loaded yet
acpi_get_gpiod() returns -ENODEV which causes the calling driver to fail.

If the gpiochip driver is loaded afterwards the driver requesting the GPIO
will not notice this.

Better approach is to return -EPROBE_DEFER in such case. Then when the
gpiochip driver appears the driver requesting the GPIO will be probed
again. This also aligns ACPI GPIO lookup code closer to DT as it does
pretty much the same when no gpiochip driver was found.

Reported-by: Tobias Diedrich <tobiasdiedr...@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
Signed-off-by: Tobias Diedrich <ranma+ker...@tdiedrich.de>
Reviewed-by: Amos Kong <kongjian...@gmail.com>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Upstream-status: Backport
Signed-off-by: Saul Wold <s...@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 980a996..533fe5d 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -114,10 +114,11 @@ static inline int acpi_gpiochip_pin_to_gpio_offset(struct 
gpio_chip *chip,
  * @path:  ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1")
  * @pin:   ACPI GPIO pin number (0-based, controller-relative)
  *
- * Returns GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR
- * error value
+ * Return: GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR
+ * error value. Specifically returns %-EPROBE_DEFER if the referenced GPIO
+ * controller does not have gpiochip registered at the moment. This is to
+ * support probe deferral.
  */
-
 static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
 {
struct gpio_chip *chip;
@@ -131,7 +132,7 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
 
chip = gpiochip_find(handle, acpi_gpiochip_find);
if (!chip)
-   return ERR_PTR(-ENODEV);
+   return ERR_PTR(-EPROBE_DEFER);
 
offset = acpi_gpiochip_pin_to_gpio_offset(chip, pin);
if (offset < 0)
-- 
2.5.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


  1   2   3   4   5   >