Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH RESEND 4/5] Input: uinput - add new UINPUT_DEV_SETUP ioctl
From: Dmitry Torokhov @ 2014-07-21 20:11 UTC (permalink / raw)
  To: David Herrmann; +Cc: open list:HID CORE LAYER, Peter Hutterer
In-Reply-To: <CANq1E4S0=h=PccuHVAFPMgdMvGWyBLitpaeJAkZ--PmuTT0xxg@mail.gmail.com>

On Mon, Jul 21, 2014 at 08:22:09AM +0200, David Herrmann wrote:
> Hi
> 
> On Mon, Jul 21, 2014 at 3:01 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > Hi David,
> >
> > On Sat, Jul 19, 2014 at 03:10:44PM +0200, David Herrmann wrote:
> >> This adds a new ioctl UINPUT_DEV_SETUP that replaces the old device setup
> >> method (by write()'ing "struct uinput_user_dev" to the node). The old
> >> method is not easily extendable and requires huge payloads. Furthermore,
> >> overloading write() without properly versioned objects is error-prone.
> >>
> >> Therefore, we introduce a new ioctl to replace the old method. The ioctl
> >> supports all features of the old method, plus a "resolution" field for
> >> absinfo. Furthermore, it's properly forward-compatible to new ABS codes
> >> and a growing "struct input_absinfo" structure.
> >>
> >> The ioctl also allows user-space to skip unknown axes if not set. The
> >> payload-size can now be specified by the caller. There is no need to copy
> >> the whole array temporarily into the kernel, but instead we can iterate
> >> over it and copy each value manually.
> >>
> >> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
> >> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> >> ---
> >>  drivers/input/misc/uinput.c | 69 +++++++++++++++++++++++++++++++++++++++++++--
> >>  include/uapi/linux/uinput.h | 55 ++++++++++++++++++++++++++++++++++--
> >>  2 files changed, 118 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
> >> index a2a3895..0f45595 100644
> >> --- a/drivers/input/misc/uinput.c
> >> +++ b/drivers/input/misc/uinput.c
> >> @@ -371,8 +371,67 @@ static int uinput_allocate_device(struct uinput_device *udev)
> >>       return 0;
> >>  }
> >>
> >> -static int uinput_setup_device(struct uinput_device *udev,
> >> -                            const char __user *buffer, size_t count)
> >> +static int uinput_dev_setup(struct uinput_device *udev,
> >> +                         struct uinput_setup __user *arg)
> >> +{
> >> +     struct uinput_setup setup;
> >> +     struct input_dev *dev;
> >> +     int i, retval;
> >> +
> >> +     if (udev->state == UIST_CREATED)
> >> +             return -EINVAL;
> >> +     if (copy_from_user(&setup, arg, sizeof(setup)))
> >> +             return -EFAULT;
> >> +     if (!setup.name[0])
> >> +             return -EINVAL;
> >> +     /* So far we only support the original "struct input_absinfo", but be
> >> +      * forward compatible and allow larger payloads. */
> >> +     if (setup.absinfo_size < sizeof(struct input_absinfo))
> >> +             return -EINVAL;
> >
> > No, we can not do this, as it breaks backward compatibility (the most
> > important one!). If we were to increase size of in-kernel input_absinfo
> > in let's say 3.20, userspace compiled against older kernel headers
> > (but using the new ioctl available let's say since 3.16 - don't hold me
> > to the numbers ;) ), would break since it wold start tripping on thi
> > check.
> >
> > The proper way to handle it is to convert "old" absinfo into new one,
> > applying as much as we can.
> 
> I know, but there is no "old absinfo". Once we extend "struct absinfo"
> I expect this code to change to:
> 
> {
>         /* initially supported absinfo had size 24 */
>         if (setup.absinfo_size < 24)
>                return -EINVAL;
> 
>         /* ...pseudo code... */
>         memset(&absinfo, 0, sizeof(absinfo));
>         memcpy(&absinfo, sth->absinfo, MIN(setup.absinfo_size,
> sizeof(absinfo)));
> }
> 
> This allows you to use this ioctl with old absinfo objects. I can
> change the current code to this already, if you want? I tried to avoid
> it, because a memset() is not neccessarily an appropriate way to
> initialize unset fields.
> I cal also add support for "absinfo" without the "resolution" field,
> which I think is the only field that wasn't available in the initial
> structure.

I think for now I would do:

	/*
	 * Whoever is changing struct input_absinfo will have to take
	 * care of backwards compatibility.
	 */
	BUILD_BUG_ON(sizeof(struct input_absinfo)) != 24);
	if (setup.absinfo_size != sizeof(struct input_absinfo))
		return -EINVAL;

	...

and later when we detect setup.absinfo_size < sizeof(struct
input_absinfo) we'll have to take care about backwards compatibility. We
do not need to take care of forward compatibility as we do not know if
userspace will be satisfied with partial results or not and newer
userspace can deal with proper handling of older kernels.

By the way, I realize I do not like the new IOCTL as it is - it's too
big and would be hard to extend if we want to change items other than
absinfo. Why don't we create UI_DEV_SETUP that only sets name, id, and
number of effects, and add UI_SET_ABSAXIS that would take:

	struct uinput_abs_setup {
		__u16	code;	/* axis code */
		/* __u16 filler; */
		struct input_absinfo absinfo;
	}

By the way, while you are hacking on uinput can we also fix formatting
style of switch/case and switch printk() to pr_debug() and friends? I'd
do it myself but do not want to step on your toes.

Thanks!

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH RESEND 4/5] Input: uinput - add new UINPUT_DEV_SETUP ioctl
From: David Herrmann @ 2014-07-21 21:08 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: open list:HID CORE LAYER, Peter Hutterer
In-Reply-To: <20140721201155.GA10889@core.coreip.homeip.net>

Hi

On Mon, Jul 21, 2014 at 10:11 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Mon, Jul 21, 2014 at 08:22:09AM +0200, David Herrmann wrote:
>> I know, but there is no "old absinfo". Once we extend "struct absinfo"
>> I expect this code to change to:
>>
>> {
>>         /* initially supported absinfo had size 24 */
>>         if (setup.absinfo_size < 24)
>>                return -EINVAL;
>>
>>         /* ...pseudo code... */
>>         memset(&absinfo, 0, sizeof(absinfo));
>>         memcpy(&absinfo, sth->absinfo, MIN(setup.absinfo_size,
>> sizeof(absinfo)));
>> }
>>
>> This allows you to use this ioctl with old absinfo objects. I can
>> change the current code to this already, if you want? I tried to avoid
>> it, because a memset() is not neccessarily an appropriate way to
>> initialize unset fields.
>> I cal also add support for "absinfo" without the "resolution" field,
>> which I think is the only field that wasn't available in the initial
>> structure.
>
> I think for now I would do:
>
>         /*
>          * Whoever is changing struct input_absinfo will have to take
>          * care of backwards compatibility.
>          */
>         BUILD_BUG_ON(sizeof(struct input_absinfo)) != 24);
>         if (setup.absinfo_size != sizeof(struct input_absinfo))
>                 return -EINVAL;
>
>         ...
>
> and later when we detect setup.absinfo_size < sizeof(struct
> input_absinfo) we'll have to take care about backwards compatibility. We
> do not need to take care of forward compatibility as we do not know if
> userspace will be satisfied with partial results or not and newer
> userspace can deal with proper handling of older kernels.

I'm not sure I agree. I'm a fan of forward-compatibility, but that's
probably a matter of taste. I will change my code accordingly.

> By the way, I realize I do not like the new IOCTL as it is - it's too
> big and would be hard to extend if we want to change items other than
> absinfo. Why don't we create UI_DEV_SETUP that only sets name, id, and
> number of effects, and add UI_SET_ABSAXIS that would take:
>
>         struct uinput_abs_setup {
>                 __u16   code;   /* axis code */
>                 /* __u16 filler; */
>                 struct input_absinfo absinfo;
>         }

Hm, that is actually a good idea. I will give it a try.

> By the way, while you are hacking on uinput can we also fix formatting
> style of switch/case and switch printk() to pr_debug() and friends? I'd
> do it myself but do not want to step on your toes.

Yepp, I will include those in the next revision.

Thanks
David

^ permalink raw reply

* Re: Power-managing devices that are not of interest at some point in time
From: hadess @ 2014-07-21 23:23 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rafael J. Wysocki, Alan Stern, Patrik Fimml, linux-pm,
	Benson Leung, linux-input, linux-kernel
In-Reply-To: <1451627.FURGiR949u@dtor-glaptop>

