Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-31 Thread Srinivas Pandruvada
On Wed, 2016-08-31 at 15:19 +0100, Grant Likely wrote:
> On Wed, Aug 24, 2016 at 10:23 PM, Jonathan Cameron 
> wrote:
> > 
> > On 24/08/16 22:14, Jiri Kosina wrote:
> > > 
> > > On Wed, 24 Aug 2016, Grant Likely wrote:
> > > 
> > > > 
> > > > > 
> > > > > > 
> > > > > > v2:
> > > > > > - Overview in documentation show analogy with usbhid
> > > > > > implementation
> > > > > > - sparse errors for statics. Also pointed by Jiri
> > > > > > - Clearly marking exported function header file. Clean up
> > > > > > all exports
> > > > > > unused inteface functions
> > > > > > - Changed to tristate from boolean as pointed by Jiri:
> > > > > > this required remove/unload functions
> > > > > > - Prevent crash when ISH enabled on non supported platform
> > > > > > - Break client.c to smaller part by seprating buffer
> > > > > > allocations
> > > > > > - move bus register/unregister to ishtp module
> > > > > > - There is only one config symbol INTEL_ISH_HID, removed
> > > > > > silent
> > > > > > config for TRANSPORT and IPC
> > > > > Tested-by: Grant Likely 
> > > > > 
> > > > > On an HP Spectre x360 laptop using v4.7-rc5.
> > > > Hey Srinivas. Any progress on this patch series?
> > > The HID part (with patch #5 omitted) should be in linux-next
> > > through
> > > hid.git already.
> > > 
> > The one IIO patch was pulled by Greg KH last night so hit linux
> > next
> > today.  Hence all on it's way by the sound of it!
> Nice!
> 
> Unfortunately, I've just hit a new bug after updating to v4.8-rc4.
> 4.7.0-rc6 works fine.
> 
> The kernel boots, and the driver loads, but the orientations are
> wrong. It appears that the X/Y is getting swapped:
> 
> Normal orientation: display rotated 90 degrees CW
> Rotated 90 degrees CW: display normal orientation
> Rotated 180 degrees (upside down): display rotated 90 degrees CCW
> Rotated 90 degrees CCW: display rotated 180 degrees
> 
This is  also observed in all non ISH platforms too. I bisected it to
some commit, which I don't know how this impacts. Yesterday I sent
email to the list. Try reverting this, you should be fine.

 commit 703b5faf22fbddf984a361e6555f3a03fdba63d9
> Author: George Spelvin 
> Date:   Fri Jun 10 00:22:12 2016 -0400
>
> fs/dcache.c: Save one 32-bit multiply in dcache lookup
>
> Noe that we're mixing in the parent pointer earlier, we
> don't need to use hash_32() to mix its bits.  Instead, we can
> just take the msbits of the hash value directly.
>
> For those applications which use the partial_name_hash(),
> move the multiply to end_name_hash.
>
> Signed-off-by: George Spelvin 
> Signed-off-by: Linus Torvalds 


Thanks,
Srinivas


> Cheers,
> g.


Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-31 Thread Grant Likely
On Wed, Aug 24, 2016 at 10:23 PM, Jonathan Cameron  wrote:
> On 24/08/16 22:14, Jiri Kosina wrote:
>> On Wed, 24 Aug 2016, Grant Likely wrote:
>>
> v2:
> - Overview in documentation show analogy with usbhid implementation
> - sparse errors for statics. Also pointed by Jiri
> - Clearly marking exported function header file. Clean up all exports
> unused inteface functions
> - Changed to tristate from boolean as pointed by Jiri:
> this required remove/unload functions
> - Prevent crash when ISH enabled on non supported platform
> - Break client.c to smaller part by seprating buffer allocations
> - move bus register/unregister to ishtp module
> - There is only one config symbol INTEL_ISH_HID, removed silent
> config for TRANSPORT and IPC

 Tested-by: Grant Likely 

 On an HP Spectre x360 laptop using v4.7-rc5.
>>>
>>> Hey Srinivas. Any progress on this patch series?
>>
>> The HID part (with patch #5 omitted) should be in linux-next through
>> hid.git already.
>>
> The one IIO patch was pulled by Greg KH last night so hit linux next
> today.  Hence all on it's way by the sound of it!

Nice!

Unfortunately, I've just hit a new bug after updating to v4.8-rc4.
4.7.0-rc6 works fine.

The kernel boots, and the driver loads, but the orientations are
wrong. It appears that the X/Y is getting swapped:

Normal orientation: display rotated 90 degrees CW
Rotated 90 degrees CW: display normal orientation
Rotated 180 degrees (upside down): display rotated 90 degrees CCW
Rotated 90 degrees CCW: display rotated 180 degrees

Cheers,
g.


Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-24 Thread Jonathan Cameron
On 24/08/16 22:14, Jiri Kosina wrote:
> On Wed, 24 Aug 2016, Grant Likely wrote:
> 
 v2:
 - Overview in documentation show analogy with usbhid implementation
 - sparse errors for statics. Also pointed by Jiri
 - Clearly marking exported function header file. Clean up all exports
 unused inteface functions
 - Changed to tristate from boolean as pointed by Jiri:
 this required remove/unload functions
 - Prevent crash when ISH enabled on non supported platform
 - Break client.c to smaller part by seprating buffer allocations
 - move bus register/unregister to ishtp module
 - There is only one config symbol INTEL_ISH_HID, removed silent
 config for TRANSPORT and IPC
>>>
>>> Tested-by: Grant Likely 
>>>
>>> On an HP Spectre x360 laptop using v4.7-rc5.
>>
>> Hey Srinivas. Any progress on this patch series?
> 
> The HID part (with patch #5 omitted) should be in linux-next through 
> hid.git already.
> 
The one IIO patch was pulled by Greg KH last night so hit linux next
today.  Hence all on it's way by the sound of it!

Jonathan


Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-24 Thread Jiri Kosina
On Wed, 24 Aug 2016, Grant Likely wrote:

> >> v2:
> >> - Overview in documentation show analogy with usbhid implementation
> >> - sparse errors for statics. Also pointed by Jiri
> >> - Clearly marking exported function header file. Clean up all exports
> >> unused inteface functions
> >> - Changed to tristate from boolean as pointed by Jiri:
> >> this required remove/unload functions
> >> - Prevent crash when ISH enabled on non supported platform
> >> - Break client.c to smaller part by seprating buffer allocations
> >> - move bus register/unregister to ishtp module
> >> - There is only one config symbol INTEL_ISH_HID, removed silent
> >> config for TRANSPORT and IPC
> >
> > Tested-by: Grant Likely 
> >
> > On an HP Spectre x360 laptop using v4.7-rc5.
> 
> Hey Srinivas. Any progress on this patch series?

The HID part (with patch #5 omitted) should be in linux-next through 
hid.git already.

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-24 Thread Srinivas Pandruvada
On Wed, 2016-08-24 at 12:16 -0400, Grant Likely wrote:
> On Tue, Jul 5, 2016 at 8:42 AM, Grant Likely 
> wrote:
> > 
> > 
> > On 22/06/16 06:40, Srinivas Pandruvada wrote:
> > > 
> > > 
> > > Change log
> > > v2:
> > > - Overview in documentation show analogy with usbhid
> > > implementation
> > > - sparse errors for statics. Also pointed by Jiri
> > > - Clearly marking exported function header file. Clean up all
> > > exports
> > > unused inteface functions
> > > - Changed to tristate from boolean as pointed by Jiri:
> > > this required remove/unload functions
> > > - Prevent crash when ISH enabled on non supported platform
> > > - Break client.c to smaller part by seprating buffer allocations
> > > - move bus register/unregister to ishtp module
> > > - There is only one config symbol INTEL_ISH_HID, removed silent
> > > config for TRANSPORT and IPC
> > 
> > Tested-by: Grant Likely 
> > 
> > On an HP Spectre x360 laptop using v4.7-rc5.
> 
> Hey Srinivas. Any progress on this patch series?
Unless someone has major objection, they can land up in 4.9.
They will go through two different trees, I can ping you once I see all
patches in linux-next.

Thanks,
Srinivas


> 
> g.


Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-08-24 Thread Grant Likely
On Tue, Jul 5, 2016 at 8:42 AM, Grant Likely  wrote:
>
> On 22/06/16 06:40, Srinivas Pandruvada wrote:
>>
>> Change log
>> v2:
>> - Overview in documentation show analogy with usbhid implementation
>> - sparse errors for statics. Also pointed by Jiri
>> - Clearly marking exported function header file. Clean up all exports
>> unused inteface functions
>> - Changed to tristate from boolean as pointed by Jiri:
>> this required remove/unload functions
>> - Prevent crash when ISH enabled on non supported platform
>> - Break client.c to smaller part by seprating buffer allocations
>> - move bus register/unregister to ishtp module
>> - There is only one config symbol INTEL_ISH_HID, removed silent
>> config for TRANSPORT and IPC
>
> Tested-by: Grant Likely 
>
> On an HP Spectre x360 laptop using v4.7-rc5.

Hey Srinivas. Any progress on this patch series?

g.


Re: [PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-07-05 Thread Grant Likely


On 22/06/16 06:40, Srinivas Pandruvada wrote:

Change log
v2:
- Overview in documentation show analogy with usbhid implementation
- sparse errors for statics. Also pointed by Jiri
- Clearly marking exported function header file. Clean up all exports
unused inteface functions
- Changed to tristate from boolean as pointed by Jiri:
this required remove/unload functions
- Prevent crash when ISH enabled on non supported platform
- Break client.c to smaller part by seprating buffer allocations
- move bus register/unregister to ishtp module
- There is only one config symbol INTEL_ISH_HID, removed silent
config for TRANSPORT and IPC

Tested-by: Grant Likely 

On an HP Spectre x360 laptop using v4.7-rc5.

In related news, the problem I had with the rotation events not showing 
up on v1 of this series went away. I don't have a reason why, it just 
suddenly started working.


g.



Starting from Cherrytrail, multiple generation of Intel processors offers
on package sensor hub. Several recent tablets, 2-in-1 convertible laptops
are using ISH instead of external sensor hubs. This resulted in lack of
support of sensor function like device rotation and auto backlight
adjustment.
In addition, depending on the OEM implementation, support of ISH is required
to support low power sleep states.

The support of ISH on Linux platforms is not new. Android platforms with
Intel SoCs had this support for a while submitted by Daniel Drubin.
This patcheset is reusing most of those changes with  clean up and
removing Android platform specific changes.

The user mode ABI is still same as external sensor hubs using Linux
IIO. So existing user mode software should still work.
This series primarily brings in new HID transport used in ISH.

Thanks to the community members who tested RFC patches and provided
feedback.

For users testing on Linux distributions using IIO sensor proxy,
a short term work around is required till we have debugged this issue.
In systemd unit file iio-sensor-proxy.service
In the section "[Unit]" add
After=multi-user.target

Daniel Drubin (3):
   hid: intel_ish-hid: ISH Transport layer
   hid: intel-ish-hid: ipc layer
   hid: intel-ish-hid: ISH HID client driver

Srinivas Pandruvada (3):
   Documentation: hid: Intel ISH HID document
   iio: hid-sensors: use asynchronous resume
   hid: hid-sensor-hub: Add ISH quirk

  Documentation/hid/intel-ish-hid.txt| 449 ++
  drivers/hid/Kconfig|   2 +
  drivers/hid/Makefile   |   2 +
  drivers/hid/hid-sensor-hub.c   |   4 +
  drivers/hid/intel-ish-hid/Kconfig  |  17 +
  drivers/hid/intel-ish-hid/Makefile |  22 +
  drivers/hid/intel-ish-hid/ipc/hw-ish-regs.h| 220 +
  drivers/hid/intel-ish-hid/ipc/hw-ish.h |  71 ++
  drivers/hid/intel-ish-hid/ipc/ipc.c| 719 
  drivers/hid/intel-ish-hid/ipc/pci-ish.c| 327 +++
  drivers/hid/intel-ish-hid/ipc/utils.h  |  64 ++
  drivers/hid/intel-ish-hid/ishtp-hid-client.c   | 935 +
  drivers/hid/intel-ish-hid/ishtp-hid.c  | 234 ++
  drivers/hid/intel-ish-hid/ishtp-hid.h  | 182 
  drivers/hid/intel-ish-hid/ishtp/bus.c  | 780 +
  drivers/hid/intel-ish-hid/ishtp/bus.h  | 110 +++
  drivers/hid/intel-ish-hid/ishtp/client-buffers.c   | 214 +
  drivers/hid/intel-ish-hid/ishtp/client.c   | 935 +
  drivers/hid/intel-ish-hid/ishtp/client.h   | 182 
  drivers/hid/intel-ish-hid/ishtp/dma-if.c   | 178 
  drivers/hid/intel-ish-hid/ishtp/hbm.c  | 908 
  drivers/hid/intel-ish-hid/ishtp/hbm.h  | 321 +++
  drivers/hid/intel-ish-hid/ishtp/init.c |  93 ++
  drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h| 277 ++
  .../iio/common/hid-sensors/hid-sensor-trigger.c|  21 +-
  include/linux/hid-sensor-hub.h |   1 +
  include/trace/events/intel_ish.h   |  30 +
  include/uapi/linux/input.h |   1 +
  28 files changed, 7298 insertions(+), 1 deletion(-)
  create mode 100644 Documentation/hid/intel-ish-hid.txt
  create mode 100644 drivers/hid/intel-ish-hid/Kconfig
  create mode 100644 drivers/hid/intel-ish-hid/Makefile
  create mode 100644 drivers/hid/intel-ish-hid/ipc/hw-ish-regs.h
  create mode 100644 drivers/hid/intel-ish-hid/ipc/hw-ish.h
  create mode 100644 drivers/hid/intel-ish-hid/ipc/ipc.c
  create mode 100644 drivers/hid/intel-ish-hid/ipc/pci-ish.c
  create mode 100644 drivers/hid/intel-ish-hid/ipc/utils.h
  create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid-client.c
  create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid.c
  create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid.h
  create mode 100644 drivers/hid/intel-ish-hid/ishtp/bus.c
  create mode 100644 drivers/hid

[PATCH v2 0/6] Intel Integrated Sensor Hub Support (ISH)

2016-06-21 Thread Srinivas Pandruvada
Change log
v2:
- Overview in documentation show analogy with usbhid implementation
- sparse errors for statics. Also pointed by Jiri
- Clearly marking exported function header file. Clean up all exports
unused inteface functions
- Changed to tristate from boolean as pointed by Jiri:
this required remove/unload functions
- Prevent crash when ISH enabled on non supported platform
- Break client.c to smaller part by seprating buffer allocations
- move bus register/unregister to ishtp module
- There is only one config symbol INTEL_ISH_HID, removed silent
config for TRANSPORT and IPC


Starting from Cherrytrail, multiple generation of Intel processors offers
on package sensor hub. Several recent tablets, 2-in-1 convertible laptops
are using ISH instead of external sensor hubs. This resulted in lack of
support of sensor function like device rotation and auto backlight
adjustment.
In addition, depending on the OEM implementation, support of ISH is required
to support low power sleep states.

The support of ISH on Linux platforms is not new. Android platforms with
Intel SoCs had this support for a while submitted by Daniel Drubin. 
This patcheset is reusing most of those changes with  clean up and
removing Android platform specific changes.

The user mode ABI is still same as external sensor hubs using Linux
IIO. So existing user mode software should still work.
This series primarily brings in new HID transport used in ISH.

Thanks to the community members who tested RFC patches and provided
feedback.

For users testing on Linux distributions using IIO sensor proxy,
a short term work around is required till we have debugged this issue.
In systemd unit file iio-sensor-proxy.service
In the section "[Unit]" add
After=multi-user.target

Daniel Drubin (3):
  hid: intel_ish-hid: ISH Transport layer
  hid: intel-ish-hid: ipc layer
  hid: intel-ish-hid: ISH HID client driver

Srinivas Pandruvada (3):
  Documentation: hid: Intel ISH HID document
  iio: hid-sensors: use asynchronous resume
  hid: hid-sensor-hub: Add ISH quirk

 Documentation/hid/intel-ish-hid.txt| 449 ++
 drivers/hid/Kconfig|   2 +
 drivers/hid/Makefile   |   2 +
 drivers/hid/hid-sensor-hub.c   |   4 +
 drivers/hid/intel-ish-hid/Kconfig  |  17 +
 drivers/hid/intel-ish-hid/Makefile |  22 +
 drivers/hid/intel-ish-hid/ipc/hw-ish-regs.h| 220 +
 drivers/hid/intel-ish-hid/ipc/hw-ish.h |  71 ++
 drivers/hid/intel-ish-hid/ipc/ipc.c| 719 
 drivers/hid/intel-ish-hid/ipc/pci-ish.c| 327 +++
 drivers/hid/intel-ish-hid/ipc/utils.h  |  64 ++
 drivers/hid/intel-ish-hid/ishtp-hid-client.c   | 935 +
 drivers/hid/intel-ish-hid/ishtp-hid.c  | 234 ++
 drivers/hid/intel-ish-hid/ishtp-hid.h  | 182 
 drivers/hid/intel-ish-hid/ishtp/bus.c  | 780 +
 drivers/hid/intel-ish-hid/ishtp/bus.h  | 110 +++
 drivers/hid/intel-ish-hid/ishtp/client-buffers.c   | 214 +
 drivers/hid/intel-ish-hid/ishtp/client.c   | 935 +
 drivers/hid/intel-ish-hid/ishtp/client.h   | 182 
 drivers/hid/intel-ish-hid/ishtp/dma-if.c   | 178 
 drivers/hid/intel-ish-hid/ishtp/hbm.c  | 908 
 drivers/hid/intel-ish-hid/ishtp/hbm.h  | 321 +++
 drivers/hid/intel-ish-hid/ishtp/init.c |  93 ++
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h| 277 ++
 .../iio/common/hid-sensors/hid-sensor-trigger.c|  21 +-
 include/linux/hid-sensor-hub.h |   1 +
 include/trace/events/intel_ish.h   |  30 +
 include/uapi/linux/input.h |   1 +
 28 files changed, 7298 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/hid/intel-ish-hid.txt
 create mode 100644 drivers/hid/intel-ish-hid/Kconfig
 create mode 100644 drivers/hid/intel-ish-hid/Makefile
 create mode 100644 drivers/hid/intel-ish-hid/ipc/hw-ish-regs.h
 create mode 100644 drivers/hid/intel-ish-hid/ipc/hw-ish.h
 create mode 100644 drivers/hid/intel-ish-hid/ipc/ipc.c
 create mode 100644 drivers/hid/intel-ish-hid/ipc/pci-ish.c
 create mode 100644 drivers/hid/intel-ish-hid/ipc/utils.h
 create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid-client.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp-hid.h
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/bus.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/bus.h
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/client-buffers.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/client.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/client.h
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/dma-if.c
 create mode 100644 drivers/hid/intel-ish-hid/ishtp/hbm.c
 create