* Re: [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency [not found] ` <1461135285-17582-3-git-send-email-dirk.behme@de.bosch.com> @ 2016-04-25 21:11 ` Dmitry Torokhov 2016-04-27 13:32 ` fixed-term.Oleksij.Rempel 2016-04-27 14:44 ` Rob Herring 0 siblings, 2 replies; 5+ messages in thread From: Dmitry Torokhov @ 2016-04-25 21:11 UTC (permalink / raw) To: Dirk Behme Cc: linux-input, Henrik Rydberg, Javier Martinez Canillas, Knut Wohlrab, Oleksij Rempel, Rob Herring, devicetree Adding devicetree overlords... On Wed, Apr 20, 2016 at 08:54:43AM +0200, Dirk Behme wrote: > From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> > > Add device tree support for idle and finger scanning frequency. > > Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> > Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> > Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> > --- > .../devicetree/bindings/input/touchscreen/zforce_ts.txt | 4 ++++ > drivers/input/touchscreen/zforce_ts.c | 15 ++++++++++++++- > include/linux/platform_data/zforce_ts.h | 2 ++ > 3 files changed, 20 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > index e3c27c4..09ead84 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > @@ -11,6 +11,8 @@ Required properties: > Optional properties: > - irq-gpios : interrupt gpio the chip is connected to > - vdd-supply: Regulator controlling the controller supply > +- scan-freq-idle: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz) > +- scan-freq-finger: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz) Should we cal it scan-freq-active instead? > > Example: > > @@ -28,6 +30,8 @@ Example: > > x-size = <800>; > y-size = <600>; > + scan-freq-idle = <50>; > + scan-freq-finger = <250>; > }; > > /* ... */ > diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c > index ddfc120..51fe2de 100644 > --- a/drivers/input/touchscreen/zforce_ts.c > +++ b/drivers/input/touchscreen/zforce_ts.c > @@ -87,6 +87,9 @@ > > #define SETCONFIG_DUALTOUCH (1 << 0) > > +#define SCAN_FREQ_DEFAULT_IDLE 10 > +#define SCAN_FREQ_DEFAULT_FINGER 50 > + > struct zforce_point { > int coord_x; > int coord_y; > @@ -304,7 +307,9 @@ static int zforce_start(struct zforce_ts *ts) > goto error; > } > > - ret = zforce_scan_frequency(ts, 10, 50, 50); > + ret = zforce_scan_frequency(ts, pdata->scan_freq_idle, > + pdata->scan_freq_finger, > + pdata->scan_freq_finger); > if (ret) { > dev_err(&client->dev, "Unable to set scan frequency, %d\n", > ret); > @@ -839,6 +844,14 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev) > return ERR_PTR(-EINVAL); > } > > + if (of_property_read_u16(np, "scan-freq-idle", > + &pdata->scan_freq_idle)) > + pdata->scan_freq_idle = SCAN_FREQ_DEFAULT_IDLE; > + > + if (of_property_read_u16(np, "scan-freq-finger", > + &pdata->scan_freq_finger)) > + pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER; > + > return pdata; > } > > diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h > index 7bdece8..90a1181 100644 > --- a/include/linux/platform_data/zforce_ts.h > +++ b/include/linux/platform_data/zforce_ts.h > @@ -18,6 +18,8 @@ > struct zforce_ts_platdata { > unsigned int x_max; > unsigned int y_max; > + u16 scan_freq_idle; > + u16 scan_freq_finger; > }; > > #endif /* _LINUX_INPUT_ZFORCE_TS_H */ > -- > 2.8.0 > -- Dmitry ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency 2016-04-25 21:11 ` [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency Dmitry Torokhov @ 2016-04-27 13:32 ` fixed-term.Oleksij.Rempel 2016-04-27 14:44 ` Rob Herring 1 sibling, 0 replies; 5+ messages in thread From: fixed-term.Oleksij.Rempel @ 2016-04-27 13:32 UTC (permalink / raw) To: Dmitry Torokhov, Dirk Behme Cc: linux-input, Henrik Rydberg, Javier Martinez Canillas, Knut Wohlrab, Oleksij Rempel, Rob Herring, devicetree On 25.04.2016 23:11, Dmitry Torokhov wrote: > Adding devicetree overlords... > > On Wed, Apr 20, 2016 at 08:54:43AM +0200, Dirk Behme wrote: >> From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >> >> Add device tree support for idle and finger scanning frequency. >> >> Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> >> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> >> --- >> .../devicetree/bindings/input/touchscreen/zforce_ts.txt | 4 ++++ >> drivers/input/touchscreen/zforce_ts.c | 15 ++++++++++++++- >> include/linux/platform_data/zforce_ts.h | 2 ++ >> 3 files changed, 20 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> index e3c27c4..09ead84 100644 >> --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> @@ -11,6 +11,8 @@ Required properties: >> Optional properties: >> - irq-gpios : interrupt gpio the chip is connected to >> - vdd-supply: Regulator controlling the controller supply >> +- scan-freq-idle: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz) >> +- scan-freq-finger: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz) > > Should we cal it scan-freq-active instead? No, the name of this property was choice according device documentation: According to which we have: Command: SetScanningFrequency Field: Idle Frequency >> >> Example: >> >> @@ -28,6 +30,8 @@ Example: >> >> x-size = <800>; >> y-size = <600>; >> + scan-freq-idle = <50>; >> + scan-freq-finger = <250>; >> }; >> >> /* ... */ >> diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c >> index ddfc120..51fe2de 100644 >> --- a/drivers/input/touchscreen/zforce_ts.c >> +++ b/drivers/input/touchscreen/zforce_ts.c >> @@ -87,6 +87,9 @@ >> >> #define SETCONFIG_DUALTOUCH (1 << 0) >> >> +#define SCAN_FREQ_DEFAULT_IDLE 10 >> +#define SCAN_FREQ_DEFAULT_FINGER 50 >> + >> struct zforce_point { >> int coord_x; >> int coord_y; >> @@ -304,7 +307,9 @@ static int zforce_start(struct zforce_ts *ts) >> goto error; >> } >> >> - ret = zforce_scan_frequency(ts, 10, 50, 50); >> + ret = zforce_scan_frequency(ts, pdata->scan_freq_idle, >> + pdata->scan_freq_finger, >> + pdata->scan_freq_finger); >> if (ret) { >> dev_err(&client->dev, "Unable to set scan frequency, %d\n", >> ret); >> @@ -839,6 +844,14 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev) >> return ERR_PTR(-EINVAL); >> } >> >> + if (of_property_read_u16(np, "scan-freq-idle", >> + &pdata->scan_freq_idle)) >> + pdata->scan_freq_idle = SCAN_FREQ_DEFAULT_IDLE; >> + >> + if (of_property_read_u16(np, "scan-freq-finger", >> + &pdata->scan_freq_finger)) >> + pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER; >> + >> return pdata; >> } >> >> diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h >> index 7bdece8..90a1181 100644 >> --- a/include/linux/platform_data/zforce_ts.h >> +++ b/include/linux/platform_data/zforce_ts.h >> @@ -18,6 +18,8 @@ >> struct zforce_ts_platdata { >> unsigned int x_max; >> unsigned int y_max; >> + u16 scan_freq_idle; >> + u16 scan_freq_finger; >> }; >> >> #endif /* _LINUX_INPUT_ZFORCE_TS_H */ >> -- >> 2.8.0 >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency 2016-04-25 21:11 ` [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency Dmitry Torokhov 2016-04-27 13:32 ` fixed-term.Oleksij.Rempel @ 2016-04-27 14:44 ` Rob Herring 2016-04-28 7:11 ` fixed-term.Oleksij.Rempel 1 sibling, 1 reply; 5+ messages in thread From: Rob Herring @ 2016-04-27 14:44 UTC (permalink / raw) To: Dmitry Torokhov Cc: Dirk Behme, linux-input@vger.kernel.org, Henrik Rydberg, Javier Martinez Canillas, Knut Wohlrab, Oleksij Rempel, devicetree@vger.kernel.org On Mon, Apr 25, 2016 at 4:11 PM, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > Adding devicetree overlords... > > On Wed, Apr 20, 2016 at 08:54:43AM +0200, Dirk Behme wrote: >> From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >> >> Add device tree support for idle and finger scanning frequency. >> >> Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> >> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> >> --- >> .../devicetree/bindings/input/touchscreen/zforce_ts.txt | 4 ++++ >> drivers/input/touchscreen/zforce_ts.c | 15 ++++++++++++++- >> include/linux/platform_data/zforce_ts.h | 2 ++ >> 3 files changed, 20 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> index e3c27c4..09ead84 100644 >> --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >> @@ -11,6 +11,8 @@ Required properties: >> Optional properties: >> - irq-gpios : interrupt gpio the chip is connected to BTW, this should really be an "interrupts" property >> - vdd-supply: Regulator controlling the controller supply >> +- scan-freq-idle: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz) >> +- scan-freq-finger: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz) I use my toes for touchscreens. Can you really scan at 65kHz? a typo here as well. > Should we cal it scan-freq-active instead? Don't we have a standard property for this? These should really have -hz appended. So scan-idle-hz and scan-active-hz, but at least the active case should be common IMO. Idle scan seems a bit unusual unless you don't have an interrupt. Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency 2016-04-27 14:44 ` Rob Herring @ 2016-04-28 7:11 ` fixed-term.Oleksij.Rempel 0 siblings, 0 replies; 5+ messages in thread From: fixed-term.Oleksij.Rempel @ 2016-04-28 7:11 UTC (permalink / raw) To: Rob Herring, Dmitry Torokhov Cc: Dirk Behme, linux-input@vger.kernel.org, Henrik Rydberg, Javier Martinez Canillas, Knut Wohlrab, Oleksij Rempel, devicetree@vger.kernel.org Hi On 27.04.2016 16:44, Rob Herring wrote: > On Mon, Apr 25, 2016 at 4:11 PM, Dmitry Torokhov > <dmitry.torokhov@gmail.com> wrote: >> Adding devicetree overlords... >> >> On Wed, Apr 20, 2016 at 08:54:43AM +0200, Dirk Behme wrote: >>> From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >>> >>> Add device tree support for idle and finger scanning frequency. >>> >>> Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> >>> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> >>> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> >>> --- >>> .../devicetree/bindings/input/touchscreen/zforce_ts.txt | 4 ++++ >>> drivers/input/touchscreen/zforce_ts.c | 15 ++++++++++++++- >>> include/linux/platform_data/zforce_ts.h | 2 ++ >>> 3 files changed, 20 insertions(+), 1 deletion(-) >>> >>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >>> index e3c27c4..09ead84 100644 >>> --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >>> +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt >>> @@ -11,6 +11,8 @@ Required properties: >>> Optional properties: >>> - irq-gpios : interrupt gpio the chip is connected to > > BTW, this should really be an "interrupts" property this pin is used for polling and needed to reduce interrupt load any latency. Are there a way to get gpio descriptor from interrupts? Any way, it is out of scope of this patch. > >>> - vdd-supply: Regulator controlling the controller supply >>> +- scan-freq-idle: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz) >>> +- scan-freq-finger: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz) > > I use my toes for touchscreens. Same as before - "Finger Frequency" is used in the documentation. What exactly are you using for touchscreens is personal decision :) My point is to be as clase as possible to docs, so other people can find it. > > Can you really scan at 65kHz? No idea what kind of voodoo is done insight of firmware for this device. This values will be send to the firmware and it will make some kind of wrong or good decisions. Would you accept this names? scan-idle-hz scan-finger-hz (can be interpreted as scan-toes-hz if you like :) ) or instead of this should i use scan-active-hz? > a typo here as well. ok, thank you > >> Should we cal it scan-freq-active instead? > > Don't we have a standard property for this? These should really have > -hz appended. So scan-idle-hz and scan-active-hz, but at least the > active case should be common IMO. Idle scan seems a bit unusual unless > you don't have an interrupt. > > Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1461135285-17582-4-git-send-email-dirk.behme@de.bosch.com>]
* Re: [PATCH 4/5] Input: zforce_ts: Add support for minimum touch size limit [not found] ` <1461135285-17582-4-git-send-email-dirk.behme@de.bosch.com> @ 2016-04-25 21:12 ` Dmitry Torokhov 0 siblings, 0 replies; 5+ messages in thread From: Dmitry Torokhov @ 2016-04-25 21:12 UTC (permalink / raw) To: Dirk Behme Cc: linux-input, Henrik Rydberg, Javier Martinez Canillas, Knut Wohlrab, Oleksij Rempel, Rob Herring, devicetree Adding devicetree folks... On Wed, Apr 20, 2016 at 08:54:44AM +0200, Dirk Behme wrote: > From: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> > > The minimum touch size can be set to support more reliable touch > detection under difficult conditions (e.g. dust on touch panel surface). > > Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> > Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> > Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> > --- > .../bindings/input/touchscreen/zforce_ts.txt | 2 ++ > drivers/input/touchscreen/zforce_ts.c | 29 ++++++++++++++++++++++ > include/linux/platform_data/zforce_ts.h | 1 + > 3 files changed, 32 insertions(+) > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > index 09ead84..2c5babd 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > +++ b/Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt > @@ -13,6 +13,7 @@ Optional properties: > - vdd-supply: Regulator controlling the controller supply > - scan-freq-idle: idle scanning frequency in Hz (0 - 65535 Hz; default 10 Hz) > - scan-freq-finger: touch scanning frequeny in Hz (0 - 65535 Hz; default 50 Hz) > +- touch-size-min: minimun touch size limit in mm (0 - 255 mm; 0 = no limit (default)) > > Example: > > @@ -32,6 +33,7 @@ Example: > y-size = <600>; > scan-freq-idle = <50>; > scan-freq-finger = <250>; > + touch-size-min = <5>; > }; > > /* ... */ > diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c > index 51fe2de..fd435fe 100644 > --- a/drivers/input/touchscreen/zforce_ts.c > +++ b/drivers/input/touchscreen/zforce_ts.c > @@ -54,6 +54,7 @@ > #define COMMAND_SETCONFIG 0x03 > #define COMMAND_DATAREQUEST 0x04 > #define COMMAND_SCANFREQ 0x08 > +#define COMMAND_TOUCH_SIZE 0x09 > #define COMMAND_STATUS 0X1e > > /* > @@ -65,6 +66,7 @@ > #define RESPONSE_RESOLUTION 0x02 > #define RESPONSE_SETCONFIG 0x03 > #define RESPONSE_SCANFREQ 0x08 > +#define RESPONSE_TOUCH_SIZE 0x09 > #define RESPONSE_STATUS 0X1e > > /* > @@ -276,6 +278,21 @@ static int zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger, > return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); > } > > +static int zforce_touch_size_limit(struct zforce_ts *ts, u8 limit) > +{ > + struct i2c_client *client = ts->client; > + u8 buf[] = { FRAME_START, 5, COMMAND_TOUCH_SIZE, > + 0, 0, /* maximum size limit off */ > + 1, limit }; /* set minimum size limit */ > + > + if (!limit) > + return 0; > + > + dev_dbg(&client->dev, "set min. touch size limit to %d mm\n", limit); > + > + return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); > +} > + > static int zforce_setconfig(struct zforce_ts *ts, char b1) > { > struct i2c_client *client = ts->client; > @@ -316,6 +333,13 @@ static int zforce_start(struct zforce_ts *ts) > goto error; > } > > + ret = zforce_touch_size_limit(ts, pdata->touch_size_min); > + if (ret) { > + dev_err(&client->dev, "Unable to set min. touch size, %d\n", > + ret); > + goto error; > + } > + > ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH); > if (ret) { > dev_err(&client->dev, "Unable to set config\n"); > @@ -577,6 +601,7 @@ static irqreturn_t zforce_irq_thread(int irq, void *dev_id) > case RESPONSE_SETCONFIG: > case RESPONSE_RESOLUTION: > case RESPONSE_SCANFREQ: > + case RESPONSE_TOUCH_SIZE: > zforce_complete(ts, payload[RESPONSE_ID], > payload[RESPONSE_DATA]); > break; > @@ -852,6 +877,10 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev) > &pdata->scan_freq_finger)) > pdata->scan_freq_finger = SCAN_FREQ_DEFAULT_FINGER; > > + if (of_property_read_u8(np, "touch-size-min", > + &pdata->touch_size_min)) > + pdata->touch_size_min = 0; > + > return pdata; > } > > diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h > index 90a1181..75e1a49 100644 > --- a/include/linux/platform_data/zforce_ts.h > +++ b/include/linux/platform_data/zforce_ts.h > @@ -20,6 +20,7 @@ struct zforce_ts_platdata { > unsigned int y_max; > u16 scan_freq_idle; > u16 scan_freq_finger; > + u8 touch_size_min; > }; > > #endif /* _LINUX_INPUT_ZFORCE_TS_H */ > -- > 2.8.0 > -- Dmitry ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-28 7:11 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1461135285-17582-1-git-send-email-dirk.behme@de.bosch.com> [not found] ` <1461135285-17582-3-git-send-email-dirk.behme@de.bosch.com> 2016-04-25 21:11 ` [PATCH 3/5] Input: zforce_ts: Add device tree support for scanning frequency Dmitry Torokhov 2016-04-27 13:32 ` fixed-term.Oleksij.Rempel 2016-04-27 14:44 ` Rob Herring 2016-04-28 7:11 ` fixed-term.Oleksij.Rempel [not found] ` <1461135285-17582-4-git-send-email-dirk.behme@de.bosch.com> 2016-04-25 21:12 ` [PATCH 4/5] Input: zforce_ts: Add support for minimum touch size limit Dmitry Torokhov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).