On 2014-07-19 01:16, Dmitry Torokhov wrote:
<snip>
> I'd say no.
> 
> Anyway, even though it is very tempting to declare inhibit a "deeper" 
> state of
> runtime suspend maybe you are right and inhibit should really be 
> separate from
> PM and drivers would have to sort out all the possible state 
> permutations.
> 
> Considering input devices:
> 
> input_open(): check if device is inhibited, if so do nothing. Otherwise 
> try
> waking up itself and parent (via pm_runtime_get_sync() on itself), this 
> will
> power up the device. Do additional configuration if needed.
> 
> input_close(): check if device is inhibited, if not do pm_runtime_put 
> (_sync?
> to make sure we power off properly and not leave device up and running? 
> or
> should we power down manually not waiting for runtime PM)?
> 
> inhibit(): check if device is opened, if opened do 
> pm_runtime_put_sync().
> 
> uninhibit(): if device is opened do pm_runtime_get_sync(), let runtime 
> PM
> bring up the device. Do additional config if needed -> very similar to
> input_open(), different condition.
> 
> runtime_suspend(): power down the device. If not inhibited enable as 
> wakeup
> source.
> 
> runtime_resume(): power up the device if device is opened and not 
> inhibited.
> 
> system_suspend(): check if device is opened, not inhibited and not in
> runtimesuspend  already; power down.
> 
> system_resume(): power up the device if it is opened and not inhibited. 
> I
> guess it's OK to wake up device that shoudl be runtime-PM-idle since it 
> will
> go to back sleep shortly.
> 
> Ugh.. This is complicated...

Seriously complicated. The compositor and/or X.org can handle most of 
that for
input devices already. For the camera, you want the application to know 
that
the device is present, but not usable, instead of making it vanish or 
rendering
it unusable. And if you wanted to implement this in the kernel, even 
with the aid
of a user-space daemon, you're still missing the most important part, 
the device
tagging.

Once you've tagged the devices which would need to be left alone when 
the lid is
closed, or the laptop is in tablet mode, see if the problem can be 
solved within
user-space alone. I'm fairly certain it wouldn't take too long to fix 
Xorg
or a state-of-the-art compositor to behave properly.

All I see right now is making it harder to write devices drivers with no 
real benefits.

Cheers

^ permalink raw reply

* Re: [Problem] Samsung 700T1C Elan USB Touchpad not detected as touchpad
From: Daniel Heckenberg @ 2014-07-21 23:28 UTC (permalink / raw)
  To: linux-input
In-Reply-To: <CA+uZGHqqaRSUYLHJotMnZ9+b6o2+H=vS_CGKrdAhpZ6-+Spd7g@mail.gmail.com>

Hi all,

Could anyone offer any advice on how I can further diagnose / fix this
issue?  Or is there another mailing list which would be more
appropriate?

Many thanks,
Daniel

^ permalink raw reply

* [PATCH] Input: document INPUT_PROP_TOPBUTTONPAD
From: Peter Hutterer @ 2014-07-22  0:00 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, Hans de Goede

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 Documentation/input/event-codes.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt
index f82ba9c..7ff7bf4 100644
--- a/Documentation/input/event-codes.txt
+++ b/Documentation/input/event-codes.txt
@@ -281,6 +281,19 @@ gestures can normally be extracted from it.
 If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT
 device.
 
+INPUT_PROP_TOPBUTTONPAD:
+-----------------------
+Some laptops, most notably the Lenovo *40 series provide a trackstick
+device but do not have physical buttons associated with the trackstick
+device. Instead, the top area of the touchpad is marked to show
+visual/haptic areas for left, middle, right buttons intended to be used
+with the trackstick.
+
+If INPUT_PROP_TOPBUTTONPAD is set, userspace should emulate buttons
+accordingly. This property does not affect kernel behavior.
+The kernel does not provide button emulation for such devices but treats
+them as any other INPUT_PROP_BUTTONPAD device.
+
 Guidelines:
 ==========
 The guidelines below ensure proper single-touch and multi-finger functionality.
-- 
1.9.3


^ permalink raw reply related

* Re: [PATCH v2] input: Add support for Wacom protocol 4 serial tablets
From: Peter Hutterer @ 2014-07-22  0:02 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Dmitry Torokhov, Julian Squires, linux-input
In-Reply-To: <1405867583-3321-1-git-send-email-hdegoede@redhat.com>

On Sun, Jul 20, 2014 at 04:46:23PM +0200, Hans de Goede wrote:
> Recent version of xf86-input-wacom no longer support directly accessing
> serial tablets. Instead xf86-input-wacom now expects all wacom tablets to
> be driven by the kernel and to show up as evdev devices.

just for the archives: xf86-input-wacom still has ISDV4 serial handling code
in it, we just use inputattach in most setups now. Most contemporary serial
devices such that exist still work directly if needed. But yes, the protocol
4 support was dropped in 2009, so we're talking about devices >5 years old.

Cheers,
   Peter

> 
> This has caused old serial Wacom tablets to stop working for people who still
> have such tablets. Julian Squires has written a serio input driver to fix this:
> https://github.com/tokenrove/wacom-serial-iv
> 
> This is a cleaned up version of this driver with improved Graphire support
> (I own an old Graphire myself).
> 
> Signed-off-by: Julian Squires <julian@cipht.net>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 

^ permalink raw reply

* Re: [PATCH] Input: document INPUT_PROP_TOPBUTTONPAD
From: Dmitry Torokhov @ 2014-07-22  0:58 UTC (permalink / raw)
  To: Peter Hutterer; +Cc: linux-input, Hans de Goede
In-Reply-To: <20140722000018.GA10920@jelly.redhat.com>

On Tue, Jul 22, 2014 at 10:00:18AM +1000, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Applied, thank you.

> ---
>  Documentation/input/event-codes.txt | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt
> index f82ba9c..7ff7bf4 100644
> --- a/Documentation/input/event-codes.txt
> +++ b/Documentation/input/event-codes.txt
> @@ -281,6 +281,19 @@ gestures can normally be extracted from it.
>  If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT
>  device.
>  
> +INPUT_PROP_TOPBUTTONPAD:
> +-----------------------
> +Some laptops, most notably the Lenovo *40 series provide a trackstick
> +device but do not have physical buttons associated with the trackstick
> +device. Instead, the top area of the touchpad is marked to show
> +visual/haptic areas for left, middle, right buttons intended to be used
> +with the trackstick.
> +
> +If INPUT_PROP_TOPBUTTONPAD is set, userspace should emulate buttons
> +accordingly. This property does not affect kernel behavior.
> +The kernel does not provide button emulation for such devices but treats
> +them as any other INPUT_PROP_BUTTONPAD device.
> +
>  Guidelines:
>  ==========
>  The guidelines below ensure proper single-touch and multi-finger functionality.
> -- 
> 1.9.3
> 

^ permalink raw reply

* Re: [RFC] edt-ft5x06 - cannot see IRQ Qfrom device after DT probe
From: Markus Niebel @ 2014-07-22 10:40 UTC (permalink / raw)
  To: Simon Budig, linux-input
In-Reply-To: <53C64D86.1010808@kernelconcepts.de>

Am 16.07.2014 12:01, wrote Simon Budig:
> On 15/07/14 19:43, Markus Niebel wrote:
>> - when adding an int-gpios node to devicetree and parsing this gpio the gpio will be configured as input
>> - IRQ can be seen by CPU
>>
>> Question:
>>
>> - shall we add an int-gpio property to enable gpio pin config as input or
> 
> Shouldn't it be possible to configure the pin as input directly from the
> device tree, indepently from the touch driver section?

I don't see, how to do that, maybe I did miss the right point.

I digged through the gpio code. There are drivers (gpio-omap) that make sure, that gpio is configured as
input and others that don't care (gpio-mxc / gpio-mxs).

seeing this I posted "gpio: gpio-mxc: make sure gpio is input when request IRQ" on linux-arm-kernel

Global question is: how can we make sure, that the driver that request the IRQ requests also the GPIO (implicit or like in the old platfrom data days explicit)? But thats beyond input devices and my knowledge. 

Regards

Markus

> 
> Bye,
>         Simon
> 


^ permalink raw reply

* Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'
From: Arnd Bergmann @ 2014-07-22 10:32 UTC (permalink / raw)
  To: Chen Gang
  Cc: Lennox Wu, Richard Weinberger, Lars-Peter Clausen, Guenter Roeck,
	Greg Kroah-Hartman, Dmitry Torokhov, linux-iio,
	Benjamin Herrenschmidt, Tom Gundersen, Thierry Reding,
	Marek Vasut, Liqin Chen, msalter, linux-pwm, devel,
	linux-watchdog, linux-input, linux-kernel@vger.kernel.org,
	knaack.h, Martin Schwidefsky, jic23, Geert Uytterhoeven, cmetcalf,
	heiko.carstens
In-Reply-To: <53CB8FC4.4050009@gmail.com>

On Sunday 20 July 2014 17:45:40 Chen Gang wrote:
> > 
> > Next, I shall:
> > 
> >  - Remove HAS_IOMEM and NO_IOMEM from kernel, firstly.
> > 
> >  - Try to make dummy IOMEM functions for score architecture.
> > 
> >  - Continue discussing with UML for it.
> >
>  
> Oh, sorry, I forgot, after remove IOMEM from kernel, also s390 and tile
> need implement dummy IOMEM if !PCI.
> 
> If possible, I shall try to implement the dummy IOMEM in 'asm-generic',
> and let uml, score, s390 and tile use them when they need.

Sorry for going round in circles, but looking back at the original patches,
adding the extra 'depends on HAS_IOMEM' does seem much better than the
other suggestions that came afterwards.

In particular, removing HAS_IOMEM and NO_IOMEM sounds like an awful idea
to me. I'd rather add a HAS_IOPORT in addition to also catch architectures
that have no support for PC-style PIO.

	Arnd

^ permalink raw reply

* Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'
From: Chen Gang @ 2014-07-22 11:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-iio, Benjamin Herrenschmidt, heiko.carstens, Tom Gundersen,
	Thierry Reding, Lennox Wu, Marek Vasut, Liqin Chen,
	Lars-Peter Clausen, Richard Weinberger, Geert Uytterhoeven,
	msalter, Guenter Roeck, linux-pwm, devel, linux-watchdog,
	linux-input, cmetcalf, Greg Kroah-Hartman, Dmitry Torokhov,
	linux-kernel@vger.kernel.org, knaack.h, Martin Schwidefsky, jic23
In-Reply-To: <179292068.QXZf3Zcqzf@wuerfel>



On 07/22/2014 06:32 PM, Arnd Bergmann wrote:
> On Sunday 20 July 2014 17:45:40 Chen Gang wrote:
>>>
>>> Next, I shall:
>>>
>>>  - Remove HAS_IOMEM and NO_IOMEM from kernel, firstly.
>>>
>>>  - Try to make dummy IOMEM functions for score architecture.
>>>
>>>  - Continue discussing with UML for it.
>>>
>>  
>> Oh, sorry, I forgot, after remove IOMEM from kernel, also s390 and tile
>> need implement dummy IOMEM if !PCI.
>>
>> If possible, I shall try to implement the dummy IOMEM in 'asm-generic',
>> and let uml, score, s390 and tile use them when they need.
> 
> Sorry for going round in circles, but looking back at the original patches,
> adding the extra 'depends on HAS_IOMEM' does seem much better than the
> other suggestions that came afterwards.
> 
> In particular, removing HAS_IOMEM and NO_IOMEM sounds like an awful idea
> to me. I'd rather add a HAS_IOPORT in addition to also catch architectures
> that have no support for PC-style PIO.
> 

Welcome any other members (especially driver members) ideas and
suggestions -- driver members and architecture members have different
tastes and different roles.

For me, if no additional reply, I prefer to keep current status, and
still add 'depends on HAS_IOMEM' for each driver which need it, but I am
not sure whether driver members can bear it.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

^ permalink raw reply

* [PATCH v2] iio: exynos-adc: add experimental touchscreen support
From: Arnd Bergmann @ 2014-07-22 13:03 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8,
	t.figa-Sze3O3UU22JBDgjK7y7TUQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chanwoo Choi,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Jonathan Cameron,
	Ben Dooks, galak-sgV2jX0FEOL9JmXXK+q4OQ,
	ch.naveen-Sze3O3UU22JBDgjK7y7TUQ, linux-input,
	heiko.stuebner-K3U4GQvHnyU, Dmitry Torokhov

This adds support for the touchscreen on Samsung s3c64xx.
The driver is completely untested but shows roughly how
it could be done, following the example of the at91 driver.

Open questions include:

- compared to the old plat-samsung/adc driver, there is
  no support for prioritizing ts over other clients, nor
  for oversampling. From my reading of the code, the
  priorities didn't actually have any effect at all, but
  the oversampling might be needed. Maybe the original
  authors have some insight.

- We probably need to add support for platform_data as well,
  I've skipped this so far.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
This should address all previous comments, and I've also added
a write to ADC_V1_DLY() as the old driver does.

diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
index cad81b666a67..ba30836c73cb 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
@@ -43,6 +43,10 @@ Required properties:
 				       and compatible ADC block)
 - vdd-supply		VDD input supply.
 
+Optional properties:
+- has-touchscreen:	If present, indicates that a touchscreen is
+			connected an usable.
+
 Note: child nodes can be added for auto probing from device tree.
 
 Example: adding device info in dtsi file
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 420c5cda09c3..3b684a117b9c 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -34,6 +34,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/of_platform.h>
 #include <linux/err.h>
+#include <linux/input.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/machine.h>
@@ -66,6 +67,9 @@
 
 #define ADC_S3C2410_CON_SELMUX(x) (((x)&0x7)<<3)
 
+/* touch screen always uses channel 0 */
+#define ADC_S3C2410_MUX_TS	0
+
 /* ADCTSC Register Bits */
 #define ADC_S3C2443_TSC_UD_SEN		(1u << 8)
 #define ADC_S3C2410_TSC_YM_SEN		(1u << 7)
@@ -103,24 +107,32 @@
 
 /* Bit definitions common for ADC_V1 and ADC_V2 */
 #define ADC_CON_EN_START	(1u << 0)
+#define ADC_DATX_PRESSED	(1u << 15)
 #define ADC_DATX_MASK		0xFFF
+#define ADC_DATY_MASK		0xFFF
 
 #define EXYNOS_ADC_TIMEOUT	(msecs_to_jiffies(100))
 
 struct exynos_adc {
 	struct exynos_adc_data	*data;
 	struct device		*dev;
+	struct input_dev	*input;
 	void __iomem		*regs;
 	void __iomem		*enable_reg;
 	struct clk		*clk;
 	struct clk		*sclk;
 	unsigned int		irq;
+	unsigned int		tsirq;
 	struct regulator	*vdd;
 
 	struct completion	completion;
 
 	u32			value;
 	unsigned int            version;
+
+	bool			read_ts;
+	u32			ts_x;
+	u32			ts_y;
 };
 
 struct exynos_adc_data {
@@ -205,6 +217,9 @@ static void exynos_adc_v1_init_hw(struct exynos_adc *info)
 	/* Enable 12-bit ADC resolution */
 	con1 |= ADC_V1_CON_RES;
 	writel(con1, ADC_V1_CON(info->regs));
+
+	/* set default touchscreen delay */
+	writel(10000, ADC_V1_DLY(info->regs));
 }
 
 static void exynos_adc_v1_exit_hw(struct exynos_adc *info)
@@ -390,12 +405,54 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
 	return ret;
 }
 
+static int exynos_read_s3c64xx_ts(struct iio_dev *indio_dev, int *x, int *y)
+{
+	struct exynos_adc *info = iio_priv(indio_dev);
+	unsigned long timeout;
+	int ret;
+
+	mutex_lock(&indio_dev->mlock);
+	info->read_ts = true;
+
+	reinit_completion(&info->completion);
+
+	writel(ADC_S3C2410_TSC_PULL_UP_DISABLE | ADC_TSC_AUTOPST,
+	       ADC_V1_TSC(info->regs));
+
+	/* Select the ts channel to be used and Trigger conversion */
+	info->data->start_conv(info, ADC_S3C2410_MUX_TS);
+
+	timeout = wait_for_completion_timeout
+			(&info->completion, EXYNOS_ADC_TIMEOUT);
+	if (timeout == 0) {
+		dev_warn(&indio_dev->dev, "Conversion timed out! Resetting\n");
+		if (info->data->init_hw)
+			info->data->init_hw(info);
+		ret = -ETIMEDOUT;
+	} else {
+		*x = info->ts_x;
+		*y = info->ts_y;
+		ret = 0;
+	}
+
+	info->read_ts = false;
+	mutex_unlock(&indio_dev->mlock);
+
+	return ret;
+}
+
 static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
 {
 	struct exynos_adc *info = (struct exynos_adc *)dev_id;
 
 	/* Read value */
-	info->value = readl(ADC_V1_DATX(info->regs)) & ADC_DATX_MASK;
+	if (info->read_ts) {
+		info->ts_x = readl(ADC_V1_DATX(info->regs));
+		info->ts_y = readl(ADC_V1_DATY(info->regs));
+		writel(ADC_TSC_WAIT4INT | ADC_S3C2443_TSC_UD_SEN, ADC_V1_TSC(info->regs));
+	} else {
+		info->value = readl(ADC_V1_DATX(info->regs)) & ADC_DATX_MASK;
+	}
 
 	/* clear irq */
 	if (info->data->clear_irq)
@@ -406,6 +463,46 @@ static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+/*
+ * Here we (ab)use a threaded interrupt handler to stay running
+ * for as long as the touchscreen remains pressed, we report
+ * a new event with the latest data and then sleep until the
+ * next timer tick. This mirrors the behavior of the old
+ * driver, with much less code.
+ */
+static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
+{
+	struct exynos_adc *info = dev_id;
+	struct iio_dev *dev = dev_get_drvdata(info->dev);
+	u32 x, y;
+	bool pressed;
+	int ret;
+
+	while (info->input->users) {
+		ret = exynos_read_s3c64xx_ts(dev, &x, &y);
+		if (ret == -ETIMEDOUT)
+			break;
+
+		pressed = x & y & ADC_DATX_PRESSED;
+		if (!pressed) {
+			input_report_key(info->input, BTN_TOUCH, 0);
+			input_sync(info->input);
+			break;
+		}
+
+		input_report_abs(info->input, ABS_X, x & ADC_DATX_MASK);
+		input_report_abs(info->input, ABS_Y, y & ADC_DATY_MASK);
+		input_report_key(info->input, BTN_TOUCH, 1);
+		input_sync(info->input);
+
+		msleep(1);
+	};
+
+	writel(0, ADC_V1_CLRINTPNDNUP(info->regs));
+
+	return IRQ_HANDLED;
+}
+
 static int exynos_adc_reg_access(struct iio_dev *indio_dev,
 			      unsigned reg, unsigned writeval,
 			      unsigned *readval)
@@ -457,12 +554,66 @@ static int exynos_adc_remove_devices(struct device *dev, void *c)
 	return 0;
 }
 
