* [PATCH] amba: Ensure drvdata is NULL
From: Michal Simek @ 2013-09-30 6:59 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Russell King, Dan Williams, Vinod Koul, Dmitry Torokhov,
Chris Ball, Alessandro Zummo, Linus Walleij, Mark Brown,
Greg Kroah-Hartman, Jiri Slaby, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, Wim Van Sebroeck, Andrew Morton, zhangwei(Jovi),
Randy Dunlap, linux-arm-kernel, linux-input, linux-mmc, rtc-linux,
linux-spi, linux-serial, linux-fbdev, linux-watchdog
[-- Attachment #1: Type: text/plain, Size: 7311 bytes --]
This patch is inpired by the patch for drvdata
"device-core: Ensure drvdata = NULL when no driver is bound"
(sha1: 0998d0631001288a5974afc0b2a5f568bcdecb4d)
Also it fixes all occurences in drivers.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
This patch has been sent as RFC in this thread.
http://lkml.org/lkml/2013/9/4/393
---
arch/arm/kernel/etm.c | 6 ------
drivers/amba/bus.c | 2 ++
drivers/dma/pl330.c | 3 ---
drivers/input/serio/ambakmi.c | 2 --
drivers/mmc/host/mmci.c | 2 --
drivers/rtc/rtc-pl030.c | 2 --
drivers/rtc/rtc-pl031.c | 2 --
drivers/spi/spi-pl022.c | 1 -
drivers/tty/serial/amba-pl010.c | 3 ---
drivers/tty/serial/amba-pl011.c | 3 ---
drivers/video/amba-clcd.c | 2 --
drivers/watchdog/sp805_wdt.c | 1 -
12 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 8ff0ecd..131a6ab 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -385,7 +385,6 @@ out:
return ret;
out_unmap:
- amba_set_drvdata(dev, NULL);
iounmap(t->etb_regs);
out_release:
@@ -398,8 +397,6 @@ static int etb_remove(struct amba_device *dev)
{
struct tracectx *t = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
iounmap(t->etb_regs);
t->etb_regs = NULL;
@@ -588,7 +585,6 @@ out:
return ret;
out_unmap:
- amba_set_drvdata(dev, NULL);
iounmap(t->etm_regs);
out_release:
@@ -601,8 +597,6 @@ static int etm_remove(struct amba_device *dev)
{
struct tracectx *t = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
iounmap(t->etm_regs);
t->etm_regs = NULL;
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index c670727..9762090 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -373,6 +373,7 @@ static int amba_probe(struct device *dev)
if (ret == 0)
break;
+ amba_set_drvdata(pcdev, NULL);
pm_runtime_disable(dev);
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
@@ -391,6 +392,7 @@ static int amba_remove(struct device *dev)
pm_runtime_get_sync(dev);
ret = drv->remove(pcdev);
+ amba_set_drvdata(pcdev, NULL);
pm_runtime_put_noidle(dev);
/* Undo the runtime PM settings in amba_probe() */
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index a562d24..dfb2931 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3029,8 +3029,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
return 0;
probe_err3:
- amba_set_drvdata(adev, NULL);
-
/* Idle the DMAC */
list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
chan.device_node) {
@@ -3064,7 +3062,6 @@ static int pl330_remove(struct amba_device *adev)
of_dma_controller_free(adev->dev.of_node);
dma_async_device_unregister(&pdmac->ddma);
- amba_set_drvdata(adev, NULL);
/* Idle the DMAC */
list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 4e2fd44..b7c206d 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -167,8 +167,6 @@ static int amba_kmi_remove(struct amba_device *dev)
{
struct amba_kmi_port *kmi = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
serio_unregister_port(kmi->io);
clk_put(kmi->clk);
iounmap(kmi->base);
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index c3785ed..07e17f1 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1678,8 +1678,6 @@ static int mmci_remove(struct amba_device *dev)
{
struct mmc_host *mmc = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
if (mmc) {
struct mmci_host *host = mmc_priv(mmc);
diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
index 22bacdb..a804f75 100644
--- a/drivers/rtc/rtc-pl030.c
+++ b/drivers/rtc/rtc-pl030.c
@@ -153,8 +153,6 @@ static int pl030_remove(struct amba_device *dev)
{
struct pl030_rtc *rtc = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
writel(0, rtc->base + RTC_CR);
free_irq(dev->irq[0], rtc);
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 0f0609b..c9ca86e 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -305,7 +305,6 @@ static int pl031_remove(struct amba_device *adev)
{
struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
- amba_set_drvdata(adev, NULL);
free_irq(adev->irq[0], ldata);
rtc_device_unregister(ldata->rtc);
iounmap(ldata->base);
@@ -392,7 +391,6 @@ out_no_irq:
rtc_device_unregister(ldata->rtc);
out_no_rtc:
iounmap(ldata->base);
- amba_set_drvdata(adev, NULL);
out_no_remap:
kfree(ldata);
out:
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 9c511a9..f661a7e 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2288,7 +2288,6 @@ pl022_remove(struct amba_device *adev)
amba_release_regions(adev);
tasklet_disable(&pl022->pump_transfers);
spi_unregister_master(pl022->master);
- amba_set_drvdata(adev, NULL);
return 0;
}
diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 8b90f0b..33bd860 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -728,7 +728,6 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(&amba_reg, &uap->port);
if (ret) {
- amba_set_drvdata(dev, NULL);
amba_ports[i] = NULL;
clk_put(uap->clk);
unmap:
@@ -745,8 +744,6 @@ static int pl010_remove(struct amba_device *dev)
struct uart_amba_port *uap = amba_get_drvdata(dev);
int i;
- amba_set_drvdata(dev, NULL);
-
uart_remove_one_port(&amba_reg, &uap->port);
for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index aaa2286..7203864 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2147,7 +2147,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(&amba_reg, &uap->port);
if (ret) {
- amba_set_drvdata(dev, NULL);
amba_ports[i] = NULL;
pl011_dma_remove(uap);
}
@@ -2160,8 +2159,6 @@ static int pl011_remove(struct amba_device *dev)
struct uart_amba_port *uap = amba_get_drvdata(dev);
int i;
- amba_set_drvdata(dev, NULL);
-
uart_remove_one_port(&amba_reg, &uap->port);
for (i = 0; i < ARRAY_SIZE(amba_ports); i++)
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 0a2cce7..0bab6ab 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -594,8 +594,6 @@ static int clcdfb_remove(struct amba_device *dev)
{
struct clcd_fb *fb = amba_get_drvdata(dev);
- amba_set_drvdata(dev, NULL);
-
clcdfb_disable(fb);
unregister_framebuffer(&fb->fb);
if (fb->fb.cmap.len)
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 58df98a..3f786ce 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -268,7 +268,6 @@ static int sp805_wdt_remove(struct amba_device *adev)
struct sp805_wdt *wdt = amba_get_drvdata(adev);
watchdog_unregister_device(&wdt->wdd);
- amba_set_drvdata(adev, NULL);
watchdog_set_drvdata(&wdt->wdd, NULL);
return 0;
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related
* Re: [PATCH] HID: roccat: Fix "cannot create duplicate filename" problems
From: Jiri Kosina @ 2013-09-30 8:52 UTC (permalink / raw)
To: Greg KH; +Cc: Stefan Achatz, linux-input, linux-kernel
In-Reply-To: <20130928040257.GA21630@kroah.com>
On Fri, 27 Sep 2013, Greg KH wrote:
> > Fixing some wrong macro stringification/concatenation.
> >
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
> > ---
> > drivers/hid/hid-roccat-kone.c | 2 +-
> > drivers/hid/hid-roccat-koneplus.c | 4 ++--
> > drivers/hid/hid-roccat-kovaplus.c | 4 ++--
> > drivers/hid/hid-roccat-pyra.c | 4 ++--
> > 4 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
> > index 602c188..6101816 100644
> > --- a/drivers/hid/hid-roccat-kone.c
> > +++ b/drivers/hid/hid-roccat-kone.c
> > @@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp,
> > }
> > #define PROFILE_ATTR(number) \
> > static struct bin_attribute bin_attr_profile##number = { \
> > - .attr = { .name = "profile##number", .mode = 0660 }, \
> > + .attr = { .name = "profile" #number, .mode = 0660 }, \
>
> Ugh, very sorry about that, I hate macros in C at times :)
>
> Jiri, can you take this through your tree, or I can if you want, it
> needs to go in for 3.12-final.
>
> If yours, feel free to add:
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Stefan, thanks for fixing my bugs, it's much appreciated.
Thanks, queued, will go to Linus for 3.12 still.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
From: Jiri Kosina @ 2013-09-30 14:35 UTC (permalink / raw)
To: Dan Carpenter, Joseph Salisbury
Cc: list, Haiyang Zhang, LKML, open, HID CORE LAYER, devel, thomas
In-Reply-To: <20130927152412.GF6192@mwanda>
On Fri, 27 Sep 2013, Dan Carpenter wrote:
> It looks like magicmouse_raw_event() returns 1 on success and 0 on
> failure.
Good catch indeed.
I am not completely sure whether we are going to fix an oops or not by
this, as I haven't seen the actual oops anywhere in this thread :) But
definitely this looks like a good fix.
Joseph, could you please test with that? Thanks.
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 3b43d1c..c211eb9 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -334,7 +334,7 @@ static int magicmouse_raw_event(struct hid_device *hdev,
size - 2 - data[1]);
break;
default:
- return 0;
+ return 1;
}
if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) {
@@ -347,7 +347,7 @@ static int magicmouse_raw_event(struct hid_device *hdev,
}
input_sync(input);
- return 1;
+ return 0;
}
static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hdev)
--
Jiri Kosina
SUSE Labs
^ permalink raw reply related
* Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
From: Dan Carpenter @ 2013-09-30 14:59 UTC (permalink / raw)
To: Jiri Kosina
Cc: list, Haiyang Zhang, LKML, open, thomas, HID CORE LAYER, devel,
Joseph Salisbury
In-Reply-To: <alpine.LNX.2.00.1309301634260.28935@pobox.suse.cz>
On Mon, Sep 30, 2013 at 04:35:47PM +0200, Jiri Kosina wrote:
> On Fri, 27 Sep 2013, Dan Carpenter wrote:
>
> > It looks like magicmouse_raw_event() returns 1 on success and 0 on
> > failure.
>
> Good catch indeed.
>
> I am not completely sure whether we are going to fix an oops or not by
> this, as I haven't seen the actual oops anywhere in this thread :) But
> definitely this looks like a good fix.
>
> Joseph, could you please test with that? Thanks.
In the new code both 0 and 1 are treated the same so this can't fix the
bug.
regards,
dan carpenter
^ permalink raw reply
* Re: atmel_mxt_ts driver DTS adoption
From: Nick Dyer @ 2013-09-30 15:41 UTC (permalink / raw)
To: Dan Murphy; +Cc: linux-input, Dmitry Torokhov, Henrik Rydberg
In-Reply-To: <5241CC68.70909@ti.com>
Hi Dan-
Dan Murphy wrote:
> I have been looking around and I am finding numerous patches for the
> atmel_mxt_ts file to adopt it to DTS.
>
> The last status I have seen was we were waiting for some re-write of
> the file and that was in April.
>
> Are there any recent patches for this? And are they ready?
>
> I have not followed the input list so I am sorry for not being up to
> date on this.
There is a big pending update to atmel_mxt_ts that I sent to linux-input on
27th June this year. It is combination of work done by the Google Chromium
guys (for the Pixel laptop) and by myself (working for Atmel UK). Dimitry
Torokhov was working on merging it as of earlier this month, I don't know
how far along he is with it.
Latest version is here:
https://github.com/ndyer/linux/commits/for-next
Supporting DTS is very high on my priority list as the next item of work,
amongst various other small features and code improvements. I should say,
some of those patches make large changes to the platform data required. If
you would like to send me a patch on top of the current set I am happy to
generalise if necessary, include it in the set of changes and manage
forwarding it to Dimitry in due course.
cheers
Nick
^ permalink raw reply
* Re: xpad input driver: Xbox 360 Wireless Adapter
From: David Herrmann @ 2013-09-30 18:49 UTC (permalink / raw)
To: Zachary Lund
Cc: linux-kernel, open list:HID CORE LAYER, Dmitry Torokhov,
Christoph Fritz, Marko Friedemann
In-Reply-To: <CAC24_3tuw2Ejcg_TLB0kd2XumhS8UDdBd_3YAmY9hh0G8y9kKQ@mail.gmail.com>
Hi
I'm not very familiar with the xbox-gamepad driver, but please see
below for some comments:
On Mon, Sep 23, 2013 at 2:34 AM, Zachary Lund <admin@computerquip.com> wrote:
> I'm apologize ahead of time if this thread isn't appropriate, I'm not
> very familiar with mailing lists, especially lkml. I'm also very new
> to kernel/module development (as of literally yesterday).
Input-drivers are discussed on <linux-input@vger.kernel.org> (now
CC'ed). I recommend subscribing to that list. I also put some driver
developers on CC as they are probably more qualified to answer your
questions.
Note that LKML is a high-traffic list mostly used in CC. Please always
CC the driver authors or maintainers.
> I was looking into getting the LED working properly for the Xbox 360
> controllers and learning about the basics of a kernel module at the
> same time. There were a few things that confused me. I will reference
> functions by name and all functions are from the current 3.12 branch.
It might be useful to mention the driver in question (it's
drivers/input/joystick/xpad.c I guess?).
> First, xpad_send_led_command seems to be geared only towards the
> "Microsoft X-Box 360 pad". Using xboxdrv as a reference, they use a
> completely different packet structure to set the LED status on the
> wireless controller which can be seen here:
> https://github.com/Grumbel/xboxdrv/blob/master/src/controller/xbox360_wireless_controller.cpp#L66
I don't think the kernel driver supports wireless pads, so it might
have a different "wireless optimized" wire-protocol. The driver is
USB-only, isn't it?
> Second, the driver acts strangely when setting the LED. It calls
> xpad_send_led_command during xpad_led_probe during xpad_probe but
> there's a chance that a controller might not even be connected if
> using the wireless adapter during that time!
What? During xpad_probe() a device must be fully functional. What
adapter are your talking about?
> The only way to seemingly
> tell if a controller is connected is by receiving the correct
> connection packets. If I use the correct packet structure (which I
> ripped almost directly from xboxdrv) and set the led after parsing a
> connection packet, the LED seemingly works fine!
Sounds reasonable. Do all devices send the connection-packets? If yes,
feel free to send a patch which moves LED initialization after receipt
of this package.
> Third, I'm incredibly new to really low level development. Whenever
> loading the module, it finds my wireless adapter but then creates 4
> devices (which seems to mean only 4 controllers are allowed per
> wireless adapter), each of which cause a call to xpad_probe. I
> couldn't figure out how to tell if other wireless controllers were
> already connected to the wireless adapter so I could light up the
> correct LED. How would I go about this properly?
Ugh? Sorry, but I don't understand what kind of wireless adapter this
is? Please give us a bit more information here. If the device is a
Bluetooth-device, why use an adapter at all?
Cheers
David
^ permalink raw reply
* Re: [PATCH 1/1] Input: cypress_ps2 - Return zero finger count if palm is detected.
From: Kamal Mostafa @ 2013-09-30 20:12 UTC (permalink / raw)
To: Joseph Salisbury
Cc: linux-kernel, dmitry.torokhov, rydberg, dudl, git, tim.gardner,
linux-input
In-Reply-To: <007c09ae4ef7f72ffb657de0fb3854fcbc6d88f0.1379968154.git.joseph.salisbury@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
On Tue, 2013-09-24 at 11:44 -0400, Joseph Salisbury wrote:
> BugLink: http://bugs.launchpad.net/bugs/1229361
>
> This patch sets the finger count to 0 in the case of palm contact.
>
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> (maintainer:INPUT (KEYBOARD,...,commit_signer:2/2=100%)
> Cc: Henrik Rydberg <rydberg@euromail.se> (maintainer:INPUT MULTITOUCH...)
> Cc: Kamal Mostafa <kamal@canonical.com> (commit_signer:2/2=100%)
> Cc: Dudley Du <dudl@cypress.com> (commit_signer:2/2=100%)
> Cc: Kyle Fazzari <git@status.e4ward.com> (commit_signer:1/2=50%)
> Cc: Tim Gardner <tim.gardner@canonical.com> (commit_signer:1/2=50%)
> Cc: linux-input@vger.kernel.org (open list:INPUT (KEYBOARD,...)
> Cc: linux-kernel@vger.kernel.org (open list)
> Cc: stable@vger.kernel.org
This patch works fine: eliminates stream of junk driver messages with no
ill effects.
Tested-by: Kamal Mostafa <kamal@canonical.com>
-Kamal
> ---
> drivers/input/mouse/cypress_ps2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
> index 45b3eda..95b2c40 100644
> --- a/drivers/input/mouse/cypress_ps2.c
> +++ b/drivers/input/mouse/cypress_ps2.c
> @@ -441,7 +441,7 @@ static int cypress_get_finger_count(unsigned char header_byte)
> case 2: return 5;
> default:
> /* Invalid contact (e.g. palm). Ignore it. */
> - return -1;
> + return 0;
> }
> }
>
> @@ -460,7 +460,7 @@ static int cypress_parse_packet(struct psmouse *psmouse,
>
> contact_cnt = cypress_get_finger_count(header_byte);
>
> - if (contact_cnt < 0) /* e.g. palm detect */
> + if (contact_cnt < 0)
> return -EINVAL;
>
> report_data->contact_cnt = contact_cnt;
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: xpad input driver: Xbox 360 Wireless Adapter
From: Zachary Lund @ 2013-10-01 0:11 UTC (permalink / raw)
To: David Herrmann
Cc: linux-kernel, open list:HID CORE LAYER, Dmitry Torokhov,
Christoph Fritz, Marko Friedemann
In-Reply-To: <CANq1E4QhpY1TdE2sXhwpY4RAHErAJs_Pek4-EKoRXCeGh_0j6A@mail.gmail.com>
I apologize for poor assumptions and lack of general knowledge
concerning what I'm talking about. However, I feel I can still help on
the subject.
As to what device I'm talking about, I'm talking about the more
properly termed "Xbox 360 Wireless Gaming Reciever". More information
and a picture can be found here:
http://www.microsoft.com/games/en-US/Hardware/Controllers/Pages/XboxWirelessGamingReceiverforWindows.aspx
Future references will refer the above device as "wireless reciever"
and the opposing wired controller that requires no reciever as "wired
controller".
When I refer to the "xpad driver", I mean the USB driver sitting here:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/input/joystick/xpad.c
To be clear, the wireless receiver connects to a USB port in the PC
and interacts wirelessly with any Xbox 360 controller that can connect
to the Xbox 360 console (but the driver doesn't need to know this).
When a controller is "synced" with the wireless receiver, it sends
events like normal over the corresponding USB interface via interrupt
endpoints.
>> Second, the driver acts strangely when setting the LED. It calls
>> xpad_send_led_command during xpad_led_probe during xpad_probe but
>> there's a chance that a controller might not even be connected if
>> using the wireless adapter during that time!
>
>What? During xpad_probe() a device must be fully functional. What
>adapter are your talking about?
I apologize again for not explaining well enough. When the wireless
receiver is connected, all 8 interfaces are probed immediately but a
wireless controller may not actually be synced with the wireless
receiver. Even if it were, the current method the xpad driver takes
doesn't seem to work on the wireless receiver and leaves the
controllers LED in a default "blinking" state.
>> The only way to seemingly
>> tell if a controller is connected is by receiving the correct
>> connection packets. If I use the correct packet structure (which I
>> ripped almost directly from xboxdrv) and set the led after parsing a
>> connection packet, the LED seemingly works fine!
>
>Sounds reasonable. Do all devices send the connection-packets? If yes,
>feel free to send a patch which moves LED initialization after receipt
>of this package.
My inexperience comes into play here probably so take what I say with
a grain of salt please. Whenever a controller is synced with the
wireless reciever, the wireless receiver sends an interrupt packet
containing 0x08 0x80 to the driver to say that a new controller is
connected (which corresponds to the USB interface it was sent on,
explained below) or 0x08 0x00 to say that it has disconnected. I
believe there's already a patch available (not created by me) after
further diving in the mailing list, although I cannot confirm whether
it works or not as I've not tested it myself:
https://lkml.org/lkml/2012/11/30/558
To further explain, there are differences between the wireless
receiver and wired controller concerning how it works. The wired
controller seems to have only 4 USB interfaces (according to
http://www.free60.org/GamePad) whereas the wireless receiver has 8. I
cannot explain what the interfaces for the wired controller do but for
the wireless receiver, all odd interfaces seem to deal with input
events, LEDs, and anything to do with the actual controller. So
interfaces 1, 3, 5, and 7 can represent a controller. All even
interfaces (0, 2, 4, 6) seem to represent something else, probably a
headset which I can't confirm or test. Either way, the driver doesn't
support whatever these interfaces do so should xpad actually claim
them? The patch mentioned above seems to also remove the out bulk
endpoint sense it doesn't seem to be useful to any of the Xbox 360
controllers including the wired ones. A lot of things I don't know
myself. I apologize if I just confused the matter.
>> Third, I'm incredibly new to really low level development. Whenever
>> loading the module, it finds my wireless adapter but then creates 4
>> devices (which seems to mean only 4 controllers are allowed per
>> wireless adapter), each of which cause a call to xpad_probe. I
>> couldn't figure out how to tell if other wireless controllers were
>> already connected to the wireless adapter so I could light up the
>> correct LED. How would I go about this properly?
>
>Ugh? Sorry, but I don't understand what kind of wireless adapter this
>is? Please give us a bit more information here. If the device is a
>Bluetooth-device, why use an adapter at all?
Please ignore... I did not properly understand how USB devices work
(rather, I'm still learning) when writing this question and its poorly
written which just confused the topic if I haven't done so more in
previous comments.
On Mon, Sep 30, 2013 at 1:49 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
> Hi
>
> I'm not very familiar with the xbox-gamepad driver, but please see
> below for some comments:
>
> On Mon, Sep 23, 2013 at 2:34 AM, Zachary Lund <admin@computerquip.com> wrote:
>> I'm apologize ahead of time if this thread isn't appropriate, I'm not
>> very familiar with mailing lists, especially lkml. I'm also very new
>> to kernel/module development (as of literally yesterday).
>
> Input-drivers are discussed on <linux-input@vger.kernel.org> (now
> CC'ed). I recommend subscribing to that list. I also put some driver
> developers on CC as they are probably more qualified to answer your
> questions.
>
> Note that LKML is a high-traffic list mostly used in CC. Please always
> CC the driver authors or maintainers.
>
>> I was looking into getting the LED working properly for the Xbox 360
>> controllers and learning about the basics of a kernel module at the
>> same time. There were a few things that confused me. I will reference
>> functions by name and all functions are from the current 3.12 branch.
>
> It might be useful to mention the driver in question (it's
> drivers/input/joystick/xpad.c I guess?).
>
>> First, xpad_send_led_command seems to be geared only towards the
>> "Microsoft X-Box 360 pad". Using xboxdrv as a reference, they use a
>> completely different packet structure to set the LED status on the
>> wireless controller which can be seen here:
>> https://github.com/Grumbel/xboxdrv/blob/master/src/controller/xbox360_wireless_controller.cpp#L66
>
> I don't think the kernel driver supports wireless pads, so it might
> have a different "wireless optimized" wire-protocol. The driver is
> USB-only, isn't it?
>
>> Second, the driver acts strangely when setting the LED. It calls
>> xpad_send_led_command during xpad_led_probe during xpad_probe but
>> there's a chance that a controller might not even be connected if
>> using the wireless adapter during that time!
>
> What? During xpad_probe() a device must be fully functional. What
> adapter are your talking about?
>
>> The only way to seemingly
>> tell if a controller is connected is by receiving the correct
>> connection packets. If I use the correct packet structure (which I
>> ripped almost directly from xboxdrv) and set the led after parsing a
>> connection packet, the LED seemingly works fine!
>
> Sounds reasonable. Do all devices send the connection-packets? If yes,
> feel free to send a patch which moves LED initialization after receipt
> of this package.
>
>> Third, I'm incredibly new to really low level development. Whenever
>> loading the module, it finds my wireless adapter but then creates 4
>> devices (which seems to mean only 4 controllers are allowed per
>> wireless adapter), each of which cause a call to xpad_probe. I
>> couldn't figure out how to tell if other wireless controllers were
>> already connected to the wireless adapter so I could light up the
>> correct LED. How would I go about this properly?
>
> Ugh? Sorry, but I don't understand what kind of wireless adapter this
> is? Please give us a bit more information here. If the device is a
> Bluetooth-device, why use an adapter at all?
>
> Cheers
> David
^ permalink raw reply
* [hp mini 210-1000] touchpad "jump" when try to select elements
From: Stefano Statuti @ 2013-10-01 7:33 UTC (permalink / raw)
To: linux-input@vger.kernel.org, linux-aio@kvack.org,
michael.hennerich@analog.com, christopher.m.penalver@gmail.com
In-Reply-To: <DUB107-W50292E6A87D9E3761EA683832B0@phx.gbl>
hi,
i have this problem from 10.04 to 13.10 & with all kernels until lastest version of mainline kernel 3.12.rc3.
i have already post a report inside the Ubuntu launchpad (_https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1188965) and don't solve the problem, Chistopher M.Penalver (penalvch) say to me contact you.
i can reproduce all the problems :
1) if i click on left button and try to select (using 2 different
fingers) some element (like word in a website) the icon of mouse has a
strange comportament, "jump".
mouse is this _http://h10032.www1.hp.com/ctg/Manual/c02241565.pdf page n° 14
if i try to put my finger into touchpad on "Left touchpad button" (or
Right touchpad button) and try to scroll my finger over the button the
mouse's pointer moves, instead it should not!
2) in this mouse there is a led (TouchPad on/off button) but NOT
work. From manual I have this description : "Turns the Touch Pad on and off. Quickly double-tap the button to turn the TouchPad on and off."
Greetings
Stefano Statuti --
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 1/3] HID: Delay opening HID device
From: Jonathan Cameron @ 2013-10-01 8:42 UTC (permalink / raw)
To: Jiri Kosina, Srinivas Pandruvada; +Cc: linux-input, linux-iio, holler
In-Reply-To: <alpine.LNX.2.00.1309241131510.18703@pobox.suse.cz>
On 09/24/13 10:32, Jiri Kosina wrote:
> On Wed, 18 Sep 2013, Srinivas Pandruvada wrote:
>
>> Don't call hid_open_device till there is actually an user. This saves
>> power by not opening underlying transport for HID. Also close device
>> if there are no active mfd client using HID sensor hub.
>>
>> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
>
> Jonathan, I'd be good if I pass this to you to apply the whole lot.
Applied to the togreg branch of iio.git
Thanks,
^ permalink raw reply
* Re: [PATCH 2/3] IIO: call sensor hub open close function
From: Jonathan Cameron @ 2013-10-01 8:42 UTC (permalink / raw)
To: Srinivas Pandruvada, linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: jkosina-AlSwsSmVLrQ, holler-SXC+2es9fhnfWeYVQQPykw
In-Reply-To: <1379524399-16995-2-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
On 09/18/13 18:13, Srinivas Pandruvada wrote:
> Call hid_sensor_hub_device_open when user space opens device and call
> hid_sensor_hub_device_close when device is closed. This helps in
> saving power.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> index 87419c4..b6e77e0 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> @@ -34,6 +34,12 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig,
> struct hid_sensor_common *st = iio_trigger_get_drvdata(trig);
> int state_val;
>
> + if (state) {
> + if (sensor_hub_device_open(st->hsdev))
> + return -EIO;
> + } else
> + sensor_hub_device_close(st->hsdev);
> +
> state_val = state ? 1 : 0;
> if (IS_ENABLED(CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS))
> ++state_val;
>
^ permalink raw reply
* Re: [PATCH 3/3] HID RTC: Open sensor hub open close
From: Jonathan Cameron @ 2013-10-01 8:42 UTC (permalink / raw)
To: Srinivas Pandruvada, linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: jkosina-AlSwsSmVLrQ, holler-SXC+2es9fhnfWeYVQQPykw
In-Reply-To: <1379524399-16995-3-git-send-email-srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
On 09/18/13 18:13, Srinivas Pandruvada wrote:
> Open sensor hub when module is loaded and close when module is removed.
> This helps saving power by opening HID transport only when there is an
> user.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> Acked-by: Alessandro Zummo <a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>
Hi,
It looks like there has been a fair bit of reorganising going on in this driver
that is making this a little fiddly to merge.
Could you send me an updated patch against what is currently in the togreg
branch of iio.git. As we haven't touched this recently, that should be
the same as mainline.
Jonathan
> ---
> drivers/rtc/rtc-hid-sensor-time.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
> index 7273b01..1fe170c 100644
> --- a/drivers/rtc/rtc-hid-sensor-time.c
> +++ b/drivers/rtc/rtc-hid-sensor-time.c
> @@ -279,15 +279,28 @@ static int hid_time_probe(struct platform_device *pdev)
> return ret;
> }
>
> + ret = sensor_hub_device_open(hsdev);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to open sensor hub device!\n");
> + goto err_open;
> + }
> +
> time_state->rtc = devm_rtc_device_register(&pdev->dev,
> "hid-sensor-time", &hid_time_rtc_ops,
> THIS_MODULE);
>
> if (IS_ERR(time_state->rtc)) {
> dev_err(&pdev->dev, "rtc device register failed!\n");
> - return PTR_ERR(time_state->rtc);
> + ret = PTR_ERR(time_state->rtc);
> + goto err_rtc;
> }
>
> + return 0;
> +
> +err_rtc:
> + sensor_hub_device_close(hsdev);
> +err_open:
> + sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TIME);
> return ret;
> }
>
> @@ -295,6 +308,7 @@ static int hid_time_remove(struct platform_device *pdev)
> {
> struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
>
> + sensor_hub_device_close(hsdev);
> sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TIME);
>
> return 0;
>
^ permalink raw reply
* Re: [PATCHv6] staging/iio/adc: change the MXS touchscreen driver implementation
From: Jonathan Cameron @ 2013-10-01 9:25 UTC (permalink / raw)
To: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-1-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
I'm looking for some Tested-by: or Acks on this before applying the series.
I got the impression from the comments on the previous version that the
series has now been reasonably thoroughly tested on both i.MX28 and i.MX23 boards.
This is not yet reflected in the sign off trail and in fact a couple of the patch
descriptions say that they are untested on i.MX28.
Jonathan
On 09/23/13 15:36, Juergen Beisert wrote:
> The following series replaces the current busy loop touchscreen implementation
> for i.MX28/i.MX23 SoCs by a fully interrupt driven implementation.
>
> Since i.MX23 and i.MX28 silicon differs, the existing implementation can
> be used for the i.MX28 SoC only.
>
> The first patch adds proper clock handling. Various platforms seems to disable
> the internal 2 kHz clock which is used by the LRADC delay units.
>
> The next two patches of this series move the i.MX28 specific definitions
> out of the way. The forth patch simplifies the register access to make it easier
> to add the i.MX23 support. Then the i.MX23 specific definitions are added, also
> the code to distinguish both SoCs at run-time.
> Up to here the existing touchscreen driver will now run on an i.MX23 Soc as well.
>
> When these i.MX SoCs are running from battery it seems not to be a good idea to
> run a busy loop to detect touches and their location. The 6th patch adds a
> fully interrupt driven implementation which makes use of the built-in delay
> and multiple sample features of the touchscreen controller. This will reduce
> the interrupt load to a minimum.
>
> The remaining patches in this series just removes the existing busy loop
> implementation, add a proposal for devicetree binding and a reminder what has
> still to be done with the LRADC driver.
>
> Changes since v5:
>
> - add missing clock handling which prevents the delay units from work (this
> should make it work on the MX28EVK and M28EVK as well)
>
> Changes since v4:
>
> - honor Jonathan's comments about function names
> - honor Dmitry's comments about workqueue canceling and interrupts
> - adding devicetree bindings proposal
>
> Changes since v3:
>
> - split adding register access functions and i.MX23 support into two patches
>
> Changes since v2:
>
> - useless debug output removed
>
> Changes since v1:
>
> - adding register access functions to make the existing code more readable
> - adding some functions to distinguish the SoCs at run-time to avoid if-else
> contructs whenever differences in the register layout between i.MX23 and
> i.MX28 must be handled
>
> Comments are welcome.
>
> Juergen
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH 6/9] Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection
From: Jürgen Beisert @ 2013-10-01 9:28 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg, Dmitry Torokhov,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-7-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Hi Jonathan,
On Tuesday 01 October 2013 11:25:46 Jonathan Cameron wrote:
> a couple of the patch descriptions say that they are untested on i.MX28.
On Monday 23 September 2013 16:36:35 Juergen Beisert wrote:
> For battery driven systems it is a very bad idea to collect the touchscreen
> data within a kernel busy loop.
>
> This change uses the features of the hardware to delay and accumulate
> samples in hardware to avoid a high interrupt and CPU load.
>
> Note: this is only tested on an i.MX23 SoC yet.
This note is no longer true. Marek tested it on his M28EVK, Lothar on his TX28
and myself also on an i.MX28EVK.
For the IIO part of the driver I tested on my i.MX23 based ChumbyOne and some
customer hardware and it seems still to work (I can only guess if the values I
read from the sysfs entries are correct, sorry).
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH 1/9] Staging/iio/adc/touchscreen/MXS: add proper clock handling
From: Jonathan Cameron @ 2013-10-01 10:57 UTC (permalink / raw)
To: Jürgen Beisert, linux-arm-kernel
Cc: Fabio Estevam, linux-iio, devel, marex, jic23, linux-input
In-Reply-To: <201309240950.54789.jbe@pengutronix.de>
On 09/24/13 08:50, Jürgen Beisert wrote:
> Hi Fabio,
>
> On Monday 23 September 2013 17:13:03 Fabio Estevam wrote:
>> On 09/23/2013 11:36 AM, Juergen Beisert wrote:
>>> + lradc->clk = devm_clk_get(&pdev->dev, NULL);
>>> + clk_prepare_enable(lradc->clk);
>>
>> clk_prepare_enable() may fail, so better check its return value.
>
> Thanks for the comment. Better this way?
>
> commit 825c5bb787a0dc9d25d480178e117be08810639c
> Author: Juergen Beisert <jbe@pengutronix.de>
> Date: Mon Sep 23 16:10:56 2013 +0200
Applied. If you are going to have a new patch version in the middle of the thread
please generate it with git format-patch and then send it as a reply to the email
you are responding to. Applying a patch like this is no where near as easy.
Applied to the togreg branch of iio.git
Thanks
>
> Staging/iio/adc/touchscreen/MXS: add proper clock handling
>
> The delay units inside the LRADC depend on the presence of a 2 kHz clock.
> This change enables the clock to be able to use the delay unit for the
> touchscreen part of the driver.
>
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
>
> diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
> index 28b5ce2..07caf76 100644
> --- a/arch/arm/boot/dts/imx23.dtsi
> +++ b/arch/arm/boot/dts/imx23.dtsi
> @@ -430,6 +430,7 @@
> reg = <0x80050000 0x2000>;
> interrupts = <36 37 38 39 40 41 42 43 44>;
> status = "disabled";
> + clocks = <&clks 26>;
> };
>
> spdif@80054000 {
> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
> index 7363fde..175deef 100644
> --- a/arch/arm/boot/dts/imx28.dtsi
> +++ b/arch/arm/boot/dts/imx28.dtsi
> @@ -902,6 +902,7 @@
> interrupts = <10 14 15 16 17 18 19
> 20 21 22 23 24 25>;
> status = "disabled";
> + clocks = <&clks 41>;
> };
>
> spdif: spdif@80054000 {
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index a08c173..eaca1ae 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -35,6 +35,7 @@
> #include <linux/completion.h>
> #include <linux/delay.h>
> #include <linux/input.h>
> +#include <linux/clk.h>
>
> #include <linux/iio/iio.h>
> #include <linux/iio/buffer.h>
> @@ -134,6 +135,8 @@ struct mxs_lradc {
> void __iomem *base;
> int irq[13];
>
> + struct clk *clk;
> +
> uint32_t *buffer;
> struct iio_trigger *trig;
>
> @@ -928,6 +931,17 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> if (IS_ERR(lradc->base))
> return PTR_ERR(lradc->base);
>
> + lradc->clk = devm_clk_get(&pdev->dev, NULL);
> + if (IS_ERR(lradc->clk)) {
> + dev_err(dev, "Failed to get the delay unit clock\n");
> + return PTR_ERR(lradc->clk);
> + }
> + ret = clk_prepare_enable(lradc->clk);
> + if (ret != 0) {
> + dev_err(dev, "Failed to enable the delay unit clock\n");
> + return ret;
> + }
> +
> INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
>
> /* Check if touchscreen is enabled in DT. */
> @@ -1020,6 +1034,7 @@ static int mxs_lradc_remove(struct platform_device *pdev)
> iio_triggered_buffer_cleanup(iio);
> mxs_lradc_trigger_remove(iio);
>
> + clk_disable_unprepare(lradc->clk);
> return 0;
> }
>
> Juergen
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 4/9] Staging/iio/adc/touchscreen/MXS: simplify register access
From: Jonathan Cameron @ 2013-10-01 11:01 UTC (permalink / raw)
To: Juergen Beisert, linux-iio
Cc: linux-arm-kernel, devel, marex, fabio.estevam, jic23, linux-input
In-Reply-To: <1379946998-23041-5-git-send-email-jbe@pengutronix.de>
On 09/23/13 15:36, Juergen Beisert wrote:
> Replace the individual register access by a few shared access function to make the
> code easier to read and in order to add the i.MX23 SoC in the next step.
>
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-input@vger.kernel.org
> CC: devel@driverdev.osuosl.org
> CC: Marek Vasut <marex@denx.de>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> CC: Jonathan Cameron <jic23@cam.ac.uk>
Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 204 +++++++++++++++++++++---------------
> 1 file changed, 120 insertions(+), 84 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index f2fb10a..dd47ec2 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -238,6 +238,56 @@ struct mxs_lradc {
> #define LRADC_RESOLUTION 12
> #define LRADC_SINGLE_SAMPLE_MASK ((1 << LRADC_RESOLUTION) - 1)
>
> +static void mxs_lradc_reg_set(struct mxs_lradc *lradc, u32 val, u32 reg)
> +{
> + writel(val, lradc->base + reg + STMP_OFFSET_REG_SET);
> +}
> +
> +static void mxs_lradc_reg_clear(struct mxs_lradc *lradc, u32 val, u32 reg)
> +{
> + writel(val, lradc->base + reg + STMP_OFFSET_REG_CLR);
> +}
> +
> +static void mxs_lradc_reg_wrt(struct mxs_lradc *lradc, u32 val, u32 reg)
> +{
> + writel(val, lradc->base + reg);
> +}
> +
> +static u32 mxs_lradc_plate_mask(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL0_MX28_PLATE_MASK;
> +}
> +
> +static u32 mxs_lradc_irq_en_mask(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK;
> +}
> +
> +static u32 mxs_lradc_irq_mask(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL1_MX28_LRADC_IRQ_MASK;
> +}
> +
> +static u32 mxs_lradc_touch_detect_bit(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE;
> +}
> +
> +static u32 mxs_lradc_drive_x_plate(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL0_MX28_XPPSW | LRADC_CTRL0_MX28_XNNSW;
> +}
> +
> +static u32 mxs_lradc_drive_y_plate(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_YNNSW;
> +}
> +
> +static u32 mxs_lradc_drive_pressure(struct mxs_lradc *lradc)
> +{
> + return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
> +}
> +
> /*
> * Raw I/O operations
> */
> @@ -272,21 +322,19 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> * Virtual channel 0 is always used here as the others are always not
> * used if doing raw sampling.
> */
> - writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> - writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + LRADC_CTRL1);
> + mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
>
> /* Clean the slot's previous content, then set new one. */
> - writel(LRADC_CTRL4_LRADCSELECT_MASK(0),
> - lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
> - writel(chan->channel, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), LRADC_CTRL4);
> + mxs_lradc_reg_set(lradc, chan->channel, LRADC_CTRL4);
>
> - writel(0, lradc->base + LRADC_CH(0));
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_CH(0));
>
> /* Enable the IRQ and start sampling the channel. */
> - writel(LRADC_CTRL1_LRADC_IRQ_EN(0),
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
> - writel(1 << 0, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_set(lradc, LRADC_CTRL1_LRADC_IRQ_EN(0), LRADC_CTRL1);
> + mxs_lradc_reg_set(lradc, 1 << 0, LRADC_CTRL0);
>
> /* Wait for completion on the channel, 1 second max. */
> ret = wait_for_completion_killable_timeout(&lradc->completion, HZ);
> @@ -300,8 +348,7 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> ret = IIO_VAL_INT;
>
> err:
> - writel(LRADC_CTRL1_LRADC_IRQ_EN(0),
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ_EN(0), LRADC_CTRL1);
>
> mutex_unlock(&lradc->lock);
>
> @@ -327,10 +374,9 @@ static int mxs_lradc_ts_touched(struct mxs_lradc *lradc)
> uint32_t reg;
>
> /* Enable touch detection. */
> - writel(LRADC_CTRL0_MX28_PLATE_MASK,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> - writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, mxs_lradc_plate_mask(lradc), LRADC_CTRL0);
> + mxs_lradc_reg_set(lradc, mxs_lradc_touch_detect_bit(lradc),
> + LRADC_CTRL0);
>
> msleep(LRADC_TS_SAMPLE_DELAY_MS);
>
> @@ -375,32 +421,33 @@ static int32_t mxs_lradc_ts_sample(struct mxs_lradc *lradc,
> */
> switch (plate) {
> case LRADC_SAMPLE_X:
> - ctrl0 = LRADC_CTRL0_MX28_XPPSW | LRADC_CTRL0_MX28_XNNSW;
> + ctrl0 = mxs_lradc_drive_x_plate(lradc);
> chan = 3;
> break;
> case LRADC_SAMPLE_Y:
> - ctrl0 = LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_YNNSW;
> + ctrl0 = mxs_lradc_drive_y_plate(lradc);
> chan = 4;
> break;
> case LRADC_SAMPLE_PRESSURE:
> - ctrl0 = LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
> + ctrl0 = mxs_lradc_drive_pressure(lradc);
> chan = 5;
> break;
> }
>
> if (change) {
> - writel(LRADC_CTRL0_MX28_PLATE_MASK,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> - writel(ctrl0, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> -
> - writel(LRADC_CTRL4_LRADCSELECT_MASK(slot),
> - lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
> - writel(chan << LRADC_CTRL4_LRADCSELECT_OFFSET(slot),
> - lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, mxs_lradc_plate_mask(lradc),
> + LRADC_CTRL0);
> + mxs_lradc_reg_set(lradc, ctrl0, LRADC_CTRL0);
> +
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(slot),
> + LRADC_CTRL4);
> + mxs_lradc_reg_set(lradc,
> + chan << LRADC_CTRL4_LRADCSELECT_OFFSET(slot),
> + LRADC_CTRL4);
> }
>
> - writel(0xffffffff, lradc->base + LRADC_CH(slot) + STMP_OFFSET_REG_CLR);
> - writel(1 << slot, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, 0xffffffff, LRADC_CH(slot));
> + mxs_lradc_reg_set(lradc, 1 << slot, LRADC_CTRL0);
>
> delay = jiffies + msecs_to_jiffies(LRADC_TS_SAMPLE_DELAY_MS);
> do {
> @@ -410,8 +457,7 @@ static int32_t mxs_lradc_ts_sample(struct mxs_lradc *lradc,
> break;
> } while (time_before(jiff, delay));
>
> - writel(LRADC_CTRL1_LRADC_IRQ(slot),
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ(slot), LRADC_CTRL1);
>
> if (time_after_eq(jiff, delay))
> return -ETIMEDOUT;
> @@ -450,8 +496,8 @@ static void mxs_lradc_ts_work(struct work_struct *ts_work)
>
> while (mxs_lradc_ts_touched(lradc)) {
> /* Disable touch detector so we can sample the touchscreen. */
> - writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, mxs_lradc_touch_detect_bit(lradc),
> + LRADC_CTRL0);
>
> if (likely(valid)) {
> input_report_abs(lradc->ts_input, ABS_X, val_x);
> @@ -485,10 +531,8 @@ static void mxs_lradc_ts_work(struct work_struct *ts_work)
> return;
>
> /* Restart the touchscreen interrupts. */
> - writel(LRADC_CTRL1_TOUCH_DETECT_IRQ,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> - writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, LRADC_CTRL1);
> + mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1);
> }
>
> static int mxs_lradc_ts_open(struct input_dev *dev)
> @@ -499,12 +543,11 @@ static int mxs_lradc_ts_open(struct input_dev *dev)
> lradc->stop_touchscreen = false;
>
> /* Enable the touch-detect circuitry. */
> - writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_set(lradc, mxs_lradc_touch_detect_bit(lradc),
> + LRADC_CTRL0);
>
> /* Enable the touch-detect IRQ. */
> - writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1);
>
> return 0;
> }
> @@ -521,12 +564,11 @@ static void mxs_lradc_ts_close(struct input_dev *dev)
> cancel_work_sync(&lradc->ts_work);
>
> /* Disable touchscreen touch-detect IRQ. */
> - writel(LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
> + LRADC_CTRL1);
>
> /* Power-down touchscreen touch-detect circuitry. */
> - writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, mxs_lradc_touch_detect_bit(lradc), LRADC_CTRL0);
> }
>
> static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
> @@ -589,7 +631,7 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
> LRADC_CTRL1_TOUCH_DETECT_IRQ_EN |
> LRADC_CTRL1_TOUCH_DETECT_IRQ;
>
> - if (!(reg & LRADC_CTRL1_MX28_LRADC_IRQ_MASK))
> + if (!(reg & mxs_lradc_irq_mask(lradc)))
> return IRQ_NONE;
>
> /*
> @@ -598,8 +640,7 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
> * it ASAP
> */
> if (reg & LRADC_CTRL1_TOUCH_DETECT_IRQ) {
> - writel(ts_irq_mask,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, ts_irq_mask, LRADC_CTRL1);
> if (!lradc->stop_touchscreen)
> schedule_work(&lradc->ts_work);
> }
> @@ -609,8 +650,7 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
> else if (reg & LRADC_CTRL1_LRADC_IRQ(0))
> complete(&lradc->completion);
>
> - writel(reg & LRADC_CTRL1_MX28_LRADC_IRQ_MASK,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, reg & mxs_lradc_irq_mask(lradc), LRADC_CTRL1);
>
> return IRQ_HANDLED;
> }
> @@ -629,7 +669,7 @@ static irqreturn_t mxs_lradc_trigger_handler(int irq, void *p)
>
> for_each_set_bit(i, iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS) {
> lradc->buffer[j] = readl(lradc->base + LRADC_CH(j));
> - writel(chan_value, lradc->base + LRADC_CH(j));
> + mxs_lradc_reg_wrt(lradc, chan_value, LRADC_CH(j));
> lradc->buffer[j] &= LRADC_CH_VALUE_MASK;
> lradc->buffer[j] /= LRADC_DELAY_TIMER_LOOP;
> j++;
> @@ -654,7 +694,7 @@ static int mxs_lradc_configure_trigger(struct iio_trigger *trig, bool state)
> struct mxs_lradc *lradc = iio_priv(iio);
> const uint32_t st = state ? STMP_OFFSET_REG_SET : STMP_OFFSET_REG_CLR;
>
> - writel(LRADC_DELAY_KICK, lradc->base + LRADC_DELAY(0) + st);
> + mxs_lradc_reg_wrt(lradc, LRADC_DELAY_KICK, LRADC_DELAY(0) + st);
>
> return 0;
> }
> @@ -730,29 +770,26 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
> if (ret < 0)
> goto err_buf;
>
> - writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> - writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + LRADC_CTRL1);
> + mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
>
> for_each_set_bit(chan, iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS) {
> ctrl4_set |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs);
> ctrl4_clr |= LRADC_CTRL4_LRADCSELECT_MASK(ofs);
> ctrl1_irq |= LRADC_CTRL1_LRADC_IRQ_EN(ofs);
> - writel(chan_value, lradc->base + LRADC_CH(ofs));
> + mxs_lradc_reg_wrt(lradc, chan_value, LRADC_CH(ofs));
> bitmap_set(&enable, ofs, 1);
> ofs++;
> }
>
> - writel(LRADC_DELAY_TRIGGER_LRADCS_MASK | LRADC_DELAY_KICK,
> - lradc->base + LRADC_DELAY(0) + STMP_OFFSET_REG_CLR);
> -
> - writel(ctrl4_clr, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_CLR);
> - writel(ctrl4_set, lradc->base + LRADC_CTRL4 + STMP_OFFSET_REG_SET);
> -
> - writel(ctrl1_irq, lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
> -
> - writel(enable << LRADC_DELAY_TRIGGER_LRADCS_OFFSET,
> - lradc->base + LRADC_DELAY(0) + STMP_OFFSET_REG_SET);
> + mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
> + LRADC_DELAY_KICK, LRADC_DELAY(0));
> + mxs_lradc_reg_clear(lradc, ctrl4_clr, LRADC_CTRL4);
> + mxs_lradc_reg_set(lradc, ctrl4_set, LRADC_CTRL4);
> + mxs_lradc_reg_set(lradc, ctrl1_irq, LRADC_CTRL1);
> + mxs_lradc_reg_set(lradc, enable << LRADC_DELAY_TRIGGER_LRADCS_OFFSET,
> + LRADC_DELAY(0));
>
> return 0;
>
> @@ -767,12 +804,12 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio)
> {
> struct mxs_lradc *lradc = iio_priv(iio);
>
> - writel(LRADC_DELAY_TRIGGER_LRADCS_MASK | LRADC_DELAY_KICK,
> - lradc->base + LRADC_DELAY(0) + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
> + LRADC_DELAY_KICK, LRADC_DELAY(0));
>
> - writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> - writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + LRADC_CTRL1);
>
> kfree(lradc->buffer);
> mutex_unlock(&lradc->lock);
> @@ -867,24 +904,24 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
> return ret;
>
> /* Configure DELAY CHANNEL 0 for generic ADC sampling. */
> - writel(adc_cfg, lradc->base + LRADC_DELAY(0));
> + mxs_lradc_reg_wrt(lradc, adc_cfg, LRADC_DELAY(0));
>
> /* Disable remaining DELAY CHANNELs */
> - writel(0, lradc->base + LRADC_DELAY(1));
> - writel(0, lradc->base + LRADC_DELAY(2));
> - writel(0, lradc->base + LRADC_DELAY(3));
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(1));
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2));
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
>
> /* Configure the touchscreen type */
> - writel(LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> + LRADC_CTRL0);
>
> - if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE) {
> - writel(LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> - lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> + if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> + mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> + LRADC_CTRL0);
> }
>
> /* Start internal temperature sensing. */
> - writel(0, lradc->base + LRADC_CTRL2);
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_CTRL2);
>
> return 0;
> }
> @@ -893,11 +930,10 @@ static void mxs_lradc_hw_stop(struct mxs_lradc *lradc)
> {
> int i;
>
> - writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> - lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> + mxs_lradc_reg_clear(lradc, mxs_lradc_irq_en_mask(lradc), LRADC_CTRL1);
>
> for (i = 0; i < LRADC_MAX_DELAY_CHANS; i++)
> - writel(0, lradc->base + LRADC_DELAY(i));
> + mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(i));
> }
>
> static const struct of_device_id mxs_lradc_dt_ids[] = {
>
^ permalink raw reply
* Re: [PATCH 5/9] Staging/iio/adc/touchscreen/MXS: add i.MX23 support to the LRADC touchscreen driver
From: Jonathan Cameron @ 2013-10-01 11:02 UTC (permalink / raw)
To: Juergen Beisert, linux-iio
Cc: linux-arm-kernel, devel, marex, fabio.estevam, jic23, linux-input
In-Reply-To: <1379946998-23041-6-git-send-email-jbe@pengutronix.de>
On 09/23/13 15:36, Juergen Beisert wrote:
> Distinguish i.MX23 and i.MX28 at runtime and do the same for both SoC at least
> for the 4 wire touchscreen.
>
> Note: support for the remaining LRADC channels is not tested on an
> i.MX23 yet.
>
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-input@vger.kernel.org
> CC: devel@driverdev.osuosl.org
> CC: Marek Vasut <marex@denx.de>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> CC: Jonathan Cameron <jic23@cam.ac.uk>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 66 ++++++++++++++++++++++++++++++-------
> 1 file changed, 55 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index dd47ec2..a92e810 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -191,20 +191,33 @@ struct mxs_lradc {
> # define LRADC_CTRL0_MX28_XNPSW /* XM */ (1 << 17)
> # define LRADC_CTRL0_MX28_XPPSW /* XP */ (1 << 16)
>
> +# define LRADC_CTRL0_MX23_TOUCH_DETECT_ENABLE (1 << 20)
> +# define LRADC_CTRL0_MX23_YM (1 << 19)
> +# define LRADC_CTRL0_MX23_XM (1 << 18)
> +# define LRADC_CTRL0_MX23_YP (1 << 17)
> +# define LRADC_CTRL0_MX23_XP (1 << 16)
> +
> # define LRADC_CTRL0_MX28_PLATE_MASK \
> (LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE | \
> LRADC_CTRL0_MX28_YNNSW | LRADC_CTRL0_MX28_YPNSW | \
> LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW | \
> LRADC_CTRL0_MX28_XNPSW | LRADC_CTRL0_MX28_XPPSW)
>
> +# define LRADC_CTRL0_MX23_PLATE_MASK \
> + (LRADC_CTRL0_MX23_TOUCH_DETECT_ENABLE | \
> + LRADC_CTRL0_MX23_YM | LRADC_CTRL0_MX23_XM | \
> + LRADC_CTRL0_MX23_YP | LRADC_CTRL0_MX23_XP)
> +
> #define LRADC_CTRL1 0x10
> #define LRADC_CTRL1_TOUCH_DETECT_IRQ_EN (1 << 24)
> #define LRADC_CTRL1_LRADC_IRQ_EN(n) (1 << ((n) + 16))
> #define LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK (0x1fff << 16)
> +#define LRADC_CTRL1_MX23_LRADC_IRQ_EN_MASK (0x01ff << 16)
> #define LRADC_CTRL1_LRADC_IRQ_EN_OFFSET 16
> #define LRADC_CTRL1_TOUCH_DETECT_IRQ (1 << 8)
> #define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
> #define LRADC_CTRL1_MX28_LRADC_IRQ_MASK 0x1fff
> +#define LRADC_CTRL1_MX23_LRADC_IRQ_MASK 0x01ff
> #define LRADC_CTRL1_LRADC_IRQ_OFFSET 0
>
> #define LRADC_CTRL2 0x20
> @@ -255,37 +268,58 @@ static void mxs_lradc_reg_wrt(struct mxs_lradc *lradc, u32 val, u32 reg)
>
> static u32 mxs_lradc_plate_mask(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL0_MX28_PLATE_MASK;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL0_MX23_PLATE_MASK;
> + else
> + return LRADC_CTRL0_MX28_PLATE_MASK;
> }
>
> static u32 mxs_lradc_irq_en_mask(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL1_MX23_LRADC_IRQ_EN_MASK;
> + else
> + return LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK;
> }
>
> static u32 mxs_lradc_irq_mask(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL1_MX28_LRADC_IRQ_MASK;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL1_MX23_LRADC_IRQ_MASK;
> + else
> + return LRADC_CTRL1_MX28_LRADC_IRQ_MASK;
> }
>
> static u32 mxs_lradc_touch_detect_bit(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL0_MX23_TOUCH_DETECT_ENABLE;
> + else
> + return LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE;
> }
>
> static u32 mxs_lradc_drive_x_plate(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL0_MX28_XPPSW | LRADC_CTRL0_MX28_XNNSW;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL0_MX23_XP | LRADC_CTRL0_MX23_XM;
> + else
> + return LRADC_CTRL0_MX28_XPPSW | LRADC_CTRL0_MX28_XNNSW;
> }
>
> static u32 mxs_lradc_drive_y_plate(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_YNNSW;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL0_MX23_YP | LRADC_CTRL0_MX23_YM;
> + else
> + return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_YNNSW;
> }
>
> static u32 mxs_lradc_drive_pressure(struct mxs_lradc *lradc)
> {
> - return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
> + if (lradc->soc == IMX23_LRADC)
> + return LRADC_CTRL0_MX23_YP | LRADC_CTRL0_MX23_XM;
> + else
> + return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
> }
>
> /*
> @@ -322,7 +356,8 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> * Virtual channel 0 is always used here as the others are always not
> * used if doing raw sampling.
> */
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + if (lradc->soc == IMX28_LRADC)
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> LRADC_CTRL1);
> mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
>
> @@ -770,7 +805,8 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
> if (ret < 0)
> goto err_buf;
>
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + if (lradc->soc == IMX28_LRADC)
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> LRADC_CTRL1);
> mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
>
> @@ -808,7 +844,8 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio)
> LRADC_DELAY_KICK, LRADC_DELAY(0));
>
> mxs_lradc_reg_clear(lradc, 0xff, LRADC_CTRL0);
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> + if (lradc->soc == IMX28_LRADC)
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> LRADC_CTRL1);
>
> kfree(lradc->buffer);
> @@ -912,7 +949,8 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
> mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
>
> /* Configure the touchscreen type */
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> + if (lradc->soc == IMX28_LRADC) {
> + mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> LRADC_CTRL0);
>
> if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> @@ -993,6 +1031,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> dev_warn(dev, "Unsupported number of touchscreen wires (%d)\n",
> ts_wires);
>
> + if ((lradc->soc == IMX23_LRADC) && (ts_wires == 5)) {
> + dev_warn(dev, "No support for 5 wire touches on i.MX23\n");
> + dev_warn(dev, "Falling back to 4 wire\n");
> + ts_wires = 4;
> + }
> +
> /* Grab all IRQ sources */
> for (i = 0; i < of_cfg->irq_count; i++) {
> lradc->irq[i] = platform_get_irq(pdev, i);
>
^ permalink raw reply
* Re: [PATCHv6] staging/iio/adc: change the MXS touchscreen driver implementation
From: Marek Vasut @ 2013-10-01 10:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <524A951A.5050606-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Dear Jonathan Cameron,
> I'm looking for some Tested-by: or Acks on this before applying the series.
> I got the impression from the comments on the previous version that the
> series has now been reasonably thoroughly tested on both i.MX28 and i.MX23
> boards. This is not yet reflected in the sign off trail and in fact a
> couple of the patch descriptions say that they are untested on i.MX28.
>
> Jonathan
>
Tested-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
on M28EVK
Best regards,
Marek Vasut
^ permalink raw reply
* Re: [PATCH 6/9] Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection
From: Jonathan Cameron @ 2013-10-01 10:51 UTC (permalink / raw)
To: Jürgen Beisert
Cc: devel, marex, fabio.estevam, linux-iio, Dmitry Torokhov, jic23,
linux-input, linux-arm-kernel
In-Reply-To: <201310011128.38928.jbe@pengutronix.de>
On 10/01/13 10:28, Jürgen Beisert wrote:
> Hi Jonathan,
>
> On Tuesday 01 October 2013 11:25:46 Jonathan Cameron wrote:
>> a couple of the patch descriptions say that they are untested on i.MX28.
>
> On Monday 23 September 2013 16:36:35 Juergen Beisert wrote:
>> For battery driven systems it is a very bad idea to collect the touchscreen
>> data within a kernel busy loop.
>>
>> This change uses the features of the hardware to delay and accumulate
>> samples in hardware to avoid a high interrupt and CPU load.
>>
>> Note: this is only tested on an i.MX23 SoC yet.
>
> This note is no longer true. Marek tested it on his M28EVK, Lothar on his TX28
> and myself also on an i.MX28EVK.
>
> For the IIO part of the driver I tested on my i.MX23 based ChumbyOne and some
> customer hardware and it seems still to work (I can only guess if the values I
> read from the sysfs entries are correct, sorry).
Excellent. I'll assume everyone is happy then and add some appropriate
tested-by tags. I'd missed Marek's reply saying he was fine with this.
Thanks,
Jonathan
>
> Regards,
> Juergen
>
^ permalink raw reply
* Re: [PATCH 2/9] Staging/iio/adc/touchscreen/MXS: distinguish i.MX23's and i.MX28's LRADC
From: Jonathan Cameron @ 2013-10-01 10:58 UTC (permalink / raw)
To: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-3-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On 09/23/13 15:36, Juergen Beisert wrote:
> The LRADC units in i.MX23 and i.MX28 differ and we need to distinguish both
> SoC variants in order to make the touchscreen work on i.MX23
>
> Signed-off-by: Juergen Beisert <jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> CC: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> CC: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> CC: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org
> CC: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> CC: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> CC: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Applied to the togreg branch of iio.git
Thanks
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index 00b61ac..3abc91f 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -177,6 +177,8 @@ struct mxs_lradc {
>
> struct input_dev *ts_input;
> struct work_struct ts_work;
> +
> + enum mxs_lradc_id soc;
> };
>
> #define LRADC_CTRL0 0x00
> @@ -923,6 +925,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> }
>
> lradc = iio_priv(iio);
> + lradc->soc = (enum mxs_lradc_id)of_id->data;
>
> /* Grab the memory area */
> iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>
^ permalink raw reply
* Re: [PATCH 3/9] Staging/iio/adc/touchscreen/MXS: separate i.MX28 specific register bits
From: Jonathan Cameron @ 2013-10-01 11:00 UTC (permalink / raw)
To: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-4-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On 09/23/13 15:36, Juergen Beisert wrote:
> In order to support i.MX23 and i.MX28 within one driver we need to separate the
> register definitions which differ in both SoC variants.
>
> Signed-off-by: Juergen Beisert <jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> CC: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> CC: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> CC: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org
> CC: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> CC: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> CC: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Applied to the togreg branch of iio.git
Thanks
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 61 ++++++++++++++++++++-----------------
> 1 file changed, 33 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index 3abc91f..f2fb10a 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -182,24 +182,29 @@ struct mxs_lradc {
> };
>
> #define LRADC_CTRL0 0x00
> -#define LRADC_CTRL0_TOUCH_DETECT_ENABLE (1 << 23)
> -#define LRADC_CTRL0_TOUCH_SCREEN_TYPE (1 << 22)
> -#define LRADC_CTRL0_YNNSW /* YM */ (1 << 21)
> -#define LRADC_CTRL0_YPNSW /* YP */ (1 << 20)
> -#define LRADC_CTRL0_YPPSW /* YP */ (1 << 19)
> -#define LRADC_CTRL0_XNNSW /* XM */ (1 << 18)
> -#define LRADC_CTRL0_XNPSW /* XM */ (1 << 17)
> -#define LRADC_CTRL0_XPPSW /* XP */ (1 << 16)
> -#define LRADC_CTRL0_PLATE_MASK (0x3f << 16)
> +# define LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE (1 << 23)
> +# define LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE (1 << 22)
> +# define LRADC_CTRL0_MX28_YNNSW /* YM */ (1 << 21)
> +# define LRADC_CTRL0_MX28_YPNSW /* YP */ (1 << 20)
> +# define LRADC_CTRL0_MX28_YPPSW /* YP */ (1 << 19)
> +# define LRADC_CTRL0_MX28_XNNSW /* XM */ (1 << 18)
> +# define LRADC_CTRL0_MX28_XNPSW /* XM */ (1 << 17)
> +# define LRADC_CTRL0_MX28_XPPSW /* XP */ (1 << 16)
> +
> +# define LRADC_CTRL0_MX28_PLATE_MASK \
> + (LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE | \
> + LRADC_CTRL0_MX28_YNNSW | LRADC_CTRL0_MX28_YPNSW | \
> + LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW | \
> + LRADC_CTRL0_MX28_XNPSW | LRADC_CTRL0_MX28_XPPSW)
>
> #define LRADC_CTRL1 0x10
> #define LRADC_CTRL1_TOUCH_DETECT_IRQ_EN (1 << 24)
> #define LRADC_CTRL1_LRADC_IRQ_EN(n) (1 << ((n) + 16))
> -#define LRADC_CTRL1_LRADC_IRQ_EN_MASK (0x1fff << 16)
> +#define LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK (0x1fff << 16)
> #define LRADC_CTRL1_LRADC_IRQ_EN_OFFSET 16
> #define LRADC_CTRL1_TOUCH_DETECT_IRQ (1 << 8)
> #define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
> -#define LRADC_CTRL1_LRADC_IRQ_MASK 0x1fff
> +#define LRADC_CTRL1_MX28_LRADC_IRQ_MASK 0x1fff
> #define LRADC_CTRL1_LRADC_IRQ_OFFSET 0
>
> #define LRADC_CTRL2 0x20
> @@ -267,7 +272,7 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> * Virtual channel 0 is always used here as the others are always not
> * used if doing raw sampling.
> */
> - writel(LRADC_CTRL1_LRADC_IRQ_EN_MASK,
> + writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>
> @@ -322,9 +327,9 @@ static int mxs_lradc_ts_touched(struct mxs_lradc *lradc)
> uint32_t reg;
>
> /* Enable touch detection. */
> - writel(LRADC_CTRL0_PLATE_MASK,
> + writel(LRADC_CTRL0_MX28_PLATE_MASK,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> - writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
> + writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>
> msleep(LRADC_TS_SAMPLE_DELAY_MS);
> @@ -370,21 +375,21 @@ static int32_t mxs_lradc_ts_sample(struct mxs_lradc *lradc,
> */
> switch (plate) {
> case LRADC_SAMPLE_X:
> - ctrl0 = LRADC_CTRL0_XPPSW | LRADC_CTRL0_XNNSW;
> + ctrl0 = LRADC_CTRL0_MX28_XPPSW | LRADC_CTRL0_MX28_XNNSW;
> chan = 3;
> break;
> case LRADC_SAMPLE_Y:
> - ctrl0 = LRADC_CTRL0_YPPSW | LRADC_CTRL0_YNNSW;
> + ctrl0 = LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_YNNSW;
> chan = 4;
> break;
> case LRADC_SAMPLE_PRESSURE:
> - ctrl0 = LRADC_CTRL0_YPPSW | LRADC_CTRL0_XNNSW;
> + ctrl0 = LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
> chan = 5;
> break;
> }
>
> if (change) {
> - writel(LRADC_CTRL0_PLATE_MASK,
> + writel(LRADC_CTRL0_MX28_PLATE_MASK,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> writel(ctrl0, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>
> @@ -445,7 +450,7 @@ static void mxs_lradc_ts_work(struct work_struct *ts_work)
>
> while (mxs_lradc_ts_touched(lradc)) {
> /* Disable touch detector so we can sample the touchscreen. */
> - writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
> + writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>
> if (likely(valid)) {
> @@ -494,7 +499,7 @@ static int mxs_lradc_ts_open(struct input_dev *dev)
> lradc->stop_touchscreen = false;
>
> /* Enable the touch-detect circuitry. */
> - writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
> + writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
>
> /* Enable the touch-detect IRQ. */
> @@ -520,7 +525,7 @@ static void mxs_lradc_ts_close(struct input_dev *dev)
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>
> /* Power-down touchscreen touch-detect circuitry. */
> - writel(LRADC_CTRL0_TOUCH_DETECT_ENABLE,
> + writel(LRADC_CTRL0_MX28_TOUCH_DETECT_ENABLE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> }
>
> @@ -584,7 +589,7 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
> LRADC_CTRL1_TOUCH_DETECT_IRQ_EN |
> LRADC_CTRL1_TOUCH_DETECT_IRQ;
>
> - if (!(reg & LRADC_CTRL1_LRADC_IRQ_MASK))
> + if (!(reg & LRADC_CTRL1_MX28_LRADC_IRQ_MASK))
> return IRQ_NONE;
>
> /*
> @@ -604,7 +609,7 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data)
> else if (reg & LRADC_CTRL1_LRADC_IRQ(0))
> complete(&lradc->completion);
>
> - writel(reg & LRADC_CTRL1_LRADC_IRQ_MASK,
> + writel(reg & LRADC_CTRL1_MX28_LRADC_IRQ_MASK,
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>
> return IRQ_HANDLED;
> @@ -725,7 +730,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
> if (ret < 0)
> goto err_buf;
>
> - writel(LRADC_CTRL1_LRADC_IRQ_EN_MASK,
> + writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
> writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>
> @@ -766,7 +771,7 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio)
> lradc->base + LRADC_DELAY(0) + STMP_OFFSET_REG_CLR);
>
> writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
> - writel(LRADC_CTRL1_LRADC_IRQ_EN_MASK,
> + writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>
> kfree(lradc->buffer);
> @@ -870,11 +875,11 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
> writel(0, lradc->base + LRADC_DELAY(3));
>
> /* Configure the touchscreen type */
> - writel(LRADC_CTRL0_TOUCH_SCREEN_TYPE,
> + writel(LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
>
> if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE) {
> - writel(LRADC_CTRL0_TOUCH_SCREEN_TYPE,
> + writel(LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
> }
>
> @@ -888,7 +893,7 @@ static void mxs_lradc_hw_stop(struct mxs_lradc *lradc)
> {
> int i;
>
> - writel(LRADC_CTRL1_LRADC_IRQ_EN_MASK,
> + writel(LRADC_CTRL1_MX28_LRADC_IRQ_EN_MASK,
> lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
>
> for (i = 0; i < LRADC_MAX_DELAY_CHANS; i++)
>
^ permalink raw reply
* Re: [PATCH 6/9] Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection
From: Jonathan Cameron @ 2013-10-01 11:06 UTC (permalink / raw)
To: Jürgen Beisert
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg, Dmitry Torokhov,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <524AA91F.7000906-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On 10/01/13 11:51, Jonathan Cameron wrote:
> On 10/01/13 10:28, Jürgen Beisert wrote:
>> Hi Jonathan,
>>
>> On Tuesday 01 October 2013 11:25:46 Jonathan Cameron wrote:
>>> a couple of the patch descriptions say that they are untested on i.MX28.
>>
>> On Monday 23 September 2013 16:36:35 Juergen Beisert wrote:
>>> For battery driven systems it is a very bad idea to collect the touchscreen
>>> data within a kernel busy loop.
>>>
>>> This change uses the features of the hardware to delay and accumulate
>>> samples in hardware to avoid a high interrupt and CPU load.
>>>
>>> Note: this is only tested on an i.MX23 SoC yet.
>>
>> This note is no longer true. Marek tested it on his M28EVK, Lothar on his TX28
>> and myself also on an i.MX28EVK.
>>
>> For the IIO part of the driver I tested on my i.MX23 based ChumbyOne and some
>> customer hardware and it seems still to work (I can only guess if the values I
>> read from the sysfs entries are correct, sorry).
>
> Excellent. I'll assume everyone is happy then and add some appropriate
> tested-by tags. I'd missed Marek's reply saying he was fine with this.
This one is not applying cleanly. I've merged what I think is the right
fixup, but please check.
The issue is around the error handling after mxs_lradc_ts_register which has
been changed in the meantime it seems.
Jonathan
>
>
> Thanks,
>
> Jonathan
>>
>> Regards,
>> Juergen
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH 7/9] Staging/iio/adc/touchscreen/MXS: remove old touchscreen detection implementation
From: Jonathan Cameron @ 2013-10-01 11:13 UTC (permalink / raw)
To: Juergen Beisert, linux-iio
Cc: devel, marex, fabio.estevam, jic23, linux-input, linux-arm-kernel
In-Reply-To: <1379946998-23041-8-git-send-email-jbe@pengutronix.de>
On 09/23/13 15:36, Juergen Beisert wrote:
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> CC: linux-arm-kernel@lists.infradead.org
> CC: linux-input@vger.kernel.org
> CC: devel@driverdev.osuosl.org
> CC: Marek Vasut <marex@denx.de>
> CC: Fabio Estevam <fabio.estevam@freescale.com>
> CC: Jonathan Cameron <jic23@cam.ac.uk>
Applied to the togreg branch of iio.git
Thanks,
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 163 ------------------------------------
> 1 file changed, 163 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index 76a900d..aa1f337 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -186,7 +186,6 @@ struct mxs_lradc {
> bool use_touchbutton;
>
> struct input_dev *ts_input;
> - struct work_struct ts_work;
>
> enum mxs_lradc_id soc;
> enum lradc_ts_plate cur_plate; /* statemachine */
> @@ -830,168 +829,6 @@ static const struct iio_info mxs_lradc_iio_info = {
> .read_raw = mxs_lradc_read_raw,
> };
>
> -static int mxs_lradc_ts_touched(struct mxs_lradc *lradc)
> -{
> - uint32_t reg;
> -
> - /* Enable touch detection. */
> - mxs_lradc_reg_clear(lradc, mxs_lradc_plate_mask(lradc), LRADC_CTRL0);
> - mxs_lradc_reg_set(lradc, mxs_lradc_touch_detect_bit(lradc),
> - LRADC_CTRL0);
> -
> - msleep(LRADC_TS_SAMPLE_DELAY_MS);
> -
> - reg = readl(lradc->base + LRADC_STATUS);
> -
> - return reg & LRADC_STATUS_TOUCH_DETECT_RAW;
> -}
> -
> -static int32_t mxs_lradc_ts_sample(struct mxs_lradc *lradc,
> - enum lradc_ts_plate plate, int change)
> -{
> - unsigned long delay, jiff;
> - uint32_t reg, ctrl0 = 0, chan = 0;
> - /* The touchscreen always uses CTRL4 slot #7. */
> - const uint8_t slot = 7;
> - uint32_t val;
> -
> - /*
> - * There are three correct configurations of the controller sampling
> - * the touchscreen, each of these configuration provides different
> - * information from the touchscreen.
> - *
> - * The following table describes the sampling configurations:
> - * +-------------+-------+-------+-------+
> - * | Wire \ Axis | X | Y | Z |
> - * +---------------------+-------+-------+
> - * | X+ (CH2) | HI | TS | TS |
> - * +-------------+-------+-------+-------+
> - * | X- (CH4) | LO | SH | HI |
> - * +-------------+-------+-------+-------+
> - * | Y+ (CH3) | SH | HI | HI |
> - * +-------------+-------+-------+-------+
> - * | Y- (CH5) | TS | LO | SH |
> - * +-------------+-------+-------+-------+
> - *
> - * HI ... strong '1' ; LO ... strong '0'
> - * SH ... sample here ; TS ... tri-state
> - *
> - * There are a few other ways of obtaining the Z coordinate
> - * (aka. pressure), but the one in the table seems to be the
> - * most reliable one.
> - */
> - switch (plate) {
> - case LRADC_SAMPLE_X:
> - ctrl0 = mxs_lradc_drive_x_plate(lradc);
> - chan = 3;
> - break;
> - case LRADC_SAMPLE_Y:
> - ctrl0 = mxs_lradc_drive_y_plate(lradc);
> - chan = 4;
> - break;
> - case LRADC_SAMPLE_PRESSURE:
> - ctrl0 = mxs_lradc_drive_pressure(lradc);
> - chan = 5;
> - break;
> - }
> -
> - if (change) {
> - mxs_lradc_reg_clear(lradc, mxs_lradc_plate_mask(lradc),
> - LRADC_CTRL0);
> - mxs_lradc_reg_set(lradc, ctrl0, LRADC_CTRL0);
> -
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(slot),
> - LRADC_CTRL4);
> - mxs_lradc_reg_set(lradc,
> - chan << LRADC_CTRL4_LRADCSELECT_OFFSET(slot),
> - LRADC_CTRL4);
> - }
> -
> - mxs_lradc_reg_clear(lradc, 0xffffffff, LRADC_CH(slot));
> - mxs_lradc_reg_set(lradc, 1 << slot, LRADC_CTRL0);
> -
> - delay = jiffies + msecs_to_jiffies(LRADC_TS_SAMPLE_DELAY_MS);
> - do {
> - jiff = jiffies;
> - reg = readl_relaxed(lradc->base + LRADC_CTRL1);
> - if (reg & LRADC_CTRL1_LRADC_IRQ(slot))
> - break;
> - } while (time_before(jiff, delay));
> -
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ(slot), LRADC_CTRL1);
> -
> - if (time_after_eq(jiff, delay))
> - return -ETIMEDOUT;
> -
> - val = readl(lradc->base + LRADC_CH(slot));
> - val &= LRADC_CH_VALUE_MASK;
> -
> - return val;
> -}
> -
> -static int32_t mxs_lradc_ts_sample_filter(struct mxs_lradc *lradc,
> - enum lradc_ts_plate plate)
> -{
> - int32_t val, tot = 0;
> - int i;
> -
> - val = mxs_lradc_ts_sample(lradc, plate, 1);
> -
> - /* Delay a bit so the touchscreen is stable. */
> - mdelay(2);
> -
> - for (i = 0; i < LRADC_TS_SAMPLE_AMOUNT; i++) {
> - val = mxs_lradc_ts_sample(lradc, plate, 0);
> - tot += val;
> - }
> -
> - return tot / LRADC_TS_SAMPLE_AMOUNT;
> -}
> -
> -static void mxs_lradc_ts_work(struct work_struct *ts_work)
> -{
> - struct mxs_lradc *lradc = container_of(ts_work,
> - struct mxs_lradc, ts_work);
> - int val_x, val_y, val_p;
> - bool valid = false;
> -
> - while (mxs_lradc_ts_touched(lradc)) {
> - /* Disable touch detector so we can sample the touchscreen. */
> - mxs_lradc_reg_clear(lradc, mxs_lradc_touch_detect_bit(lradc),
> - LRADC_CTRL0);
> -
> - if (likely(valid)) {
> - input_report_abs(lradc->ts_input, ABS_X, val_x);
> - input_report_abs(lradc->ts_input, ABS_Y, val_y);
> - input_report_abs(lradc->ts_input, ABS_PRESSURE, val_p);
> - input_report_key(lradc->ts_input, BTN_TOUCH, 1);
> - input_sync(lradc->ts_input);
> - }
> -
> - valid = false;
> -
> - val_x = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_X);
> - if (val_x < 0)
> - continue;
> - val_y = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_Y);
> - if (val_y < 0)
> - continue;
> - val_p = mxs_lradc_ts_sample_filter(lradc, LRADC_SAMPLE_PRESSURE);
> - if (val_p < 0)
> - continue;
> -
> - valid = true;
> - }
> -
> - input_report_abs(lradc->ts_input, ABS_PRESSURE, 0);
> - input_report_key(lradc->ts_input, BTN_TOUCH, 0);
> - input_sync(lradc->ts_input);
> -
> - /* Restart the touchscreen interrupts. */
> - mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, LRADC_CTRL1);
> - mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1);
> -}
> -
> static int mxs_lradc_ts_open(struct input_dev *dev)
> {
> struct mxs_lradc *lradc = input_get_drvdata(dev);
>
^ permalink raw reply
* Re: [PATCH 8/9] Staging/iio/adc/touchscreen/MXS: provide devicetree adaption
From: Jonathan Cameron @ 2013-10-01 11:14 UTC (permalink / raw)
To: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-9-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On 09/23/13 15:36, Juergen Beisert wrote:
> This is an RFC for the new touchscreen properties.
>
> Signed-off-by: Juergen Beisert <jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> CC: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> CC: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> CC: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org
> CC: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> CC: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> CC: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
> CC: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Applied to the togreg branch of iio.git
Thanks,
> ---
> .../bindings/staging/iio/adc/mxs-lradc.txt | 36 ++++++++++++--
> arch/arm/boot/dts/imx28-evk.dts | 4 ++
> drivers/staging/iio/adc/mxs-lradc.c | 57 ++++++++++++++--------
> 3 files changed, 71 insertions(+), 26 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> index 4688205..ee05dc3 100644
> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> @@ -1,7 +1,8 @@
> * Freescale i.MX28 LRADC device driver
>
> Required properties:
> -- compatible: Should be "fsl,imx28-lradc"
> +- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and "fsl,imx28-lradc"
> + for i.MX28 SoC
> - reg: Address and length of the register set for the device
> - interrupts: Should contain the LRADC interrupts
>
> @@ -9,13 +10,38 @@ Optional properties:
> - fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
> to LRADC. Valid value is either 4 or 5. If this
> property is not present, then the touchscreen is
> - disabled.
> + disabled. 5 wires is valid for i.MX28 SoC only.
> +- fsl,ave-ctrl: number of samples per direction to calculate an average value.
> + Allowed value is 1 ... 31, default is 4
> +- fsl,ave-delay: delay between consecutive samples. Allowed value is
> + 1 ... 2047. It is used if 'fsl,ave-ctrl' > 1, counts at
> + 2 kHz and its default is 2 (= 1 ms)
> +- fsl,settling: delay between plate switch to next sample. Allowed value is
> + 1 ... 2047. It counts at 2 kHz and its default is
> + 10 (= 5 ms)
>
> -Examples:
> +Example for i.MX23 SoC:
> +
> + lradc@80050000 {
> + compatible = "fsl,imx23-lradc";
> + reg = <0x80050000 0x2000>;
> + interrupts = <36 37 38 39 40 41 42 43 44>;
> + status = "okay";
> + fsl,lradc-touchscreen-wires = <4>;
> + fsl,ave-ctrl = <4>;
> + fsl,ave-delay = <2>;
> + fsl,settling = <10>;
> + };
> +
> +Example for i.MX28 SoC:
>
> lradc@80050000 {
> compatible = "fsl,imx28-lradc";
> reg = <0x80050000 0x2000>;
> - interrupts = <10 14 15 16 17 18 19
> - 20 21 22 23 24 25>;
> + interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
> + status = "okay";
> + fsl,lradc-touchscreen-wires = <5>;
> + fsl,ave-ctrl = <4>;
> + fsl,ave-delay = <2>;
> + fsl,settling = <10>;
> };
> diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
> index 15715d9..aa33393 100644
> --- a/arch/arm/boot/dts/imx28-evk.dts
> +++ b/arch/arm/boot/dts/imx28-evk.dts
> @@ -183,6 +183,10 @@
>
> lradc@80050000 {
> status = "okay";
> + fsl,lradc-touchscreen-wires = <4>;
> + fsl,ave-ctrl = <4>;
> + fsl,ave-delay = <2>;
> + fsl,settling = <10>;
> };
>
> i2c0: i2c@80058000 {
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index aa1f337..dbc0af6 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -1230,10 +1230,45 @@ MODULE_DEVICE_TABLE(of, mxs_lradc_dt_ids);
> static int mxs_lradc_probe_touchscreen(struct mxs_lradc *lradc,
> struct device_node *lradc_node)
> {
> - /* TODO retrieve from device tree */
> + int ret;
> + u32 ts_wires = 0, adapt;
> +
> + ret = of_property_read_u32(lradc_node, "fsl,lradc-touchscreen-wires",
> + &ts_wires);
> + if (ret)
> + return -ENODEV; /* touchscreen feature disabled */
> +
> + switch (ts_wires) {
> + case 4:
> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_4WIRE;
> + break;
> + case 5:
> + if (lradc->soc == IMX28_LRADC) {
> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_5WIRE;
> + break;
> + }
> + /* fall through an error message for i.MX23 */
> + default:
> + dev_err(lradc->dev,
> + "Unsupported number of touchscreen wires (%d)\n",
> + ts_wires);
> + return -EINVAL;
> + }
> +
> lradc->over_sample_cnt = 4;
> + ret = of_property_read_u32(lradc_node, "fsl,ave-ctrl", &adapt);
> + if (ret == 0)
> + lradc->over_sample_cnt = adapt;
> +
> lradc->over_sample_delay = 2;
> + ret = of_property_read_u32(lradc_node, "fsl,ave-delay", &adapt);
> + if (ret == 0)
> + lradc->over_sample_delay = adapt;
> +
> lradc->settling_delay = 10;
> + ret = of_property_read_u32(lradc_node, "fsl,settling", &adapt);
> + if (ret == 0)
> + lradc->settling_delay = adapt;
>
> return 0;
> }
> @@ -1249,7 +1284,6 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> struct mxs_lradc *lradc;
> struct iio_dev *iio;
> struct resource *iores;
> - uint32_t ts_wires = 0;
> int ret = 0, touch_ret;
> int i;
>
> @@ -1275,25 +1309,6 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>
> touch_ret = mxs_lradc_probe_touchscreen(lradc, node);
>
> - /* Check if touchscreen is enabled in DT. */
> - ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
> - &ts_wires);
> - if (ret)
> - dev_info(dev, "Touchscreen not enabled.\n");
> - else if (ts_wires == 4)
> - lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_4WIRE;
> - else if (ts_wires == 5)
> - lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_5WIRE;
> - else
> - dev_warn(dev, "Unsupported number of touchscreen wires (%d)\n",
> - ts_wires);
> -
> - if ((lradc->soc == IMX23_LRADC) && (ts_wires == 5)) {
> - dev_warn(dev, "No support for 5 wire touches on i.MX23\n");
> - dev_warn(dev, "Falling back to 4 wire\n");
> - ts_wires = 4;
> - }
> -
> /* Grab all IRQ sources */
> for (i = 0; i < of_cfg->irq_count; i++) {
> lradc->irq[i] = platform_get_irq(pdev, i);
>
^ permalink raw reply
* Re: [PATCH 9/9] Staging/iio: add TODO reminder
From: Jonathan Cameron @ 2013-10-01 11:14 UTC (permalink / raw)
To: Juergen Beisert, linux-iio-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, marex-ynQEQJNshbs,
fabio.estevam-KZfg59tc24xl57MIdRCFDg,
jic23-KWPb1pKIrIJaa/9Udqfwiw, linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379946998-23041-10-git-send-email-jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On 09/23/13 15:36, Juergen Beisert wrote:
> Some things have still to be done to the LRADC driver.
>
> Signed-off-by: Juergen Beisert <jbe-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> CC: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> CC: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> CC: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org
> CC: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> CC: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> CC: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Applied to the togreg branch of iio.git
Thanks.
Please check over the entire series as it was more than a little
fiddly to apply and I may well have messed it up!
Jonathan
> ---
> drivers/staging/iio/TODO | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/staging/iio/TODO b/drivers/staging/iio/TODO
> index 04c2326..c22a0ed 100644
> --- a/drivers/staging/iio/TODO
> +++ b/drivers/staging/iio/TODO
> @@ -13,6 +13,17 @@ Would be nice
> 3) Expand device set. Lots of other maxim adc's have very
> similar interfaces.
>
> +MXS LRADC driver:
> +This is a classic MFD device as it combines the following subdevices
> + - touchscreen controller (input subsystem related device)
> + - general purpose ADC channels
> + - battery voltage monitor (power subsystem related device)
> + - die temperature monitor (thermal management)
> +
> +At least the battery voltage and die temperature feature is required in-kernel
> +by a driver of the SoC's battery charging unit to avoid any damage to the
> +silicon and the battery.
> +
> TSL2561
> Would be nice
> 1) Open question of userspace vs kernel space balance when
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox