Re: Bug in i2c-core?

2015-03-10 Thread Laurent Pinchart
Hi Wolfram, On Sunday 08 March 2015 09:26:17 Wolfram Sang wrote: > On Wed, Mar 04, 2015 at 09:22:37AM +0100, Wolfram Sang wrote: > I am writing an I2C touchscreen driver for an i.MX6 based board. I > compiled it as a module and when I unload it, I get the following > warning: >

Re: [PATCH v2 0/7] New Lenovos 2015 touchpads: party time!

2015-03-10 Thread Hans de Goede
Hi, On 10-03-15 07:17, Steven Noonan wrote: Hi Benjamin, I just got a ThinkPad X250 in today and have tried out your patches on 3.19.1. Before the patches, the top TrackPoint buttons weren't working at all, but the clickpad was working fine. For the most part, your patches fixed the TrackPoint.

[PATCH v6 01/22] compal-laptop: Fix leaking hwmon device

2015-03-10 Thread Krzysztof Kozlowski
The commit c2be45f09bb0 ("compal-laptop: Use devm_hwmon_device_register_with_groups") wanted to change the registering of hwmon device to resource-managed version. It mostly did it except the main thing - it forgot to use devm-like function so the hwmon device leaked after device removal or probe f

[PATCH v6 00/22] power_supply: Allow safe usage of power supply

2015-03-10 Thread Krzysztof Kozlowski
Hi, The patchset fixes invalid memory accesses in certain race scenarios by moving ownership of struct power_supply to the core. All drivers are modified. TLDR for driver and subsystem maintainers = Two patches of patchset change power_supply_register() f

[PATCH v6 15/22] power_supply: Increment power supply use counter when obtaining references

2015-03-10 Thread Krzysztof Kozlowski
Increment the power_supply.use_cnt usage counter on: - power_supply_get_by_phandle() - power_supply_get_by_name() and decrement it on power_supply_put() call. This helps tracking of valid usage of power supply instance by consumers. The usage counter itself also allows safe calling of power_supp

[PATCH v6 21/22] mfd: ab8500: Decrement the power supply's device reference counter

2015-03-10 Thread Krzysztof Kozlowski
Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Acked-by: Linus Walleij Acked-by: Lee Jones Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/mfd/ab8500-sysctrl.c | 2 +

[PATCH v6 19/22] power_supply: 88pm860x_charger: Decrement the power supply's device reference counter

2015-03-10 Thread Krzysztof Kozlowski
Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/88pm860x_charger.c | 11 +-- 1 file changed, 9 insertions(

[PATCH v6 18/22] x86/olpc/xo15/sci: Use newly added power_supply_put API

2015-03-10 Thread Krzysztof Kozlowski
Replace direct usage of put_device() with new API: power_supply_put(). Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- arch/x86/platform/olpc/olpc-xo15-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v6 20/22] power_supply: bq2415x_charger: Decrement the power supply's device reference counter

2015-03-10 Thread Krzysztof Kozlowski
Use power_supply_put() to decrement the power supply's device reference counter (increased by power_supply_get_by_name() or power_supply_get_by_phandle()). Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drive

[PATCH v6 12/22] power_supply: charger-manager: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: P

[PATCH v6 17/22] x86/olpc/xo1/sci: Use newly added power_supply_put API

2015-03-10 Thread Krzysztof Kozlowski
Replace direct usage of put_device() with new API: power_supply_put(). Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- arch/x86/platform/olpc/olpc-xo1-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletio

[PATCH v6 16/22] power_supply: charger-manager: Decrement the power supply's device reference counter

2015-03-10 Thread Krzysztof Kozlowski
Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/charger-manager.c | 70 +++--

[PATCH v6 22/22] arm: mach-pxa: Decrement the power supply's device reference counter

2015-03-10 Thread Krzysztof Kozlowski
Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel Acked-by: Robert Jarzmik Acked-by: Pavel Machek --- arch/arm/mach-pxa/raumfeld.c | 4 +++- 1 file changed,

[PATCH v6 06/22] power_supply: sysfs: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property - set_property -> power_supply_set_property - property_is_writeable -

[PATCH v6 09/22] mfd: ab8500: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: P

[PATCH v6 14/22] power_supply: Add power_supply_put for decrementing device reference counter

2015-03-10 Thread Krzysztof Kozlowski
The power_supply_get_by_phandle() and power_supply_get_by_name() use function class_find_device() for obtaining the reference to power supply. Each use of class_find_device() increases the power supply's device reference counter. However the reference counter was not decreased by users of this API

[PATCH v6 03/22] power_supply: Add driver private data

2015-03-10 Thread Krzysztof Kozlowski
Allow drivers to store private data inside power_supply structure for later usage in power supply operations. Usage of driver private data is necessary to access driver's state container object from power supply calls (like get_property()) if struct 'power_supply' is a stored there as a pointer, f

[PATCH v6 10/22] power_supply: apm_power: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: P

[PATCH v6 02/22] compal-laptop: Check return value of power_supply_register