+static int exynos_adc_ts_open(struct input_dev *dev)
+{
+	struct exynos_adc *info = input_get_drvdata(dev);
+
+	enable_irq(info->tsirq);
+
+	return 0;
+}
+
+static void exynos_adc_ts_close(struct input_dev *dev)
+{
+	struct exynos_adc *info = input_get_drvdata(dev);
+
+	disable_irq(info->tsirq);
+}
+
+static int exynos_adc_ts_init(struct exynos_adc *info)
+{
+	int ret;
+
+	if (info->tsirq <= 0)
+		return -ENODEV;
+
+	info->input = input_allocate_device();
+	if (!info->input)
+		return -ENOMEM;
+
+	info->input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+	info->input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+
+	input_set_abs_params(info->input, ABS_X, 0, 0x3FF, 0, 0);
+	input_set_abs_params(info->input, ABS_Y, 0, 0x3FF, 0, 0);
+
+	info->input->name = "S3C24xx TouchScreen";
+	info->input->id.bustype = BUS_HOST;
+	info->input->open = exynos_adc_ts_open;
+	info->input->close = exynos_adc_ts_close;
+	
+	input_set_drvdata(info->input, info);
+
+	ret = input_register_device(info->input);
+	if (ret)
+		input_free_device(info->input);
+
+	disable_irq(info->tsirq);
+	ret = request_threaded_irq(info->tsirq, NULL, exynos_ts_isr,
+				   0, "touchscreen", info);
+	if (ret)
+		input_unregister_device(info->input);
+
+	return ret;
+}
+
 static int exynos_adc_probe(struct platform_device *pdev)
 {
 	struct exynos_adc *info = NULL;
 	struct device_node *np = pdev->dev.of_node;
 	struct iio_dev *indio_dev = NULL;
 	struct resource	*mem;
+	bool has_ts = false;
 	int ret = -ENODEV;
 	int irq;
 
@@ -498,8 +649,14 @@ static int exynos_adc_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "no irq resource?\n");
 		return irq;
 	}
-
 	info->irq = irq;
+
+	irq = platform_get_irq(pdev, 1);
+	if (irq == -EPROBE_DEFER)
+		return irq; 
+
+	info->tsirq = irq;
+
 	info->dev = &pdev->dev;
 
 	init_completion(&info->completion);
@@ -565,6 +722,15 @@ static int exynos_adc_probe(struct platform_device *pdev)
 	if (info->data->init_hw)
 		info->data->init_hw(info);
 
+	/* leave out any TS related code if unreachable */
+	if (IS_BUILTIN(CONFIG_INPUT) ||
+	    (IS_MODULE(CONFIG_INPUT) && config_enabled(MODULE)))
+		has_ts = of_property_read_bool(pdev->dev.of_node, "has-touchscreen");
+	if (has_ts)
+		ret = exynos_adc_ts_init(info);
+	if (ret)
+		goto err_iio;
+
 	ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed adding child nodes\n");
@@ -576,6 +742,11 @@ static int exynos_adc_probe(struct platform_device *pdev)
 err_of_populate:
 	device_for_each_child(&indio_dev->dev, NULL,
 				exynos_adc_remove_devices);
+	if (has_ts) {
+		input_unregister_device(info->input);
+		free_irq(info->tsirq, info);
+	}
+err_iio:
 	iio_device_unregister(indio_dev);
 err_irq:
 	free_irq(info->irq, info);
@@ -595,6 +766,11 @@ static int exynos_adc_remove(struct platform_device *pdev)
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
 	struct exynos_adc *info = iio_priv(indio_dev);
 
+	if (IS_BUILTIN(CONFIG_INPUT) ||
+	    (IS_MODULE(CONFIG_INPUT) && config_enabled(MODULE))) {
+		free_irq(info->tsirq, info);
+		input_unregister_device(info->input);
+	}
 	device_for_each_child(&indio_dev->dev, NULL,
 				exynos_adc_remove_devices);
 	iio_device_unregister(indio_dev);

^ permalink raw reply related

* Re: [RFC] edt-ft5x06 - cannot see IRQ Qfrom device after DT probe
From: Simon Budig @ 2014-07-22 13:47 UTC (permalink / raw)
  To: Markus Niebel, linux-input
In-Reply-To: <53CE3F84.5030301@tqsc.de>

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

On 22/07/14 12:40, Markus Niebel wrote:
> Am 16.07.2014 12:01, wrote Simon Budig:
>> On 15/07/14 19:43, Markus Niebel wrote:
>>> - when adding an int-gpios node to devicetree and parsing this 
>>> gpio the gpio will be configured as input - IRQ can be seen by 
>>> CPU
>>> 
>>> Question:
>>> 
>>> - shall we add an int-gpio property to enable gpio pin config as 
>>> input or
>> 
>> Shouldn't it be possible to configure the pin as input directly 
>> from the device tree, indepently from the touch driver section?
> 
> I don't see, how to do that, maybe I did miss the right point.

Try looking at

Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

There you have the "input-enable" generic property.

> Global question is: how can we make sure, that the driver that 
> request the IRQ requests also the GPIO (implicit or like in the old 
> platfrom data days explicit)? But thats beyond input devices and my 
> knowledge.

The driver does not depend on the IRQ coming from a "real" CPU gpio. It
*could* be an external gpio expander or whatever (whether that is a good
idea is debatable of course). When I submitted the first version of the
driver it had bits in it to configure the pin properly. The feedback
basically was to remove that, because it made some assumptions that you
can map the IRQ to the relevant GPIO, which is not always possible.

I hope that helps.

(But really, your bootloader really should have a *very* good reason to
configure the touch irq pin as output - I have the impression that right
now there are two outputs driving against each other in your setup - not
healthy for the hardware).

Bye,
        Simon

-- 
       Simon Budig                        kernel concepts GmbH
       simon.budig@kernelconcepts.de      Sieghuetter Hauptweg 48
       +49-271-771091-17                  D-57072 Siegen


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCH 0/5] Input - wacom: battery enhancements and unifying hid-wacom and wacom
From: Benjamin Tissoires @ 2014-07-22 13:49 UTC (permalink / raw)
  To: Przemo Firszt
  Cc: Dmitry Torokhov, Jiri Kosina, Ping Cheng, Jason Gerecke,
	linux-kernel, linux-input
In-Reply-To: <1405804548.13990.7.camel@fedora-lan>

Hi Przemo,

On Jul 19 2014 or thereabouts, Przemo Firszt wrote:
> Dnia 2014-07-10, czw o godzinie 14:44 -0400, Benjamin Tissoires pisze:
> > Hi guys,
> > 
> > Continuing on the Wacom cleanup, here are 5 patches.
> > 
> > The first two enhance the battery reporting for the Wireless receiver by
> > adding the status of the battery (discharging, full, charging) - inspired by
> > the code found in hid-wacom.c, and also by adding notifications to the power
> > system so that upower knows when the battery changed.
> > 
> > The last three are the handling of the two Wacom Bluetooth devices in wacom.ko.
> > Some enhancements here:
> > - Intuos4 now supports other tools than just the plain stylus (mouse, artpen, ...)
> > - one less driver for Wacom (~700 lines of code less in total)
> > - unifying access to LEDs/OLEDs from Bluetooth and USB devices
> > 
> > However, I did not backport the speed attribute and the ac power device (which
> > is infered by the battery status). I don't know if there are users of those two,
> > so I let them aside for now. Przemo, any ideas if this is actually used?
> > 
> > This whole code is based on top of the previous HID conversion patches.
> > I pushed a branch with all I have queued on the list here:
> > https://github.com/bentiss/linux/commits/hid-wacom-legacy-3.16-rc4
> > 
> > Again, given that there has been no answer on how this can be merged upstream
> > (Jiri? Dmitry?), I just piled those on top of the previous.
> > I wouldn't to resplit the input and hid specific changes if this is the choice
> > that is made.
> > 
> > Cheers,
> > Benjamin
> > 
> > Benjamin Tissoires (5):
> >   Input - wacom: enhance Wireless Receiver battery reporting
> >   Input - wacom: use a specific name for the battery device
> >   Input - wacom: handle Graphire BT tablets in wacom.ko
> >   Input - wacom: handle Intuos 4 BT in wacom.ko
> >   HID: remove hid-wacom Bluetooth driver
> > 
> >  drivers/hid/Kconfig              |   8 -
> >  drivers/hid/Makefile             |   1 -
> >  drivers/hid/hid-core.c           |   2 -
> >  drivers/hid/hid-wacom.c          | 973 ---------------------------------------
> >  drivers/input/tablet/wacom.h     |   6 +
> >  drivers/input/tablet/wacom_sys.c | 114 ++++-
> >  drivers/input/tablet/wacom_wac.c | 189 +++++++-
> >  drivers/input/tablet/wacom_wac.h |   8 +
> >  8 files changed, 303 insertions(+), 998 deletions(-)
> >  delete mode 100644 drivers/hid/hid-wacom.c
> > 
> Benjamin,
> I think we might try to fix that [1] as well when making changes to the
> sysfs entries. Currently every tablet connected wirelessly will trigger
> creating new sysfs entries:
> 
> /sys/class/power_supply/wacom_ac
> /sys/class/power_supply/wacom_battery
> 
> so sysfs is not happy about attempts to create duplicates. We need to
> distinguish between devices using consecutive numbers or something else.
> 
> [1] https://sourceforge.net/p/linuxwacom/bugs/248/

Right. In this first attempt, I tried to change "wacom_" by the actual
name of the tablet. I would thought it was OK because no one will ever
try to plug the same model twice. I was wrong, and a counter seem to be
the solution for that. I'll address that in the v2.

Also note that the bug is both in the current USB driver (wacom.ko) and
the bluetooth one (hid-wacom.ko). Merging these two drivers will prevent
us to have to do this fix twice :)

Just as a head up, I will not be able to work on this patch series
before Thursday (I mean testing with actual hardware). I'd be happy if
we can manage to push that in 3.17, but this will mostly depend if
Dmitry is fine with the USB-to-HID conversion of the wacom.ko driver.

Cheers,
Benjamin

^ permalink raw reply

* Re: [PATCH v2] iio: exynos-adc: add experimental touchscreen support
From: Varka Bhadram @ 2014-07-22 14:29 UTC (permalink / raw)
  To: Arnd Bergmann, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8,
	t.figa-Sze3O3UU22JBDgjK7y7TUQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chanwoo Choi,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Jonathan Cameron,
	Ben Dooks, galak-sgV2jX0FEOL9JmXXK+q4OQ,
	ch.naveen-Sze3O3UU22JBDgjK7y7TUQ, linux-input,
	heiko.stuebner-K3U4GQvHnyU, Dmitry Torokhov
In-Reply-To: <5068889.1KfVx3ksNo@wuerfel>


On Tuesday 22 July 2014 06:33 PM, Arnd Bergmann wrote:

(...)

>   
> +static int exynos_read_s3c64xx_ts(struct iio_dev *indio_dev, int *x, int *y)
> +{
> +	struct exynos_adc *info = iio_priv(indio_dev);
> +	unsigned long timeout;
> +	int ret;
> +
> +	mutex_lock(&indio_dev->mlock);
> +	info->read_ts = true;
> +
> +	reinit_completion(&info->completion);
> +
> +	writel(ADC_S3C2410_TSC_PULL_UP_DISABLE | ADC_TSC_AUTOPST,
> +	       ADC_V1_TSC(info->regs));
> +
> +	/* Select the ts channel to be used and Trigger conversion */
> +	info->data->start_conv(info, ADC_S3C2410_MUX_TS);
> +
> +	timeout = wait_for_completion_timeout
> +			(&info->completion, EXYNOS_ADC_TIMEOUT);

Should be properly aligned:

	wait_for_completion_timeout(&info->completion,
				    EXYNOS_ADC_TIMEOUT);

-- 
Regards,
Varka Bhadram

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Linus Walleij @ 2014-07-22 15:08 UTC (permalink / raw)
  To: abdoulaye berthe, arm@kernel.org, Ralf Baechle,
	Benjamin Herrenschmidt, Rafał Miłecki, Jiri Kosina,
	Dmitry Torokhov, Bryan Wu, Mauro Carvalho Chehab, Lee Jones,
	Samuel Ortiz, Matthew Garrett, Michael Buesch, Greg KH,
	Tomi Valkeinen, Mark Brown, Liam Girdwood
  Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips,
	linux-sh@vger.kernel.org, Linux Input,
	linux-media@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org
In-Reply-To: <1405197014-25225-4-git-send-email-berthe.ab@gmail.com>

On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:

Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
applied. We're getting rid of the return value from gpiochip_remove().

> this remove all reference to gpio_remove retval in all driver
> except pinctrl and gpio. the same thing is done for gpio and
> pinctrl in two different patches.
>
> Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
(...)

I think this patch probably needs to be broken down per-subsystem as it
hits all over the map. But let's start requesting ACKs for the
individual pieces.
Actually I think it will be OK to merge because there is likely not much churn
around these code sites.

I'm a bit torn between just wanting a big patch for this hitting drivers/gpio
and smaller patches hitting one subsystem at a time. We should be able
to hammer this in one switch strike.

>  arch/arm/common/scoop.c                        | 10 ++--------

ARM SoC folks, can you ACK this?

>  arch/mips/txx9/generic/setup.c                 |  4 ++--

Ralf can you ACK this?

>  arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |  3 ++-

Benji, can you ACK this?

>  arch/sh/boards/mach-x3proto/gpio.c             |  6 ++----

Aha noone can ACK this, whatever...

>  drivers/bcma/driver_gpio.c                     |  3 ++-

Rafał can you ACK this?

>  drivers/hid/hid-cp2112.c                       |  6 ++----

Jiri can you ACK this?

>  drivers/input/keyboard/adp5588-keys.c          |  4 +---
>  drivers/input/keyboard/adp5589-keys.c          |  4 +---
>  drivers/input/touchscreen/ad7879.c             | 10 +++-------

Dmitry can you ACK this?

>  drivers/leds/leds-pca9532.c                    | 10 ++--------
>  drivers/leds/leds-tca6507.c                    |  7 ++-----

Bryan can you ACK this?

>  drivers/media/dvb-frontends/cxd2820r_core.c    | 10 +++-------

Mauro can you ACK this?

(Hm that looks weird. Mental note to look closer at this.)

>  drivers/mfd/asic3.c                            |  3 ++-
>  drivers/mfd/htc-i2cpld.c                       |  8 +-------
>  drivers/mfd/sm501.c                            | 17 +++--------------
>  drivers/mfd/tc6393xb.c                         | 13 ++++---------
>  drivers/mfd/ucb1x00-core.c                     |  8 ++------

Lee/Sam can either of you ACK this?

>  drivers/pinctrl/pinctrl-abx500.c               | 15 +++------------
>  drivers/pinctrl/pinctrl-exynos5440.c           |  6 +-----
>  drivers/pinctrl/pinctrl-msm.c                  | 10 +++-------
>  drivers/pinctrl/pinctrl-nomadik.c              |  2 +-
>  drivers/pinctrl/pinctrl-samsung.c              | 14 ++++----------

Abdoulaye: these should be in the other patch for pinctrl.

>  drivers/platform/x86/intel_pmic_gpio.c         |  3 +--

Matthew can you ACK this?

>  drivers/ssb/driver_gpio.c                      |  3 ++-

Michael can you (A) ACK this and
(B) think of moving this driver to drivers/gpio... Patches welcome.

>  drivers/staging/vme/devices/vme_pio2_gpio.c    |  4 +---
>  drivers/tty/serial/max310x.c                   | 10 ++++------

Greg can you ACK this?

>  drivers/video/fbdev/via/via-gpio.c             | 10 +++-------

Tomi can you ACK this?

>  sound/soc/codecs/wm5100.c                      |  5 +----
>  sound/soc/codecs/wm8903.c                      |  6 +-----
>  sound/soc/codecs/wm8962.c                      |  5 +----
>  sound/soc/codecs/wm8996.c                      |  6 +-----

Liam || Mark can you ACK this?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Mark Brown @ 2014-07-22 15:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mips, linux-fbdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Lee Jones, Matthew Garrett,
	Samuel Ortiz, Rafał Miłecki, Tomi Valkeinen,
	linux-serial@vger.kernel.org, Linux Input, abdoulaye berthe,
	Alexandre Courbot, Bryan Wu, arm@kernel.org,
	linux-gpio@vger.kernel.org, Michael Buesch
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 314 bytes --]

On Tue, Jul 22, 2014 at 05:08:13PM +0200, Linus Walleij wrote:

> Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
> applied. We're getting rid of the return value from gpiochip_remove().

Can someone send the patch please?  Splitting it up per-subsystem would
probably be easier...

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Michael Büsch @ 2014-07-22 15:17 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mips, linux-fbdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Lee Jones, Matthew Garrett,
	Samuel Ortiz, Rafał Miłecki, Tomi Valkeinen,
	linux-serial@vger.kernel.org, Linux Input, abdoulaye berthe,
	Alexandre Courbot, Bryan Wu, arm@kernel.org,
	linux-gpio@vger.kernel.org, Mark Brown
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 496 bytes --]

On Tue, 22 Jul 2014 17:08:13 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> >  drivers/ssb/driver_gpio.c                      |  3 ++-
> 
> Michael can you (A) ACK this and

Acked-by: Michael Büsch <m@bues.ch>