2015-03-10 Thread Krzysztof Kozlowski
The return value of power_supply_register() call was not checked and even on error probe() function returned 0. If registering failed then during unbind the driver tried to unregister power supply which was not actually registered. This could lead to memory corruption because power_supply_unregist

[PATCH v6 07/22] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property - set_property -> power_supply_set_property Signed-off-by: Krzysztof

[PATCH v6 11/22] power_supply: bq2415x_charger: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: P

[PATCH v6 08/22] power_supply: ab8500: Use power_supply_*() API for accessing function attrs

2015-03-10 Thread Krzysztof Kozlowski
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: P

[PATCH v6 05/22] power_supply: Add API for safe access of power supply function attrs

2015-03-10 Thread Krzysztof Kozlowski
Add simple wrappers for accessing power supply's function attributes: - get_property -> power_supply_get_property - set_property -> power_supply_set_property - property_is_writeable -> power_supply_property_is_writeable - external_power_changed -> power_supply_external_power_changed This API a

[PATCH v6 04/22] power_supply: Move run-time configuration to separate structure

2015-03-10 Thread Krzysztof Kozlowski
Add new structure 'power_supply_config' for holding run-time initialization data like of_node, supplies and private driver data. The power_supply_register() function is changed so all power supply drivers need updating. When registering the power supply this new 'power_supply_config' should be us

RE: [RFC v2 2/7] media: rc: Add cec protocol handling

2015-03-10 Thread Kamil Debski
Hi Bastien, From: Bastien Nocera [mailto:had...@hadess.net] Sent: Monday, March 09, 2015 5:44 PM > > On Mon, 2015-03-09 at 17:22 +0100, Kamil Debski wrote: > > Hi Mauro, > > > > From: Mauro Carvalho Chehab [mailto:mche...@osg.samsung.com] > > Sent: Sunday, March 08, 2015 3:21 PM > > > > > Em Thu,

Re: [PATCH v2] HID: i2c-hid: Fix suspend/resume when already runtime suspended

2015-03-10 Thread Mika Westerberg
On Mon, Mar 09, 2015 at 12:44:47PM -0700, Doug Anderson wrote: > If the i2c-hid device was runtime suspended and then the system > suspended itself we'd end up disabling interrupts twice (in > i2c_hid_runtime_suspend and i2c_hid_suspend) and not reenabling them > until later when the i2c-hid device

Re: [PATCH v7 3/5] power: max77843_battery: Add Max77843 fuel gauge device driver

2015-03-10 Thread Beomho Seo
On 03/09/2015 07:01 PM, Krzysztof Kozlowski wrote: > 2015-03-09 1:36 GMT+01:00 Beomho Seo : >> On 03/08/2015 05:14 AM, Sebastian Reichel wrote: >>> Hi, >>> >>> On Mon, Mar 02, 2015 at 07:10:36PM +0900, Jaewon Kim wrote: From: Beomho Seo This patch adds device driver of max77843 fuel

Re: [PATCH v7 2/5] power: max77843_charger: Add Max77843 charger device driver

2015-03-10 Thread Beomho Seo
On 03/09/2015 09:13 PM, Krzysztof Kozlowski wrote: > On pon, 2015-03-09 at 20:46 +0900, Beomho Seo wrote: >> On 03/09/2015 08:02 PM, Krzysztof Kozlowski wrote: >>> 2015-03-09 1:35 GMT+01:00 Beomho Seo : On 03/08/2015 05:13 AM, Sebastian Reichel wrote: > On Mon, Mar 02, 2015 at 07:10:35PM +

Re: [PATCH v6 04/22] HID: Move run-time power supply configuration to separate structure (ACK needed)

2015-03-10 Thread Sebastian Reichel
Hi Jiri, On Tue, Mar 10, 2015 at 09:27:08AM +0100, Krzysztof Kozlowski wrote: > Add new structure 'power_supply_config' for holding run-time > initialization data like of_node, supplies and private driver data. > > The power_supply_register() function is changed so all power supply > drivers need

Re: [PATCH v6 13/22] HID: Change power supply ownership from driver to core

2015-03-10 Thread Sebastian Reichel
Hi Jiri, On Tue, Mar 10, 2015 at 09:27:17AM +0100, Krzysztof Kozlowski wrote: > Change the ownership of power_supply structure from each driver > implementing the class to the power supply core. > > The patch changes power_supply_register() function thus all drivers > implementing power supply cl

Re: [RFC v2 2/7] media: rc: Add cec protocol handling

2015-03-10 Thread Hans Verkuil
On 03/10/2015 01:02 PM, Kamil Debski wrote: > Hi Bastien, > > From: Bastien Nocera [mailto:had...@hadess.net] > Sent: Monday, March 09, 2015 5:44 PM >> >> On Mon, 2015-03-09 at 17:22 +0100, Kamil Debski wrote: >>> Hi Mauro, >>> >>> From: Mauro Carvalho Chehab [mailto:mche...@osg.samsung.com] >>> S

Re: [RFC v2 2/7] media: rc: Add cec protocol handling

2015-03-10 Thread Bastien Nocera
On Tue, 2015-03-10 at 13:02 +0100, Kamil Debski wrote: > Hi Bastien, > > From: Bastien Nocera [mailto:had...@hadess.net] > Sent: Monday, March 09, 2015 5:44 PM > > > > On Mon, 2015-03-09 at 17:22 +0100, Kamil Debski wrote: > > > Hi Mauro, > > > > > > From: Mauro Carvalho Chehab [mailto:mche...@o

RE: [RFC v2 2/7] media: rc: Add cec protocol handling

2015-03-10 Thread Kamil Debski
From: Bastien Nocera [mailto:had...@hadess.net] Sent: Tuesday, March 10, 2015 3:15 PM > > On Tue, 2015-03-10 at 13:02 +0100, Kamil Debski wrote: > > Hi Bastien, > > > > From: Bastien Nocera [mailto:had...@hadess.net] > > Sent: Monday, March 09, 2015 5:44 PM > > > > > > On Mon, 2015-03-09 at 17:22

Re: [PATCH v2] HID: i2c-hid: Fix suspend/resume when already runtime suspended

2015-03-10 Thread Doug Anderson
Mika, On Tue, Mar 10, 2015 at 5:23 AM, Mika Westerberg wrote: > On Mon, Mar 09, 2015 at 12:44:47PM -0700, Doug Anderson wrote: >> If the i2c-hid device was runtime suspended and then the system >> suspended itself we'd end up disabling interrupts twice (in >> i2c_hid_runtime_suspend and i2c_hid_s

Re: [PATCH v2 0/7] New Lenovos 2015 touchpads: party time!

2015-03-10 Thread Steven Noonan
On Tue, Mar 10, 2015 at 12:23 AM, Hans de Goede wrote: > Hi, > > On 10-03-15 07:17, Steven Noonan wrote: >> >> Hi Benjamin, >> >> I just got a ThinkPad X250 in today and have tried out your patches on >> 3.19.1. Before the patches, the top TrackPoint buttons weren't working >> at all, but the clic

[PATCH] Input : Optimize joydev_connect function

2015-03-10 Thread Anshul Garg
From: Anshul Garg In joydev_connect function added check for event type before setting properties for that event. This will avoid dummy loop iterations which checks for event code even if event type is not set. Signed-off-by: Anshul Garg --- drivers/input/joydev.c | 44 ++

[PATCH] Input: elants_i2c: Append hw_version to FW file

2015-03-10 Thread Charlie Mooney
Currently the elants_i2c driver simply requests a static filename /lib/firmware/elants_i2c.bin when it gets firmware updates. This is a problem if you have two Elan touchscreens using the same driver. If both touchscreens have different firmwares, you would need to move the files around in your fi

[PATCH v3 0/2] Add support for Broadcom iProc touchscreen

2015-03-10 Thread Jonathan Richardson
This patchset contains initial support for the touchscreen on the Broadcom iProc family of SoCs. This driver has been validated with Cygnus and is expected to work on other iProc family of SoCs that use the same touchscreen controller. Changes from v2: - Misc style changes. - Removed assumptions a

[PATCH v3 2/2] Input: touchscreen-iproc: add device tree bindings

2015-03-10 Thread Jonathan Richardson
Documents the touchscreen device tree binding for Broadcom iProc family of SoCs. Reviewed-by: Scott Branden Tested-by: Scott Branden Signed-off-by: Jonathan Richardson --- .../input/touchscreen/brcm,iproc-touchscreen.txt | 76 1 file changed, 76 insertions(+) create m

[PATCH v3 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

2015-03-10 Thread Jonathan Richardson
Add initial version of the Broadcom touchscreen driver. Reviewed-by: Ray Jui Reviewed-by: Scott Branden Tested-by: Scott Branden Signed-off-by: Jonathan Richardson --- drivers/input/touchscreen/Kconfig | 11 + drivers/input/touchscreen/Makefile|1 + drivers/input/touchsc

Re: [PATCH] Input: elants_i2c: Append hw_version to FW file

2015-03-10 Thread Dmitry Torokhov
Hi Charlie, On Tue, Mar 10, 2015 at 12:57:03PM -0700, Charlie Mooney wrote: > Currently the elants_i2c driver simply requests a static filename > /lib/firmware/elants_i2c.bin when it gets firmware updates. This is > a problem if you have two Elan touchscreens using the same driver. > If both touc

Re: [PATCH] Input : Optimize joydev_connect function

2015-03-10 Thread Dmitry Torokhov
Hi Anshul, On Tue, Mar 10, 2015 at 11:36:17AM -0700, Anshul Garg wrote: > From: Anshul Garg > > In joydev_connect function added check for event type before > setting properties for that event. This will avoid dummy > loop iterations which checks for event code even if event type > is not set.