> (B) think of moving this driver to drivers/gpio... Patches welcome.

This is not that easy, as it is not a driver on its own, but integral part of ssb.
I don't think it's a good idea to move it out.

I'll accept well tested patches, though.

-- 
Michael

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Lee Jones @ 2014-07-22 16:01 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mips, linux-fbdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Matthew Garrett, Samuel Ortiz,
	Rafał Miłecki, Tomi Valkeinen,
	linux-serial@vger.kernel.org, Linux Input, abdoulaye berthe,
	Alexandre Courbot, Bryan Wu, arm@kernel.org,
	linux-gpio@vger.kernel.org, Mark Brown, Michael Buesch
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>

On Tue, 22 Jul 2014, Linus Walleij wrote:

> On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:
> 
> Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
> applied. We're getting rid of the return value from gpiochip_remove().
> 
> > this remove all reference to gpio_remove retval in all driver
> > except pinctrl and gpio. the same thing is done for gpio and
> > pinctrl in two different patches.
> >
> > Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
> (...)
> 
> I think this patch probably needs to be broken down per-subsystem as it
> hits all over the map. But let's start requesting ACKs for the
> individual pieces.
> Actually I think it will be OK to merge because there is likely not much churn
> around these code sites.
> 
> I'm a bit torn between just wanting a big patch for this hitting drivers/gpio
> and smaller patches hitting one subsystem at a time. We should be able
> to hammer this in one switch strike.

It would be better if you could devise a plan to make the switch a
subsystem at a time.

[...]

> >  drivers/mfd/asic3.c                            |  3 ++-
> >  drivers/mfd/htc-i2cpld.c                       |  8 +-------
> >  drivers/mfd/sm501.c                            | 17 +++--------------
> >  drivers/mfd/tc6393xb.c                         | 13 ++++---------
> >  drivers/mfd/ucb1x00-core.c                     |  8 ++------
> 
> Lee/Sam can either of you ACK this?

I don't see any code?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Dmitry Torokhov @ 2014-07-22 17:51 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mips, linux-fbdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Lee Jones, Matthew Garrett,
	Samuel Ortiz, Rafał Miłecki, Tomi Valkeinen,
	linux-serial@vger.kernel.org, Linux Input, abdoulaye berthe,
	Alexandre Courbot, Bryan Wu, arm@kernel.org,
	linux-gpio@vger.kernel.org, Mark Brown
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>

On Tue, Jul 22, 2014 at 05:08:13PM +0200, Linus Walleij wrote:
> On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:
> 
> Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
> applied. We're getting rid of the return value from gpiochip_remove().
> 
> > this remove all reference to gpio_remove retval in all driver
> > except pinctrl and gpio. the same thing is done for gpio and
> > pinctrl in two different patches.
> >
> > Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
> (...)
> 
> I think this patch probably needs to be broken down per-subsystem as it
> hits all over the map. But let's start requesting ACKs for the
> individual pieces.
> Actually I think it will be OK to merge because there is likely not much churn
> around these code sites.
> 
> I'm a bit torn between just wanting a big patch for this hitting drivers/gpio
> and smaller patches hitting one subsystem at a time. We should be able
> to hammer this in one switch strike.

...

> 
> >  drivers/input/keyboard/adp5588-keys.c          |  4 +---
> >  drivers/input/keyboard/adp5589-keys.c          |  4 +---
> >  drivers/input/touchscreen/ad7879.c             | 10 +++-------
> 
> Dmitry can you ACK this?

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH v2] iio: exynos-adc: add experimental touchscreen support
From: Dmitry Torokhov @ 2014-07-22 18:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-iio, kgene.kim, pawel.moll, t.figa,
	linux-kernel, Chanwoo Choi, kyungmin.park, linux-samsung-soc,
	Jonathan Cameron, Ben Dooks, galak, ch.naveen, linux-input,
	heiko.stuebner
In-Reply-To: <5068889.1KfVx3ksNo@wuerfel>

On Tue, Jul 22, 2014 at 03:03:12PM +0200, Arnd Bergmann wrote:
> This adds support for the touchscreen on Samsung s3c64xx.
> The driver is completely untested but shows roughly how
> it could be done, following the example of the at91 driver.
> 
> Open questions include:
> 
> - compared to the old plat-samsung/adc driver, there is
>   no support for prioritizing ts over other clients, nor
>   for oversampling. From my reading of the code, the
>   priorities didn't actually have any effect at all, but
>   the oversampling might be needed. Maybe the original
>   authors have some insight.
> 
> - We probably need to add support for platform_data as well,
>   I've skipped this so far.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> This should address all previous comments, and I've also added
> a write to ADC_V1_DLY() as the old driver does.
> 
> diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> index cad81b666a67..ba30836c73cb 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
> @@ -43,6 +43,10 @@ Required properties:
>  				       and compatible ADC block)
>  - vdd-supply		VDD input supply.
>  
> +Optional properties:
> +- has-touchscreen:	If present, indicates that a touchscreen is
> +			connected an usable.
> +
>  Note: child nodes can be added for auto probing from device tree.
>  
>  Example: adding device info in dtsi file
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index 420c5cda09c3..3b684a117b9c 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -34,6 +34,7 @@
>  #include <linux/regulator/consumer.h>
>  #include <linux/of_platform.h>
>  #include <linux/err.h>
> +#include <linux/input.h>
>  
>  #include <linux/iio/iio.h>
>  #include <linux/iio/machine.h>
> @@ -66,6 +67,9 @@
>  
>  #define ADC_S3C2410_CON_SELMUX(x) (((x)&0x7)<<3)
>  
> +/* touch screen always uses channel 0 */
> +#define ADC_S3C2410_MUX_TS	0
> +
>  /* ADCTSC Register Bits */
>  #define ADC_S3C2443_TSC_UD_SEN		(1u << 8)
>  #define ADC_S3C2410_TSC_YM_SEN		(1u << 7)
> @@ -103,24 +107,32 @@
>  
>  /* Bit definitions common for ADC_V1 and ADC_V2 */
>  #define ADC_CON_EN_START	(1u << 0)
> +#define ADC_DATX_PRESSED	(1u << 15)
>  #define ADC_DATX_MASK		0xFFF
> +#define ADC_DATY_MASK		0xFFF
>  
>  #define EXYNOS_ADC_TIMEOUT	(msecs_to_jiffies(100))
>  
>  struct exynos_adc {
>  	struct exynos_adc_data	*data;
>  	struct device		*dev;
> +	struct input_dev	*input;
>  	void __iomem		*regs;
>  	void __iomem		*enable_reg;
>  	struct clk		*clk;
>  	struct clk		*sclk;
>  	unsigned int		irq;
> +	unsigned int		tsirq;
>  	struct regulator	*vdd;
>  
>  	struct completion	completion;
>  
>  	u32			value;
>  	unsigned int            version;
> +
> +	bool			read_ts;
> +	u32			ts_x;
> +	u32			ts_y;
>  };
>  
>  struct exynos_adc_data {
> @@ -205,6 +217,9 @@ static void exynos_adc_v1_init_hw(struct exynos_adc *info)
>  	/* Enable 12-bit ADC resolution */
>  	con1 |= ADC_V1_CON_RES;
>  	writel(con1, ADC_V1_CON(info->regs));
> +
> +	/* set default touchscreen delay */
> +	writel(10000, ADC_V1_DLY(info->regs));
>  }
>  
>  static void exynos_adc_v1_exit_hw(struct exynos_adc *info)
> @@ -390,12 +405,54 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
>  	return ret;
>  }
>  
> +static int exynos_read_s3c64xx_ts(struct iio_dev *indio_dev, int *x, int *y)
> +{
> +	struct exynos_adc *info = iio_priv(indio_dev);
> +	unsigned long timeout;
> +	int ret;
> +
> +	mutex_lock(&indio_dev->mlock);
> +	info->read_ts = true;
> +
> +	reinit_completion(&info->completion);
> +
> +	writel(ADC_S3C2410_TSC_PULL_UP_DISABLE | ADC_TSC_AUTOPST,
> +	       ADC_V1_TSC(info->regs));
> +
> +	/* Select the ts channel to be used and Trigger conversion */
> +	info->data->start_conv(info, ADC_S3C2410_MUX_TS);
> +
> +	timeout = wait_for_completion_timeout
> +			(&info->completion, EXYNOS_ADC_TIMEOUT);
> +	if (timeout == 0) {
> +		dev_warn(&indio_dev->dev, "Conversion timed out! Resetting\n");
> +		if (info->data->init_hw)
> +			info->data->init_hw(info);
> +		ret = -ETIMEDOUT;
> +	} else {
> +		*x = info->ts_x;
> +		*y = info->ts_y;
> +		ret = 0;
> +	}
> +
> +	info->read_ts = false;
> +	mutex_unlock(&indio_dev->mlock);
> +
> +	return ret;
> +}
> +
>  static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
>  {
>  	struct exynos_adc *info = (struct exynos_adc *)dev_id;
>  
>  	/* Read value */
> -	info->value = readl(ADC_V1_DATX(info->regs)) & ADC_DATX_MASK;
> +	if (info->read_ts) {
> +		info->ts_x = readl(ADC_V1_DATX(info->regs));
> +		info->ts_y = readl(ADC_V1_DATY(info->regs));
> +		writel(ADC_TSC_WAIT4INT | ADC_S3C2443_TSC_UD_SEN, ADC_V1_TSC(info->regs));
> +	} else {
> +		info->value = readl(ADC_V1_DATX(info->regs)) & ADC_DATX_MASK;
> +	}
>  
>  	/* clear irq */
>  	if (info->data->clear_irq)
> @@ -406,6 +463,46 @@ static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> +/*
> + * Here we (ab)use a threaded interrupt handler to stay running
> + * for as long as the touchscreen remains pressed, we report
> + * a new event with the latest data and then sleep until the
> + * next timer tick. This mirrors the behavior of the old
> + * driver, with much less code.
> + */
> +static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
> +{
> +	struct exynos_adc *info = dev_id;
> +	struct iio_dev *dev = dev_get_drvdata(info->dev);
> +	u32 x, y;
> +	bool pressed;
> +	int ret;
> +
> +	while (info->input->users) {
> +		ret = exynos_read_s3c64xx_ts(dev, &x, &y);
> +		if (ret == -ETIMEDOUT)
> +			break;
> +
> +		pressed = x & y & ADC_DATX_PRESSED;
> +		if (!pressed) {
> +			input_report_key(info->input, BTN_TOUCH, 0);
> +			input_sync(info->input);
> +			break;
> +		}
> +
> +		input_report_abs(info->input, ABS_X, x & ADC_DATX_MASK);
> +		input_report_abs(info->input, ABS_Y, y & ADC_DATY_MASK);
> +		input_report_key(info->input, BTN_TOUCH, 1);
> +		input_sync(info->input);
> +
> +		msleep(1);
> +	};
> +
> +	writel(0, ADC_V1_CLRINTPNDNUP(info->regs));
> +
> +	return IRQ_HANDLED;
> +}
> +
>  static int exynos_adc_reg_access(struct iio_dev *indio_dev,
>  			      unsigned reg, unsigned writeval,
>  			      unsigned *readval)
> @@ -457,12 +554,66 @@ static int exynos_adc_remove_devices(struct device *dev, void *c)
>  	return 0;
>  }
>  
> +static int exynos_adc_ts_open(struct input_dev *dev)
> +{
> +	struct exynos_adc *info = input_get_drvdata(dev);
> +
> +	enable_irq(info->tsirq);
> +
> +	return 0;
> +}
> +
> +static void exynos_adc_ts_close(struct input_dev *dev)
> +{
> +	struct exynos_adc *info = input_get_drvdata(dev);
> +
> +	disable_irq(info->tsirq);
> +}
> +
> +static int exynos_adc_ts_init(struct exynos_adc *info)
> +{
> +	int ret;
> +
> +	if (info->tsirq <= 0)
> +		return -ENODEV;
> +
> +	info->input = input_allocate_device();
> +	if (!info->input)
> +		return -ENOMEM;
> +
> +	info->input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
> +	info->input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
> +
> +	input_set_abs_params(info->input, ABS_X, 0, 0x3FF, 0, 0);
> +	input_set_abs_params(info->input, ABS_Y, 0, 0x3FF, 0, 0);
> +
> +	info->input->name = "S3C24xx TouchScreen";
> +	info->input->id.bustype = BUS_HOST;
> +	info->input->open = exynos_adc_ts_open;
> +	info->input->close = exynos_adc_ts_close;
> +	
> +	input_set_drvdata(info->input, info);
> +
> +	ret = input_register_device(info->input);
> +	if (ret)
> +		input_free_device(info->input);
> +
> +	disable_irq(info->tsirq);
> +	ret = request_threaded_irq(info->tsirq, NULL, exynos_ts_isr,
> +				   0, "touchscreen", info);
> +	if (ret)
> +		input_unregister_device(info->input);
> +
> +	return ret;
> +}
> +
>  static int exynos_adc_probe(struct platform_device *pdev)
>  {
>  	struct exynos_adc *info = NULL;
>  	struct device_node *np = pdev->dev.of_node;
>  	struct iio_dev *indio_dev = NULL;
>  	struct resource	*mem;
> +	bool has_ts = false;
>  	int ret = -ENODEV;
>  	int irq;
>  
> @@ -498,8 +649,14 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  		dev_err(&pdev->dev, "no irq resource?\n");
>  		return irq;
>  	}
> -
>  	info->irq = irq;
> +
> +	irq = platform_get_irq(pdev, 1);
> +	if (irq == -EPROBE_DEFER)
> +		return irq; 
> +
> +	info->tsirq = irq;
> +
>  	info->dev = &pdev->dev;
>  
>  	init_completion(&info->completion);
> @@ -565,6 +722,15 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  	if (info->data->init_hw)
>  		info->data->init_hw(info);
>  
> +	/* leave out any TS related code if unreachable */
> +	if (IS_BUILTIN(CONFIG_INPUT) ||
> +	    (IS_MODULE(CONFIG_INPUT) && config_enabled(MODULE)))

This is ugly... We need IS_SUBSYSTEM_AVAILABLE() wrapper for this...

Anyway,

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


> +		has_ts = of_property_read_bool(pdev->dev.of_node, "has-touchscreen");
> +	if (has_ts)
> +		ret = exynos_adc_ts_init(info);
> +	if (ret)
> +		goto err_iio;
> +
>  	ret = of_platform_populate(np, exynos_adc_match, NULL, &indio_dev->dev);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "failed adding child nodes\n");
> @@ -576,6 +742,11 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  err_of_populate:
>  	device_for_each_child(&indio_dev->dev, NULL,
>  				exynos_adc_remove_devices);
> +	if (has_ts) {
> +		input_unregister_device(info->input);
> +		free_irq(info->tsirq, info);
> +	}
> +err_iio:
>  	iio_device_unregister(indio_dev);
>  err_irq:
>  	free_irq(info->irq, info);
> @@ -595,6 +766,11 @@ static int exynos_adc_remove(struct platform_device *pdev)
>  	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
>  	struct exynos_adc *info = iio_priv(indio_dev);
>  
> +	if (IS_BUILTIN(CONFIG_INPUT) ||
> +	    (IS_MODULE(CONFIG_INPUT) && config_enabled(MODULE))) {
> +		free_irq(info->tsirq, info);
> +		input_unregister_device(info->input);
> +	}
>  	device_for_each_child(&indio_dev->dev, NULL,
>  				exynos_adc_remove_devices);
>  	iio_device_unregister(indio_dev);
> 

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH v2] iio: exynos-adc: add experimental touchscreen support
From: Arnd Bergmann @ 2014-07-22 18:33 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8,
	t.figa-Sze3O3UU22JBDgjK7y7TUQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chanwoo Choi,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Jonathan Cameron,
	Ben Dooks, galak-sgV2jX0FEOL9JmXXK+q4OQ,
	ch.naveen-Sze3O3UU22JBDgjK7y7TUQ, linux-input,
	heiko.stuebner-K3U4GQvHnyU
In-Reply-To: <20140722180904.GB5489-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>

On Tuesday 22 July 2014 11:09:04 Dmitry Torokhov wrote:
> > @@ -565,6 +722,15 @@ static int exynos_adc_probe(struct platform_device *pdev)
> >       if (info->data->init_hw)
> >               info->data->init_hw(info);
> >  
> > +     /* leave out any TS related code if unreachable */
> > +     if (IS_BUILTIN(CONFIG_INPUT) ||
> > +         (IS_MODULE(CONFIG_INPUT) && config_enabled(MODULE)))
> 
> This is ugly... We need IS_SUBSYSTEM_AVAILABLE() wrapper for this...
> 
> Anyway,
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> 

I actually have a patch to introduce IS_REACHABLE() for this purpose,
but I haven't sent it out for review yet. The main user of this would
be drivers/media, which had the correct logic earlier until someone
tried to "simplify" it by replacing it all with IS_ENABLED()...

	Arnd

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Mauro Carvalho Chehab @ 2014-07-22 19:17 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-mips, linux-fbdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Benjamin Herrenschmidt, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Lee Jones, Matthew Garrett,
	Samuel Ortiz, Rafał Miłecki, Tomi Valkeinen,
	linux-serial@vger.kernel.org, Linux Input, abdoulaye berthe,
	Alexandre Courbot, Bryan Wu, arm@kernel.org,
	linux-gpio@vger.kernel.org, Mark Brown
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>

Em Tue, 22 Jul 2014 17:08:13 +0200
Linus Walleij <linus.walleij@linaro.org> escreveu:

> On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:
> 
> Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
> applied. We're getting rid of the return value from gpiochip_remove().
> 
> > this remove all reference to gpio_remove retval in all driver
> > except pinctrl and gpio. the same thing is done for gpio and
> > pinctrl in two different patches.
> >
> > Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
> (...)
> 
> I think this patch probably needs to be broken down per-subsystem as it
> hits all over the map. But let's start requesting ACKs for the
> individual pieces.
> Actually I think it will be OK to merge because there is likely not much churn
> around these code sites.
> 
> I'm a bit torn between just wanting a big patch for this hitting drivers/gpio
> and smaller patches hitting one subsystem at a time. We should be able
> to hammer this in one switch strike.
> 
...
> >  drivers/media/dvb-frontends/cxd2820r_core.c    | 10 +++-------
> 
> Mauro can you ACK this?

Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> 
> (Hm that looks weird. Mental note to look closer at this.)

What's weird there?

Regards,
Mauro

^ permalink raw reply

* Re: [PATCH 00/15] atmel_mxt_ts - device tree, bootloader, etc
From: Stephen Warren @ 2014-07-22 20:34 UTC (permalink / raw)
  To: nick.dyer
  Cc: Dmitry Torokhov, Yufeng Shen, Daniel Kurtz, Henrik Rydberg,
	Joonyoung Shim, Alan Bowens, linux-input, linux-kernel,
	Peter Meerwald, Benson Leung, Olof Johansson, Sekhar Nori
In-Reply-To: <1404399697-26484-1-git-send-email-nick.dyer@itdev.co.uk>

On 07/03/2014 09:01 AM, nick.dyer@itdev.co.uk wrote:
> Hi Dimitry-
> 
> Here is another set of atmel_mxt_ts patches for upstream. There are some
> really useful new features, but I hope nothing too controversial.

Unfortunately, I still can't get these to work on my system.

Per your "Re: atmel_mxt_ts: defaulting irqflags to
IRQF_TRIGGER_FALLING", I set up the IRQ type in the Tegra DT file, and
then applied this series on top of next-20140721. The driver appears to
initialize OK, but neither X nor evtest see any events from the device.
The IRQ count in /proc/interrupts doesn't increase when I touch the
touchpad, but does when I press it hard enough to trigger the physical
button. A boot log with debug enabled follows. No additional kernel log
messages are generated by touches or clicks. Do you have any idea what I
should try?

> [    1.634289] atmel_mxt_ts 1-004b: T37 Start:142 Size:130 Instances:1 Report IDs:0-0
> [    1.641889] atmel_mxt_ts 1-004b: T44 Start:272 Size:1 Instances:1 Report IDs:0-0
> [    1.649316] atmel_mxt_ts 1-004b: T5 Start:273 Size:9 Instances:1 Report IDs:0-0
> [    1.656631] atmel_mxt_ts 1-004b: T6 Start:282 Size:6 Instances:1 Report IDs:1-1
> [    1.663960] atmel_mxt_ts 1-004b: T38 Start:288 Size:8 Instances:1 Report IDs:0-0
> [    1.671376] atmel_mxt_ts 1-004b: T7 Start:296 Size:4 Instances:1 Report IDs:0-0
> [    1.678703] atmel_mxt_ts 1-004b: T8 Start:300 Size:10 Instances:1 Report IDs:0-0
> [    1.686104] atmel_mxt_ts 1-004b: T9 Start:310 Size:36 Instances:1 Report IDs:2-11
> [    1.693605] atmel_mxt_ts 1-004b: T15 Start:346 Size:11 Instances:1 Report IDs:12-12
> [    1.701286] atmel_mxt_ts 1-004b: T18 Start:357 Size:2 Instances:1 Report IDs:0-0
> [    1.708701] atmel_mxt_ts 1-004b: T19 Start:359 Size:6 Instances:1 Report IDs:13-13
> [    1.716276] atmel_mxt_ts 1-004b: T23 Start:365 Size:15 Instances:1 Report IDs:14-14
> [    1.723950] atmel_mxt_ts 1-004b: T25 Start:380 Size:15 Instances:1 Report IDs:15-15
> [    1.731622] atmel_mxt_ts 1-004b: T40 Start:395 Size:5 Instances:1 Report IDs:0-0
> [    1.739037] atmel_mxt_ts 1-004b: T42 Start:400 Size:10 Instances:1 Report IDs:16-16
> [    1.746697] atmel_mxt_ts 1-004b: T46 Start:410 Size:9 Instances:1 Report IDs:17-17
> [    1.754282] atmel_mxt_ts 1-004b: T47 Start:419 Size:13 Instances:1 Report IDs:0-0
> [    1.761783] atmel_mxt_ts 1-004b: T55 Start:432 Size:6 Instances:1 Report IDs:0-0
> [    1.769195] atmel_mxt_ts 1-004b: T56 Start:438 Size:40 Instances:1 Report IDs:18-18
> [    1.776855] atmel_mxt_ts 1-004b: T57 Start:478 Size:3 Instances:1 Report IDs:19-19
> [    1.784441] atmel_mxt_ts 1-004b: T61 Start:481 Size:5 Instances:2 Report IDs:20-21
> [    1.792028] atmel_mxt_ts 1-004b: T62 Start:491 Size:54 Instances:1 Report IDs:22-22
> [    1.821133] atmel_mxt_ts 1-004b: T6 Config Checksum: 0xC4CC1B
> [    1.826899] atmel_mxt_ts 1-004b: T6 Status 0x80 RESET
> [    1.831983] atmel_mxt_ts 1-004b: message: 00 20 00 00 00 00 00 00
> [    1.831998] atmel_mxt_ts 1-004b: Interrupt triggered but zero messages
> [    1.844743] atmel_mxt_ts 1-004b: Direct firmware load for maxtouch.cfg failed with error -2
> [    1.854145] atmel_mxt_ts 1-004b: Initialized power cfg: ACTV 16, IDLE 32
> [    1.862567] atmel_mxt_ts 1-004b: Touchscreen size X2040Y1360
> [    1.863232] input: Atmel maXTouch Touchpad as /devices/soc0/7000c400.i2c/i2c-1/1-004b/input/input1
> [    1.888976] atmel_mxt_ts 1-004b: Family: 130 Variant: 1 Firmware V1.0.AA Objects: 22
...
> [    8.591036] atmel_mxt_ts 1-004b: Set T7 ACTV:16 IDLE:32
> [    8.629419] atmel_mxt_ts 1-004b: Set T7 ACTV:0 IDLE:0
> [    8.669210] atmel_mxt_ts 1-004b: Set T7 ACTV:16 IDLE:32

^ permalink raw reply

* Re: [PATCH 04/15] Input: atmel_mxt_ts - implement device tree support
From: Stephen Warren @ 2014-07-22 20:37 UTC (permalink / raw)
  To: nick.dyer
  Cc: Dmitry Torokhov, Yufeng Shen, Daniel Kurtz, Henrik Rydberg,
	Joonyoung Shim, Alan Bowens, linux-input, linux-kernel,
	Peter Meerwald, Benson Leung, Olof Johansson, Sekhar Nori,
	Stephen Warren
In-Reply-To: <1404399697-26484-5-git-send-email-nick.dyer@itdev.co.uk>

On 07/03/2014 09:01 AM, nick.dyer@itdev.co.uk wrote:
> From: Stephen Warren <swarren@nvidia.com>

> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt

> +	touch@4b {
> +		compatible = "atmel,maxtouch";
> +		reg = <0x4b>;
> +		interrupt-parent = <&gpio>;
> +		interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>;

Oops. s/GPIO_ACTIVE_HIGH/IRQ_TYPE_LEVEL_LOW/ there; I evidently typed
something stupid into the doc when I wrote it!

^ permalink raw reply

* [git pull] Input updates for 3.16-rc6
From: Dmitry Torokhov @ 2014-07-23  5:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-input

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

Hi Linus,

Please pull from:

	git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git for-linus
or
	master.kernel.org:/pub/scm/linux/kernel/git/dtor/input.git for-linus

to receive a few fixups for the input subsystem.

Changelog:
---------

Bjorn Helgaas (1):
      Input: sirfsoc-onkey - fix GPL v2 license string typo

Dmitry Torokhov (1):
      Input: fix defuzzing logic

Felipe Balbi (1):
      Input: ti_am335x_tsc - warn about incorrect spelling

Hans de Goede (1):
      Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531)

Jiri Kosina (1):
      Input: i8042 - add Acer Aspire 5710 to nomux blacklist

Peter Hutterer (1):
      Input: document INPUT_PROP_TOPBUTTONPAD

Ping Cheng (1):
      Input: wacom - cleanup multitouch code when touch_max is 2

Tobias Klauser (1):
      Input: st-keyscan - fix 'defined but not used' compiler warnings


Diffstat:
--------

 Documentation/input/event-codes.txt       | 13 +++++++++++++
 drivers/input/input.c                     |  6 ++++--
 drivers/input/keyboard/st-keyscan.c       |  2 ++
 drivers/input/misc/sirfsoc-onkey.c        |  2 +-
 drivers/input/mouse/synaptics.c           |  5 +++--
 drivers/input/serio/i8042-x86ia64io.h     |  7 +++++++
 drivers/input/tablet/wacom_wac.c          | 28 +++++++---------------------
 drivers/input/touchscreen/ti_am335x_tsc.c |  5 ++++-
 8 files changed, 41 insertions(+), 27 deletions(-)

-- 
Dmitry


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox