* Re: [PATCH v2 2/4] Input: goodix - Add ADVV28-supply regulator support
From: Jagan Teki @ 2018-12-06 11:02 UTC (permalink / raw)
To: Dmitry Torokhov, Chen-Yu Tsai, linux-input, linux-kernel,
Michael Trimarchi, linux-amarula
In-Reply-To: <20181205235220.3461-2-jagan@amarulasolutions.com>
On Thu, Dec 6, 2018 at 5:22 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Goodix CTP controllers have AVDD28 pin connected to voltage
> regulator which may not be turned on by default, like for GT5663.
>
> Add support for such ctp used boards by adding voltage regulator
> handling code to goodix ctp driver.
s/ADVV28/AVDD28 on commit head, let me know if you need another
version to update that or is it OK to you to change while applying.
sorry.
^ permalink raw reply
* Re: [PATCH v3 3/4] iio: adc: add STMPE ADC devicetree bindings
From: Philippe Schenker @ 2018-12-06 15:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: marcel.ziswiler, stefan, Max Krummenacher, devicetree, linux-iio,
Hartmut Knaack, Alexandre Torgue, linux-input, linux-kernel,
Rob Herring, Dmitry Torokhov, Lee Jones, Maxime Coquelin,
Mark Rutland, Peter Meerwald-Stadler, linux-stm32,
linux-arm-kernel, Lars-Peter Clausen
In-Reply-To: <20181125100413.73bc729f@archlinux>
On Sun, 2018-11-25 at 10:04 +0000, Jonathan Cameron wrote:
> On Fri, 23 Nov 2018 15:24:10 +0100
> Philippe Schenker <dev@pschenker.ch> wrote:
>
> > From: Stefan Agner <stefan@agner.ch>
> >
> > This adds the devicetree bindings for the STMPE ADC.
> >
> > Signed-off-by: Stefan Agner <stefan@agner.ch>
> > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> Clearly this will need review from input and mfd.
>
> I've suggested inline that you split the realignment out to a
> separate patch for reviewability reasons.
Thank you again Jonathan for your feedback, and of course also all the others!
I will split it much more so everything will be much more readable in v4. You
suggested again, to use the naming 'adc {'. I know that this is standard naming,
but unfortunately, this naming is given by drivers/mfd/stmpe.c (line 1311).
What do you suggest to do? break the naming scheme in mfd, or just use
'stmpe_adc {' ?
>
> > ---
> >
> > Changes in v3:
> > - Reformatted documentation for touchscreen to use tabs and have a better
> > overview of the settings.
> > - Added note which adc-settings will take precedence.
> > - changed typo in sample-time setting from 144 clocks to 124 clocks, as
> > stated
> > in the datasheet.
> >
> > Changes in v2:
> > - Moved the bindings for ADC to the overlying mfd.
> > - Reformatted for better readability
> >
> > .../devicetree/bindings/iio/adc/stmpe-adc.txt | 21 +++++++
> > .../bindings/input/touchscreen/stmpe.txt | 60 ++++++++++++-------
> > .../devicetree/bindings/mfd/stmpe.txt | 28 ++++++---
> > 3 files changed, 80 insertions(+), 29 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt
> >
> > diff --git a/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt
> > b/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt
> > new file mode 100644
> > index 000000000000..480e66422625
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/stmpe-adc.txt
> > @@ -0,0 +1,21 @@
> > +STMPE ADC driver
> > +----------------
> > +
> > +Required properties:
> > + - compatible: "st,stmpe-adc"
> > +
> > +Optional properties:
> > +Note that the ADC is shared with the STMPE touchscreen. ADC related
> > settings
> > +have to be done in the mfd.
> > +- st,norequest-mask: bitmask specifying which ADC channels should _not_ be
> > + requestable due to different usage (e.g. touch)
> > +
> > +Node name must be stmpe_adc and should be child node of stmpe node to
> > +which it belongs.
> > +
> > +Example:
> > +
> > + stmpe_adc {
>
> Can we use adc { here to match standard naming?
>
> > + compatible = "st,stmpe-adc";
> > + st,norequest-mask = <0x0F>; /* dont use ADC CH3-0 */
> > + };
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
> > b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
> > index 127baa31a77a..414586513a02 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
> > @@ -5,36 +5,52 @@ Required properties:
> > - compatible: "st,stmpe-ts"
> >
> > Optional properties:
> > -- st,sample-time: ADC converstion time in number of clock. (0 -> 36
> > clocks, 1 ->
> > - 44 clocks, 2 -> 56 clocks, 3 -> 64 clocks, 4 -> 80 clocks, 5 -> 96
> > clocks, 6
> > - -> 144 clocks), recommended is 4.
> > -- st,mod-12b: ADC Bit mode (0 -> 10bit ADC, 1 -> 12bit ADC)
> > -- st,ref-sel: ADC reference source (0 -> internal reference, 1 -> external
> > - reference)
> > -- st,adc-freq: ADC Clock speed (0 -> 1.625 MHz, 1 -> 3.25 MHz, 2 || 3 ->
> > 6.5 MHz)
> > -- st,ave-ctrl: Sample average control (0 -> 1 sample, 1 -> 2 samples, 2 ->
> > 4
> > - samples, 3 -> 8 samples)
> > -- st,touch-det-delay: Touch detect interrupt delay (0 -> 10 us, 1 -> 50 us,
> > 2 ->
> > - 100 us, 3 -> 500 us, 4-> 1 ms, 5 -> 5 ms, 6 -> 10 ms, 7 -> 50 ms)
> > recommended
> > - is 3
> > -- st,settling: Panel driver settling time (0 -> 10 us, 1 -> 100 us, 2 ->
> > 500 us, 3
> > - -> 1 ms, 4 -> 5 ms, 5 -> 10 ms, 6 for 50 ms, 7 -> 100 ms) recommended is
> > 2
> > -- st,fraction-z: Length of the fractional part in z (fraction-z ([0..7]) =
> > Count of
> > - the fractional part) recommended is 7
> > -- st,i-drive: current limit value of the touchscreen drivers (0 -> 20 mA
> > typical 35
> > - mA max, 1 -> 50 mA typical 80 mA max)
> > +- st,ave-ctrl : Sample average control
> > + 0 -> 1 sample
> > + 1 -> 2 samples
> > + 2 -> 4 samples
> > + 3 -> 8 samples
> > +- st,touch-det-delay : Touch detect interrupt delay (recommended is
> > 3)
> > + 0 -> 10 us 5 -> 5 ms
> > + 1 -> 50 us 6 -> 10 ms
> > + 2 -> 100 us 7 -> 50 ms
> > + 3 -> 500 us
> > + 4-> 1 ms
> > +- st,settling : Panel driver settling time (recommended is 2)
> > + 0 -> 10 us 5 -> 10 ms
> > + 1 -> 100 us 6 for 50 ms
> > + 2 -> 500 us 7 -> 100 ms
> > + 3 -> 1 ms
> > + 4 -> 5 ms
> > +- st,fraction-z : Length of the fractional part in z
> > (recommended is 7)
> > + (fraction-z ([0..7]) = Count of the fractional part)
> > +- st,i-drive : current limit value of the touchscreen drivers
> > + 0 -> 20 mA (typical 35mA max)
> > + 1 -> 50 mA (typical 80 mA max)
> > +
> > +Optional properties common with MFD (deprecated):
> > + - st,sample-time : ADC conversion time in number of clock.
> > + 0 -> 36 clocks 4 -> 80 clocks
> > (recommended)
> > + 1 -> 44 clocks 5 -> 96 clocks
> > + 2 -> 56 clocks 6 -> 124 clocks
> > + 3 -> 64 clocks
> > + - st,mod-12b : ADC Bit mode
> > + 0 -> 10bit ADC 1 -> 12bit ADC
> > + - st,ref-sel : ADC reference source
> > + 0 -> internal 1 -> external
> > + - st,adc-freq : ADC Clock speed
> > + 0 -> 1.625 MHz 2 || 3 -> 6.5 MHz
> > + 1 -> 3.25 MHz
> >
> > Node name must be stmpe_touchscreen and should be child node of stmpe node
> > to
> > which it belongs.
> >
> > +Note that common ADC settings of stmpe_touchscreen will take precedence.
> > +
> > Example:
> >
> > stmpe_touchscreen {
> > compatible = "st,stmpe-ts";
> > - st,sample-time = <4>;
> > - st,mod-12b = <1>;
> > - st,ref-sel = <0>;
> > - st,adc-freq = <1>;
> > st,ave-ctrl = <1>;
> > st,touch-det-delay = <2>;
> > st,settling = <2>;
> > diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt
> > b/Documentation/devicetree/bindings/mfd/stmpe.txt
> > index c797c05cd3c2..d4408a417193 100644
> > --- a/Documentation/devicetree/bindings/mfd/stmpe.txt
> > +++ b/Documentation/devicetree/bindings/mfd/stmpe.txt
> > @@ -4,15 +4,29 @@ STMPE is an MFD device which may expose the following
> > inbuilt devices: gpio,
> > keypad, touchscreen, adc, pwm, rotator.
> >
> > Required properties:
> > - - compatible :
> > "st,stmpe[610|801|811|1600|1601|2401|2403]"
> > - - reg : I2C/SPI address of the device
> > + - compatible :
> > "st,stmpe[610|801|811|1600|1601|2401|2403]"
> > + - reg : I2C/SPI address of the device
>
> Nothing wrong with correcting alignment, but it shouldn't be in the same patch
> as a fundamental change lie this. Just adds noise.
>
> If that means you first have to introduce the new block missaligned, then
> fix up the alignment in a follow up patch, then do that as we can then
> effectively ignore the realignment as obviously correct and focus on
> the real changes.
>
> >
> > Optional properties:
> > - - interrupts : The interrupt outputs from the controller
> > - - interrupt-controller : Marks the device node as an interrupt
> > controller
> > - - wakeup-source : Marks the input device as wakable
> > - - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128,
> > 256, 512 and 1024
> > - - irq-gpio : If present, which GPIO to use for event
> > IRQ
> > + - interrupts : The interrupt outputs from the
> > controller
> > + - interrupt-controller : Marks the device node as an interrupt
> > controller
> > + - wakeup-source : Marks the input device as wakable
> > + - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64,
> > 128, 256, 512 and 1024
> > + - irq-gpio : If present, which GPIO to use for
> > event IRQ
> > +
> > +Optional properties for devices with touch and ADC (STMPE811|STMPE610):
> > + - st,sample-time : ADC conversion time in number of clock.
> > + 0 -> 36 clocks 4 -> 80
> > clocks (recommended)
> > + 1 -> 44 clocks 5 -> 96
> > clocks
> > + 2 -> 56 clocks 6 -> 124
> > clocks
> > + 3 -> 64 clocks
> > + - st,mod-12b : ADC Bit mode
> > + 0 -> 10bit ADC 1 -> 12bit
> > ADC
> > + - st,ref-sel : ADC reference source
> > + 0 -> internal 1 ->
> > external
> > + - st,adc-freq : ADC Clock speed
> > + 0 -> 1.625 MHz 2 || 3 ->
> > 6.5 MHz
> > + 1 -> 3.25 MHz
> >
> > Example:
> >
^ permalink raw reply
* Re: [PATCH] Input: restore EV_ABS ABS_RESERVED
From: Peter Hutterer @ 2018-12-06 22:46 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Martin Kepplinger, linux-input, Dmitry Torokhov, linux-kernel
In-Reply-To: <CAN+gG=FVvUFcYYcBnaOaj-YRQCgu4-FYFuJGccHhK+u31EjuvQ@mail.gmail.com>
On Thu, Dec 06, 2018 at 10:24:11AM +0100, Benjamin Tissoires wrote:
> On Thu, Dec 6, 2018 at 9:36 AM Martin Kepplinger
> <martin.kepplinger@ginzinger.com> wrote:
> >
> > On 06.12.18 00:03, Peter Hutterer wrote:
> > > ABS_RESERVED was added in d9ca1c990a7 and accidentally removed as part of
> > > ffe0e7cf290f5c9 when the high-resolution scrolling code was removed.
> > >
> > > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> >
> > Reviewed-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
>
> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> Dmitry, I do not think this one will conflict with the high res wheel
> patches, so I think it should be safe to take it through your tree.
> If you think it'll be an issue, I can also take it through the HID one.
fwiw, patch was made on top of v4.20-rc5, so it shouldn't conflict.
Cheers,
Peter
^ permalink raw reply
* Re: [PATCH] Input: restore EV_ABS ABS_RESERVED
From: Dmitry Torokhov @ 2018-12-06 22:56 UTC (permalink / raw)
To: Peter Hutterer
Cc: Benjamin Tissoires, Martin Kepplinger, linux-input, linux-kernel
In-Reply-To: <20181206224605.GA27899@jelly>
On Fri, Dec 07, 2018 at 08:46:05AM +1000, Peter Hutterer wrote:
> On Thu, Dec 06, 2018 at 10:24:11AM +0100, Benjamin Tissoires wrote:
> > On Thu, Dec 6, 2018 at 9:36 AM Martin Kepplinger
> > <martin.kepplinger@ginzinger.com> wrote:
> > >
> > > On 06.12.18 00:03, Peter Hutterer wrote:
> > > > ABS_RESERVED was added in d9ca1c990a7 and accidentally removed as part of
> > > > ffe0e7cf290f5c9 when the high-resolution scrolling code was removed.
> > > >
> > > > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > >
> > > Reviewed-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
> >
> > Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> >
> > Dmitry, I do not think this one will conflict with the high res wheel
> > patches, so I think it should be safe to take it through your tree.
> > If you think it'll be an issue, I can also take it through the HID one.
>
> fwiw, patch was made on top of v4.20-rc5, so it shouldn't conflict.
My tree is behind that ;) so I would actually prefer if Benjamin/Jiri
would take it through their tree with my:
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v3 1/8] Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES`
From: Dmitry Torokhov @ 2018-12-06 22:56 UTC (permalink / raw)
To: Peter Hutterer
Cc: linux-input, Jiri Kosina, Harry Cutts, torvalds,
Nestor Lopez Casado, linux-kernel, Benjamin Tissoires
In-Reply-To: <20181205004228.10714-2-peter.hutterer@who-t.net>
On Wed, Dec 05, 2018 at 10:42:21AM +1000, Peter Hutterer wrote:
> This event code represents scroll reports from high-resolution wheels and
> is modelled after the approach Windows uses. The value 120 is one detent
> (wheel click) of movement. Mice with higher-resolution scrolling can send
> fractions of 120 which must be accumulated in userspace. Userspace can either
> wait for a full 120 to accumulate or scroll by fractions of one logical scroll
> movement as the events come in. 120 was picked as magic number because it has
> a high number of integer fractions that can be used by high-resolution wheels.
>
> For more information see
> https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613912(v=vs.85)
>
> These new axes obsolete REL_WHEEL and REL_HWHEEL. The legacy axes are emulated
> by the kernel but the most accurate (and most granular) data is available
> through the new axes.
>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> No changes since v1
>
> Documentation/input/event-codes.rst | 21 ++++++++++++++++++++-
> include/uapi/linux/input-event-codes.h | 2 ++
> 2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst
> index a8c0873beb95..b24b5343f5eb 100644
> --- a/Documentation/input/event-codes.rst
> +++ b/Documentation/input/event-codes.rst
> @@ -190,7 +190,26 @@ A few EV_REL codes have special meanings:
> * REL_WHEEL, REL_HWHEEL:
>
> - These codes are used for vertical and horizontal scroll wheels,
> - respectively.
> + respectively. The value is the number of detents moved on the wheel, the
> + physical size of which varies by device. For high-resolution wheels
> + this may be an approximation based on the high-resolution scroll events,
> + see REL_WHEEL_HI_RES. These event codes are legacy codes and
> + REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES should be preferred where
> + available.
> +
> +* REL_WHEEL_HI_RES, REL_HWHEEL_HI_RES:
> +
> + - High-resolution scroll wheel data. The accumulated value 120 represents
> + movement by one detent. For devices that do not provide high-resolution
> + scrolling, the value is always a multiple of 120. For devices with
> + high-resolution scrolling, the value may be a fraction of 120.
> +
> + If a vertical scroll wheel supports high-resolution scrolling, this code
> + will be emitted in addition to REL_WHEEL or REL_HWHEEL. The REL_WHEEL
> + and REL_HWHEEL may be an approximation based on the high-resolution
> + scroll events. There is no guarantee that the high-resolution data
> + is a multiple of 120 at the time of an emulated REL_WHEEL or REL_HWHEEL
> + event.
>
> EV_ABS
> ------
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index 3eb5a4c3d60a..265ef2028660 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -716,6 +716,8 @@
> * the situation described above.
> */
> #define REL_RESERVED 0x0a
> +#define REL_WHEEL_HI_RES 0x0b
> +#define REL_HWHEEL_HI_RES 0x0c
> #define REL_MAX 0x0f
> #define REL_CNT (REL_MAX+1)
>
> --
> 2.19.2
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] HID: input: support Microsoft wireless radio control hotkey
From: Chris Chiu @ 2018-12-07 4:07 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, rydberg, linux-input, Linux Kernel,
Linux Upstreaming Team
In-Reply-To: <CAB4CAwfOBuAutaQdObyfrOg5Yo2M9NJGww1Ffc7o2YrAYDObEA@mail.gmail.com>
On Wed, Dec 5, 2018 at 8:56 AM Chris Chiu <chiu@endlessm.com> wrote:
>
> On Fri, Nov 30, 2018 at 7:18 PM Benjamin Tissoires
> <benjamin.tissoires@redhat.com> wrote:
> >
> > On Fri, Nov 30, 2018 at 7:46 AM Chris Chiu <chiu@endlessm.com> wrote:
> > >
> > > The ASUS laptops start to support the airplane mode radio management
> > > to replace the original machanism of airplane mode toggle hotkey.
> > > On the ASUS P5440FF, it presents as a HID device connecting via
> > > I2C, name i2c-AMPD0001. When pressing hotkey, the Embedded Controller
> > > send hid report up via I2C and switch the airplane mode indicator
> > > LED based on the status.
> > >
> > > However, it's not working because it fails to be identified as a
> > > hidinput device. It fails in hidinput_connect() due to the macro
> > > IS_INPUT_APPLICATION doesn't identify HID_GD_WIRELESS_RADIO_CTLS
> > > as a legit application code.
> > >
> > > It's easy to add the HID I2C vendor and product id to the quirk
> > > list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it
> > > can be more generic to support such kind of application on PC.
> >
> > Sounds good, but while you are at it, can you please:
> > - fix the kbuild warning
> > - rewrite the whole line to use macros,
> > - make the macro prettier by inserting new lines were required
> > - and define the missing macro:
> > 0x000d0006 -> HID_DG_WHITEBOARD
> >
> > Maybe we should keep the ranges definitions with raw values and put a
> > comment on the side with the names.
> >
> > Cheers,
> > Benjamin
> >
>
> Hi Bejamin,
> Thanks for your comment, I've submitted other patches which may
> fulfill your suggestion.
> https://lore.kernel.org/patchwork/patch/1020373/
> https://lore.kernel.org/patchwork/patch/1020374/
>
> Please help me review and correct me if there's any modification
> required. Thanks & Regards.
>
> Chris
>
Gentle ping. Any comment for the new patch? Thanks and Regards.
Chris
> > >
> > > Signed-off-by: Chris Chiu <chiu@endlessm.com>
> > > ---
> > > include/linux/hid.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/include/linux/hid.h b/include/linux/hid.h
> > > index d44a78362942..f4805f605fed 100644
> > > --- a/include/linux/hid.h
> > > +++ b/include/linux/hid.h
> > > @@ -836,7 +836,7 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
> > >
> > > /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
> > > /* We ignore a few input applications that are not widely used */
> > > -#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
> > > +#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || || (a == 0x0001000c) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
> > >
> > > /* HID core API */
> > >
> > > --
> > > 2.11.0
> > >
^ permalink raw reply
* Re: [PATCH v7 0/7] Introduce STPMIC1 PMIC Driver
From: Lee Jones @ 2018-12-07 7:31 UTC (permalink / raw)
To: Pascal PAILLET-LME
Cc: dmitry.torokhov@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, lgirdwood@gmail.com, broonie@kernel.org,
wim@linux-watchdog.org, linux@roeck-us.net,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
benjamin.gaignard@linaro.org, eballetbo@gmail.com,
axel.lin@ingics.com
In-Reply-To: <5C07F08B.2010701@st.com>
On Wed, 05 Dec 2018, Pascal PAILLET-LME wrote:
>
> pascal paillet (p.paillet@st.com) Le Mans / France
> Microcontrollers and Digital ICs Group | Application Development
> TEL: +33.(0)2.44.02.74.69 | TINA: 166 7469
>
> Le 12/05/2018 10:36 AM, Lee Jones a écrit :
> > On Tue, 04 Dec 2018, Pascal PAILLET-LME wrote:
> >> Le 12/03/2018 08:11 AM, Lee Jones a écrit :
> >>> On Fri, 30 Nov 2018, Pascal PAILLET-LME wrote:
> >>>
> >>>> The goal of this patch-set is to propose a driver for the STPMIC1 PMIC from
> >>>> STMicroelectronics.
> >>>> The STPMIC1 regulators supply power to an application processor as well as
> >>>> to external system peripherals such as DDR, Flash memories and system
> >>>> devices. It also features onkey button input and an hardware watchdog.
> >>>> The STPMIC1 is controlled via I2C.
> >>>>
> >>>> Main driver is drivers/mfd/stpmic1 that handle I2C regmap configuration and
> >>>> irqchip. stpmic1_regulator, stpmic1_onkey and stpmic1_wdt need stpmic1 mfd
> >>>> as parent.
> >>>>
> >>>> STPMIC1 MFD and regulator drivers maybe mandatory at boot time.
> >>>>
> >>>> Pascal Paillet (7):
> >>>> changes in v7:
> >>>> * rebase on regul/for-next
> >>>>
> >>>> dt-bindings: mfd: document stpmic1
> >>>> mfd: stpmic1: add stpmic1 driver
> >>>> dt-bindings: input: document stpmic1 pmic onkey
> >>>> input: stpmic1: add stpmic1 onkey driver
> >>>> dt-bindings: watchdog: document stpmic1 pmic watchdog
> >>>> watchdog: stpmic1: add stpmic1 watchdog driver
> >>>> regulator: stpmic1: fix regulator_lock usage
> >>>>
> >>>> .../devicetree/bindings/input/st,stpmic1-onkey.txt | 28 +++
> >>>> .../devicetree/bindings/mfd/st,stpmic1.txt | 61 ++++++
> >>>> .../bindings/watchdog/st,stpmic1-wdt.txt | 11 ++
> >>>> drivers/input/misc/Kconfig | 11 ++
> >>>> drivers/input/misc/Makefile | 2 +
> >>>> drivers/input/misc/stpmic1_onkey.c | 198 +++++++++++++++++++
> >>>> drivers/mfd/Kconfig | 16 ++
> >>>> drivers/mfd/Makefile | 1 +
> >>>> drivers/mfd/stpmic1.c | 213 +++++++++++++++++++++
> >>>> drivers/regulator/stpmic1_regulator.c | 2 +-
> >>> Is it just Mark you're waiting on now?
> >> It is ok now, Mark has applied the patch.
> >> Evrey thing has been acked now. What is the nex step ?
> > Mark has applied patch 7?
> >
> > Why don't I see that? Should you have removed it from this set?
> Hi Lee, I have received an email from Mark telliing that the regulator
> patch is applied on
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
>
> I can see it on the branch regul/for-next.
Mark,
Does your patch tracker only reply to the author?
Any reason why I don't see it?
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* [PATCH 0/8] Input: tm2-touchkey: Add support for Aries and Midas
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
This patches adds support for Aries (Samsung i9000) and Midsa (Samsung S3)
based devices to TM2 Touchkey driver.
Jonathan Bakker (6):
Input: tm2-touchkey: Use predefined device name
Input: tm2-touchkey: Correct initial brightness
Input: tm2-touchkey: Allow specifying custom keycodes
Input: dt-bindings: tm2-touchkey: Document new keycodes property
Input: tm2-touchkey: Add support for aries touchkey variant
Input: dt-bindings: tm2-touchkey: Add support for aries touchkey
Simon Shields (2):
Input: tm2-touchkey: Add support for midas touchkey
Input: dt-bindings: tm2-touchkey: Add support for midas touchkey
.../bindings/input/cypress,tm2-touchkey.txt | 9 +-
drivers/input/keyboard/tm2-touchkey.c | 149 +++++++++++++-----
2 files changed, 121 insertions(+), 37 deletions(-)
--
2.17.1
^ permalink raw reply
* [PATCH 1/8] Input: tm2-touchkey: Add support for midas touchkey
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Simon Shields <simon@lineageos.org>
The touchkey on midas boards is almost identical.
The only real difference is that it uses the same register for both
keycode and base.
Signed-off-by: Simon Shields <simon@lineageos.org>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/keyboard/tm2-touchkey.c | 48 ++++++++++++++++++++++-----
1 file changed, 39 insertions(+), 9 deletions(-)
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index abc266e40e17..37a5ced24009 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -22,12 +22,13 @@
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/pm.h>
#include <linux/regulator/consumer.h>
-#define TM2_TOUCHKEY_DEV_NAME "tm2-touchkey"
-#define TM2_TOUCHKEY_KEYCODE_REG 0x03
-#define TM2_TOUCHKEY_BASE_REG 0x00
+#define TM2_TOUCHKEY_DEV_NAME "tm2-touchkey"
+#define MIDAS_TOUCHKEY_DEV_NAME "midas-touchkey"
+
#define TM2_TOUCHKEY_CMD_LED_ON 0x10
#define TM2_TOUCHKEY_CMD_LED_OFF 0x20
#define TM2_TOUCHKEY_BIT_PRESS_EV BIT(3)
@@ -40,12 +41,31 @@ enum {
TM2_TOUCHKEY_KEY_BACK,
};
+struct touchkey_variant {
+ const char *name;
+ u8 keycode_reg;
+ u8 base_reg;
+};
+
struct tm2_touchkey_data {
struct i2c_client *client;
struct input_dev *input_dev;
struct led_classdev led_dev;
struct regulator *vdd;
struct regulator_bulk_data regulators[2];
+ struct touchkey_variant *variant;
+};
+
+static struct touchkey_variant tm2_touchkey_variant = {
+ .name = "tm2-touchkey",
+ .keycode_reg = 0x03,
+ .base_reg = 0x00,
+};
+
+static struct touchkey_variant midas_touchkey_variant = {
+ .name = "midas-touchkey",
+ .keycode_reg = 0x00,
+ .base_reg = 0x00,
};
static void tm2_touchkey_led_brightness_set(struct led_classdev *led_dev,
@@ -66,7 +86,7 @@ static void tm2_touchkey_led_brightness_set(struct led_classdev *led_dev,
regulator_set_voltage(touchkey->vdd, volt, volt);
i2c_smbus_write_byte_data(touchkey->client,
- TM2_TOUCHKEY_BASE_REG, data);
+ touchkey->variant->base_reg, data);
}
static int tm2_touchkey_power_enable(struct tm2_touchkey_data *touchkey)
@@ -99,7 +119,7 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
int key;
data = i2c_smbus_read_byte_data(touchkey->client,
- TM2_TOUCHKEY_KEYCODE_REG);
+ touchkey->variant->keycode_reg);
if (data < 0) {
dev_err(&touchkey->client->dev,
"failed to read i2c data: %d\n", data);
@@ -153,6 +173,9 @@ static int tm2_touchkey_probe(struct i2c_client *client,
touchkey->client = client;
i2c_set_clientdata(client, touchkey);
+ touchkey->variant = (struct touchkey_variant *)
+ of_device_get_match_data(&client->dev);
+
touchkey->regulators[0].supply = "vcc";
touchkey->regulators[1].supply = "vdd";
error = devm_regulator_bulk_get(&client->dev,
@@ -187,7 +210,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
return -ENOMEM;
}
- touchkey->input_dev->name = TM2_TOUCHKEY_DEV_NAME;
+ touchkey->input_dev->name = touchkey->variant->name;
touchkey->input_dev->id.bustype = BUS_I2C;
input_set_capability(touchkey->input_dev, EV_KEY, KEY_PHONE);
@@ -203,7 +226,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
error = devm_request_threaded_irq(&client->dev, client->irq,
NULL, tm2_touchkey_irq_handler,
IRQF_ONESHOT,
- TM2_TOUCHKEY_DEV_NAME, touchkey);
+ touchkey->variant->name, touchkey);
if (error) {
dev_err(&client->dev,
"failed to request threaded irq: %d\n", error);
@@ -211,7 +234,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
}
/* led device */
- touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME;
+ touchkey->led_dev.name = touchkey->variant->name;
touchkey->led_dev.brightness = LED_FULL;
touchkey->led_dev.max_brightness = LED_ON;
touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set;
@@ -257,12 +280,19 @@ static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
static const struct i2c_device_id tm2_touchkey_id_table[] = {
{ TM2_TOUCHKEY_DEV_NAME, 0 },
+ { MIDAS_TOUCHKEY_DEV_NAME, 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, tm2_touchkey_id_table);
static const struct of_device_id tm2_touchkey_of_match[] = {
- { .compatible = "cypress,tm2-touchkey", },
+ {
+ .compatible = "cypress,tm2-touchkey",
+ .data = &tm2_touchkey_variant,
+ }, {
+ .compatible = "cypress,midas-touchkey",
+ .data = &midas_touchkey_variant,
+ },
{ },
};
MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);
--
2.17.1
^ permalink raw reply related
* [PATCH 2/8] Input: dt-bindings: tm2-touchkey: Add support for midas touchkey
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Simon Shields <simon@lineageos.org>
Document compatible for midas touchkey.
Signed-off-by: Simon Shields <simon@lineageos.org>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
.../devicetree/bindings/input/cypress,tm2-touchkey.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
index 0c252d9306da..dfb3b9f0ee40 100644
--- a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
+++ b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
@@ -1,7 +1,9 @@
Samsung tm2-touchkey
Required properties:
-- compatible: must be "cypress,tm2-touchkey"
+- compatible:
+ * "cypress,tm2-touchkey" - for the touchkey found on the tm2 board
+ * "cypress,midas-touchkey" - for the touchkey found on midas boards
- reg: I2C address of the chip.
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).
--
2.17.1
^ permalink raw reply related
* [PATCH 3/8] Input: tm2-touchkey: Use predefined device name
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Purely a cosmetic fix, using the names defined earlier
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/keyboard/tm2-touchkey.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index 37a5ced24009..cc713b901bf2 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -57,13 +57,13 @@ struct tm2_touchkey_data {
};
static struct touchkey_variant tm2_touchkey_variant = {
- .name = "tm2-touchkey",
+ .name = TM2_TOUCHKEY_DEV_NAME,
.keycode_reg = 0x03,
.base_reg = 0x00,
};
static struct touchkey_variant midas_touchkey_variant = {
- .name = "midas-touchkey",
+ .name = MIDAS_TOUCHKEY_DEV_NAME,
.keycode_reg = 0x00,
.base_reg = 0x00,
};
--
2.17.1
^ permalink raw reply related
* [PATCH 4/8] Input: tm2-touchkey: Correct initial brightness
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Tm2-touchkey don't have brightness levels, but only on/off states,
so replace LED_FULL with LED_ON.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/keyboard/tm2-touchkey.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index cc713b901bf2..a73894b8dede 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -235,7 +235,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
/* led device */
touchkey->led_dev.name = touchkey->variant->name;
- touchkey->led_dev.brightness = LED_FULL;
+ touchkey->led_dev.brightness = LED_ON;
touchkey->led_dev.max_brightness = LED_ON;
touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set;
--
2.17.1
^ permalink raw reply related
* [PATCH 5/8] Input: tm2-touchkey: Allow specifying custom keycodes
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Not all devices use the same keycodes in the same order
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/keyboard/tm2-touchkey.c | 49 +++++++++++++++------------
1 file changed, 27 insertions(+), 22 deletions(-)
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index a73894b8dede..ebc275ab8ad1 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -36,11 +36,6 @@
#define TM2_TOUCHKEY_LED_VOLTAGE_MIN 2500000
#define TM2_TOUCHKEY_LED_VOLTAGE_MAX 3300000
-enum {
- TM2_TOUCHKEY_KEY_MENU = 0x1,
- TM2_TOUCHKEY_KEY_BACK,
-};
-
struct touchkey_variant {
const char *name;
u8 keycode_reg;
@@ -54,6 +49,8 @@ struct tm2_touchkey_data {
struct regulator *vdd;
struct regulator_bulk_data regulators[2];
struct touchkey_variant *variant;
+ u8 keycodes[4];
+ int num_keycodes;
};
static struct touchkey_variant tm2_touchkey_variant = {
@@ -116,7 +113,8 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
{
struct tm2_touchkey_data *touchkey = devid;
int data;
- int key;
+ int index;
+ int i;
data = i2c_smbus_read_byte_data(touchkey->client,
touchkey->variant->keycode_reg);
@@ -126,26 +124,20 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
goto out;
}
- switch (data & TM2_TOUCHKEY_BIT_KEYCODE) {
- case TM2_TOUCHKEY_KEY_MENU:
- key = KEY_PHONE;
- break;
-
- case TM2_TOUCHKEY_KEY_BACK:
- key = KEY_BACK;
- break;
-
- default:
+ index = (data & TM2_TOUCHKEY_BIT_KEYCODE) - 1;
+ if (index < 0 || index >= touchkey->num_keycodes) {
dev_warn(&touchkey->client->dev,
- "unhandled keycode, data %#02x\n", data);
+ "invalid keycode index %d\n", index);
goto out;
}
if (data & TM2_TOUCHKEY_BIT_PRESS_EV) {
- input_report_key(touchkey->input_dev, KEY_PHONE, 0);
- input_report_key(touchkey->input_dev, KEY_BACK, 0);
+ for (i = 0; i < touchkey->num_keycodes; i++)
+ input_report_key(touchkey->input_dev,
+ touchkey->keycodes[i], 0);
} else {
- input_report_key(touchkey->input_dev, key, 1);
+ input_report_key(touchkey->input_dev,
+ touchkey->keycodes[index], 1);
}
input_sync(touchkey->input_dev);
@@ -157,8 +149,10 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
static int tm2_touchkey_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
+ struct device_node *np = client->dev.of_node;
struct tm2_touchkey_data *touchkey;
int error;
+ int i;
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA)) {
@@ -189,6 +183,16 @@ static int tm2_touchkey_probe(struct i2c_client *client,
/* Save VDD for easy access */
touchkey->vdd = touchkey->regulators[1].consumer;
+ touchkey->num_keycodes = of_property_read_variable_u8_array(np,
+ "keycodes", touchkey->keycodes, 0,
+ ARRAY_SIZE(touchkey->keycodes));
+ if (touchkey->num_keycodes <= 0) {
+ /* default keycodes */
+ touchkey->keycodes[0] = KEY_PHONE;
+ touchkey->keycodes[1] = KEY_BACK;
+ touchkey->num_keycodes = 2;
+ }
+
error = tm2_touchkey_power_enable(touchkey);
if (error) {
dev_err(&client->dev, "failed to power up device: %d\n", error);
@@ -213,8 +217,9 @@ static int tm2_touchkey_probe(struct i2c_client *client,
touchkey->input_dev->name = touchkey->variant->name;
touchkey->input_dev->id.bustype = BUS_I2C;
- input_set_capability(touchkey->input_dev, EV_KEY, KEY_PHONE);
- input_set_capability(touchkey->input_dev, EV_KEY, KEY_BACK);
+ for (i = 0; i < touchkey->num_keycodes; i++)
+ input_set_capability(touchkey->input_dev, EV_KEY,
+ touchkey->keycodes[i]);
error = input_register_device(touchkey->input_dev);
if (error) {
--
2.17.1
^ permalink raw reply related
* [PATCH 6/8] Input: dt-bindings: tm2-touchkey: Document new keycodes property
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Document new optional property for setting custom keycodes.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
.../devicetree/bindings/input/cypress,tm2-touchkey.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
index dfb3b9f0ee40..3b54d997b8de 100644
--- a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
+++ b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
@@ -10,6 +10,9 @@ Required properties:
- vcc-supply : internal regulator output. 1.8V
- vdd-supply : power supply for IC 3.3V
+Optional properties:
+- keycodes: array of keycodes (max 4), default KEY_PHONE and KEY_BACK
+
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
Example:
@@ -23,5 +26,6 @@ Example:
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
vcc-supply=<&ldo32_reg>;
vdd-supply=<&ldo33_reg>;
+ keycodes = /bits/ 8 <KEY_PHONE KEY_BACK>;
};
};
--
2.17.1
^ permalink raw reply related
* [PATCH 7/8] Input: tm2-touchkey: Add support for aries touchkey variant
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
The touchkey variant found on aries board is slighty different,
it uses a fixed regulator and writes/read to the same place
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/keyboard/tm2-touchkey.c | 56 +++++++++++++++++++++++----
1 file changed, 49 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index ebc275ab8ad1..6f1235183c21 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -28,7 +28,10 @@
#define TM2_TOUCHKEY_DEV_NAME "tm2-touchkey"
#define MIDAS_TOUCHKEY_DEV_NAME "midas-touchkey"
+#define ARIES_TOUCHKEY_DEV_NAME "aries-touchkey"
+#define ARIES_TOUCHKEY_CMD_LED_ON 0x1
+#define ARIES_TOUCHKEY_CMD_LED_OFF 0x2
#define TM2_TOUCHKEY_CMD_LED_ON 0x10
#define TM2_TOUCHKEY_CMD_LED_OFF 0x20
#define TM2_TOUCHKEY_BIT_PRESS_EV BIT(3)
@@ -40,6 +43,10 @@ struct touchkey_variant {
const char *name;
u8 keycode_reg;
u8 base_reg;
+ u8 cmd_led_on;
+ u8 cmd_led_off;
+ bool no_reg;
+ bool fixed_regulator;
};
struct tm2_touchkey_data {
@@ -57,12 +64,24 @@ static struct touchkey_variant tm2_touchkey_variant = {
.name = TM2_TOUCHKEY_DEV_NAME,
.keycode_reg = 0x03,
.base_reg = 0x00,
+ .cmd_led_on = TM2_TOUCHKEY_CMD_LED_ON,
+ .cmd_led_off = TM2_TOUCHKEY_CMD_LED_OFF,
};
static struct touchkey_variant midas_touchkey_variant = {
.name = MIDAS_TOUCHKEY_DEV_NAME,
.keycode_reg = 0x00,
.base_reg = 0x00,
+ .cmd_led_on = TM2_TOUCHKEY_CMD_LED_ON,
+ .cmd_led_off = TM2_TOUCHKEY_CMD_LED_OFF,
+};
+
+static struct touchkey_variant aries_touchkey_variant = {
+ .name = ARIES_TOUCHKEY_DEV_NAME,
+ .no_reg = true,
+ .fixed_regulator = true,
+ .cmd_led_on = ARIES_TOUCHKEY_CMD_LED_ON,
+ .cmd_led_off = ARIES_TOUCHKEY_CMD_LED_OFF,
};
static void tm2_touchkey_led_brightness_set(struct led_classdev *led_dev,
@@ -75,15 +94,20 @@ static void tm2_touchkey_led_brightness_set(struct led_classdev *led_dev,
if (brightness == LED_OFF) {
volt = TM2_TOUCHKEY_LED_VOLTAGE_MIN;
- data = TM2_TOUCHKEY_CMD_LED_OFF;
+ data = touchkey->variant->cmd_led_off;
} else {
volt = TM2_TOUCHKEY_LED_VOLTAGE_MAX;
- data = TM2_TOUCHKEY_CMD_LED_ON;
+ data = touchkey->variant->cmd_led_on;
}
- regulator_set_voltage(touchkey->vdd, volt, volt);
- i2c_smbus_write_byte_data(touchkey->client,
- touchkey->variant->base_reg, data);
+ if (!touchkey->variant->fixed_regulator)
+ regulator_set_voltage(touchkey->vdd, volt, volt);
+
+ if (touchkey->variant->no_reg)
+ i2c_smbus_write_byte(touchkey->client, data);
+ else
+ i2c_smbus_write_byte_data(touchkey->client,
+ touchkey->variant->base_reg, data);
}
static int tm2_touchkey_power_enable(struct tm2_touchkey_data *touchkey)
@@ -116,8 +140,11 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
int index;
int i;
- data = i2c_smbus_read_byte_data(touchkey->client,
- touchkey->variant->keycode_reg);
+ if (touchkey->variant->no_reg)
+ data = i2c_smbus_read_byte(touchkey->client);
+ else
+ data = i2c_smbus_read_byte_data(touchkey->client,
+ touchkey->variant->keycode_reg);
if (data < 0) {
dev_err(&touchkey->client->dev,
"failed to read i2c data: %d\n", data);
@@ -143,6 +170,14 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
input_sync(touchkey->input_dev);
out:
+ if (touchkey->variant->fixed_regulator &&
+ data & TM2_TOUCHKEY_BIT_PRESS_EV) {
+ /* touch turns backlight on, so make sure we're in sync */
+ if (touchkey->led_dev.brightness == LED_OFF)
+ tm2_touchkey_led_brightness_set(&touchkey->led_dev,
+ LED_OFF);
+ }
+
return IRQ_HANDLED;
}
@@ -251,6 +286,9 @@ static int tm2_touchkey_probe(struct i2c_client *client,
return error;
}
+ if (touchkey->variant->fixed_regulator)
+ tm2_touchkey_led_brightness_set(&touchkey->led_dev, LED_ON);
+
return 0;
}
@@ -286,6 +324,7 @@ static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
static const struct i2c_device_id tm2_touchkey_id_table[] = {
{ TM2_TOUCHKEY_DEV_NAME, 0 },
{ MIDAS_TOUCHKEY_DEV_NAME, 0 },
+ { ARIES_TOUCHKEY_DEV_NAME, 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, tm2_touchkey_id_table);
@@ -297,6 +336,9 @@ static const struct of_device_id tm2_touchkey_of_match[] = {
}, {
.compatible = "cypress,midas-touchkey",
.data = &midas_touchkey_variant,
+ }, {
+ .compatible = "cypress,aries-touchkey",
+ .data = &aries_touchkey_variant,
},
{ },
};
--
2.17.1
^ permalink raw reply related
* [PATCH 8/8] Input: dt-bindings: tm2-touchkey: Add support for aries touchkey
From: Paweł Chmiel @ 2018-12-07 10:58 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: devicetree, linux-input, linux-kernel, pawel.mikolaj.chmiel,
xc-racer2, simon
In-Reply-To: <20181207105811.1831-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Document compatible for aries touchkey.
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
index 3b54d997b8de..c518125d16f5 100644
--- a/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
+++ b/Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
@@ -4,6 +4,7 @@ Required properties:
- compatible:
* "cypress,tm2-touchkey" - for the touchkey found on the tm2 board
* "cypress,midas-touchkey" - for the touchkey found on midas boards
+ * "cypress,aries-touchkey" - for the touchkey found on aries boards
- reg: I2C address of the chip.
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).
--
2.17.1
^ permalink raw reply related
* Re: [PATCH v7 0/7] Introduce STPMIC1 PMIC Driver
From: Mark Brown @ 2018-12-07 12:19 UTC (permalink / raw)
To: Lee Jones
Cc: Pascal PAILLET-LME, dmitry.torokhov@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, lgirdwood@gmail.com, wim@linux-watchdog.org,
linux@roeck-us.net, linux-input@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-watchdog@vger.kernel.org, benjamin.gaignard@linaro.org,
eballetbo@gmail.com, axel.lin@ingics.com
In-Reply-To: <20181207073132.GH26661@dell>
[-- Attachment #1: Type: text/plain, Size: 587 bytes --]
On Fri, Dec 07, 2018 at 07:31:32AM +0000, Lee Jones wrote:
> On Wed, 05 Dec 2018, Pascal PAILLET-LME wrote:
> > Hi Lee, I have received an email from Mark telliing that the regulator
> > patch is applied on
> > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
> > I can see it on the branch regul/for-next.
> Does your patch tracker only reply to the author?
> Any reason why I don't see it?
It gets sent to anyone in patchwork. It is possible there was some
problem talking to patchwork, or that your mail system has filtered the
mail.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] HID: input: support Microsoft wireless radio control hotkey
From: Benjamin Tissoires @ 2018-12-07 13:01 UTC (permalink / raw)
To: chiu
Cc: Jiri Kosina, Henrik Rydberg, open list:HID CORE LAYER, lkml,
Linux Upstreaming Team
In-Reply-To: <20181203064621.69876-2-chiu@endlessm.com>
On Mon, Dec 3, 2018 at 7:46 AM Chris Chiu <chiu@endlessm.com> wrote:
>
> The ASUS laptops start to support the airplane mode radio management
> to replace the original mechanism of airplane mode toggle hotkey.
> On the ASUS P5440FF, it presents as a HID device connecting via
> I2C, named i2c-AMPD0001. When pressing it, the Embedded Controller
> send hid report via I2C and switch the airplane mode indicator LED
> based on the status.
>
> However, it's not working because it fails to be identified as a
> hidinput device. It fails in hidinput_connect() due to the macro
> IS_INPUT_APPLICATION doesn't have HID_GD_WIRELESS_RADIO_CTLS as
> a legit application code.
>
> It's easy to add the HID I2C vendor and product id to the quirk
> list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it
> makes more sense to support it as a generic input application.
>
> Signed-off-by: Chris Chiu <chiu@endlessm.com>
> ---
Thanks for the refresh of the series. It looks much better now.
I have scheduled this for 4.21. I am a bit hesitant in pushing changes
to 4.20 when they touch hid-input.c, especially when we are this late
in the process.
Cheers,
Benjamin
> include/linux/hid.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index ce5f996c8d3d..42079116fb61 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -840,7 +840,8 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
> #define IS_INPUT_APPLICATION(a) \
> (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
> || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
> - || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL))
> + || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \
> + || (a == HID_GD_WIRELESS_RADIO_CTLS))
>
> /* HID core API */
>
> --
> 2.19.1
>
^ permalink raw reply
* Re: [PATCH] HID: input: support Microsoft wireless radio control hotkey
From: Benjamin Tissoires @ 2018-12-07 13:02 UTC (permalink / raw)
To: chiu
Cc: Jiri Kosina, Henrik Rydberg, open list:HID CORE LAYER, lkml,
Linux Upstreaming Team
In-Reply-To: <CAB4CAwf34ZvF88rVCz2H6iDKoDHF09txp1oGqvUfCt18ZH-w6w@mail.gmail.com>
On Fri, Dec 7, 2018 at 5:07 AM Chris Chiu <chiu@endlessm.com> wrote:
>
> On Wed, Dec 5, 2018 at 8:56 AM Chris Chiu <chiu@endlessm.com> wrote:
> >
> > On Fri, Nov 30, 2018 at 7:18 PM Benjamin Tissoires
> > <benjamin.tissoires@redhat.com> wrote:
> > >
> > > On Fri, Nov 30, 2018 at 7:46 AM Chris Chiu <chiu@endlessm.com> wrote:
> > > >
> > > > The ASUS laptops start to support the airplane mode radio management
> > > > to replace the original machanism of airplane mode toggle hotkey.
> > > > On the ASUS P5440FF, it presents as a HID device connecting via
> > > > I2C, name i2c-AMPD0001. When pressing hotkey, the Embedded Controller
> > > > send hid report up via I2C and switch the airplane mode indicator
> > > > LED based on the status.
> > > >
> > > > However, it's not working because it fails to be identified as a
> > > > hidinput device. It fails in hidinput_connect() due to the macro
> > > > IS_INPUT_APPLICATION doesn't identify HID_GD_WIRELESS_RADIO_CTLS
> > > > as a legit application code.
> > > >
> > > > It's easy to add the HID I2C vendor and product id to the quirk
> > > > list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it
> > > > can be more generic to support such kind of application on PC.
> > >
> > > Sounds good, but while you are at it, can you please:
> > > - fix the kbuild warning
> > > - rewrite the whole line to use macros,
> > > - make the macro prettier by inserting new lines were required
> > > - and define the missing macro:
> > > 0x000d0006 -> HID_DG_WHITEBOARD
> > >
> > > Maybe we should keep the ranges definitions with raw values and put a
> > > comment on the side with the names.
> > >
> > > Cheers,
> > > Benjamin
> > >
> >
> > Hi Bejamin,
> > Thanks for your comment, I've submitted other patches which may
> > fulfill your suggestion.
> > https://lore.kernel.org/patchwork/patch/1020373/
> > https://lore.kernel.org/patchwork/patch/1020374/
> >
> > Please help me review and correct me if there's any modification
> > required. Thanks & Regards.
> >
> > Chris
> >
>
> Gentle ping. Any comment for the new patch? Thanks and Regards.
>
Sorry for the delay. I broke my system and it took me a few days to
get it back on its feet.
The v2 is now scheduled for 4.21.
Cheers,
Benjamin
^ permalink raw reply
* Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
From: Benjamin Tissoires @ 2018-12-07 14:23 UTC (permalink / raw)
To: bianpan2016
Cc: Srinivas Pandruvada, Jiri Kosina, open list:HID CORE LAYER, lkml
In-Reply-To: <1542847953-127599-1-git-send-email-bianpan2016@163.com>
On Thu, Nov 22, 2018 at 1:52 AM Pan Bian <bianpan2016@163.com> wrote:
>
> The memory chunk allocated by hid_allocate_device() should be released
> by hid_destroy_device(), not kfree().
>
> Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
> index cd23903..e918d78 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
> err_hid_device:
> kfree(hid_data);
> err_hid_data:
> - kfree(hid);
> + hid_destroy_device(hid);
Looks good to me. Srinivas, any comments?
FWIW:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Jiri, do you think we should send this one as 4.20/fixes material or
wait for 4.21?
Cheers,
Benjamin
> return rv;
> }
>
> --
> 2.7.4
>
>
^ permalink raw reply
* Re: [PATCH] Input: restore EV_ABS ABS_RESERVED
From: Benjamin Tissoires @ 2018-12-07 14:28 UTC (permalink / raw)
To: Dmitry Torokhov, Jiri Kosina
Cc: Peter Hutterer, Martin Kepplinger, linux-input, linux-kernel
In-Reply-To: <20181206225619.GA34001@dtor-ws>
On Thu, Dec 6, 2018 at 11:56 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Fri, Dec 07, 2018 at 08:46:05AM +1000, Peter Hutterer wrote:
> > On Thu, Dec 06, 2018 at 10:24:11AM +0100, Benjamin Tissoires wrote:
> > > On Thu, Dec 6, 2018 at 9:36 AM Martin Kepplinger
> > > <martin.kepplinger@ginzinger.com> wrote:
> > > >
> > > > On 06.12.18 00:03, Peter Hutterer wrote:
> > > > > ABS_RESERVED was added in d9ca1c990a7 and accidentally removed as part of
> > > > > ffe0e7cf290f5c9 when the high-resolution scrolling code was removed.
> > > > >
> > > > > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > > >
> > > > Reviewed-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
> > >
> > > Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > >
> > > Dmitry, I do not think this one will conflict with the high res wheel
> > > patches, so I think it should be safe to take it through your tree.
> > > If you think it'll be an issue, I can also take it through the HID one.
> >
> > fwiw, patch was made on top of v4.20-rc5, so it shouldn't conflict.
>
> My tree is behind that ;) so I would actually prefer if Benjamin/Jiri
> would take it through their tree with my:
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
OK, thanks Dmitry.
Jiri, I have pushed this in for-4.20/upstream-fixes.
I think the branch has enough now to justify a PR towards Linus.
I believe https://patchwork.kernel.org/patch/10693337/ would be a good
material too, but OTOH, this only happens when the device fails at
probing, so maybe not so urgent.
Cheers,
Benjamin
> Thanks.
>
> --
> Dmitry
^ permalink raw reply
* [PATCH v4 0/3] Input: atmel_mxt_ts: Add support for optional regulators
From: Paweł Chmiel @ 2018-12-07 14:28 UTC (permalink / raw)
To: nick
Cc: dmitry.torokhov, robh+dt, mark.rutland, nicolas.ferre,
alexandre.belloni, linux-input, devicetree, linux-arm-kernel,
linux-kernel, Paweł Chmiel
This patch series adds optional regulator support to atmel_mxt_ts.
First patch adds regulators to driver.
Second patch ensures that device is ready for communication.
Third patch updates documentation.
Changes from v3:
- Checkpatch fixes
- Drop punctuation from subject of one of patches
Changes from v2:
- Add reviewed-by to one patch
- Move code for enabling regulators into separate method,
to make code more readable.
- Add wait code, to ensure that device is ready for communication.
Changes from v1:
- Enable regulators only if reset_gpio is present.
- Switch from devm_regulator_get_optional to devm_regulator_get.
Paweł Chmiel (3):
Input: atmel_mxt_ts: Add support for optional regulators
Input: atmel_mxt_ts: Wait for device be ready for communication
Input: atmel_mxt_ts: Document optional voltage regulators
.../bindings/input/atmel,maxtouch.txt | 8 ++
drivers/input/touchscreen/atmel_mxt_ts.c | 76 +++++++++++++++++--
2 files changed, 78 insertions(+), 6 deletions(-)
--
2.17.1
^ permalink raw reply
* [PATCH v4 1/3] Input: atmel_mxt_ts: Add support for optional regulators
From: Paweł Chmiel @ 2018-12-07 14:28 UTC (permalink / raw)
To: nick
Cc: dmitry.torokhov, robh+dt, mark.rutland, nicolas.ferre,
alexandre.belloni, linux-input, devicetree, linux-arm-kernel,
linux-kernel, Paweł Chmiel
In-Reply-To: <20181207142857.15818-1-pawel.mikolaj.chmiel@gmail.com>
This patch adds optional regulators, which can be used to power
up touchscreen. After enabling regulators, we need to wait 150msec.
This value is taken from official driver.
It was tested on Samsung Galaxy i9000 (based on Samsung S5PV210 SOC).
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
Changes from v3:
- Fix checkpatch issues
- Drop sentence punctuation from subject of one of patches
Changes from v2:
- Move code enabling regulators into separate method,
to make code more readable.
Changes from v1:
- Enable regulators only if reset_gpio is present.
- Switch from devm_regulator_get_optional to devm_regulator_get
---
drivers/input/touchscreen/atmel_mxt_ts.c | 65 +++++++++++++++++++++---
1 file changed, 59 insertions(+), 6 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index d3aacd534e9c..1dc8ad0da5af 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -27,6 +27,7 @@
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/property.h>
+#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <asm/unaligned.h>
@@ -194,10 +195,10 @@ enum t100_type {
/* Delay times */
#define MXT_BACKUP_TIME 50 /* msec */
-#define MXT_RESET_GPIO_TIME 20 /* msec */
#define MXT_RESET_INVALID_CHG 100 /* msec */
#define MXT_RESET_TIME 200 /* msec */
#define MXT_RESET_TIMEOUT 3000 /* msec */
+#define MXT_REGULATOR_DELAY 150 /* msec */
#define MXT_CRC_TIMEOUT 1000 /* msec */
#define MXT_FW_RESET_TIME 3000 /* msec */
#define MXT_FW_CHG_TIMEOUT 300 /* msec */
@@ -323,6 +324,8 @@ struct mxt_data {
struct t7_config t7_cfg;
struct mxt_dbg dbg;
struct gpio_desc *reset_gpio;
+ struct regulator *vdd_reg;
+ struct regulator *avdd_reg;
/* Cached parameters from object table */
u16 T5_address;
@@ -3038,6 +3041,38 @@ static const struct dmi_system_id chromebook_T9_suspend_dmi[] = {
{ }
};
+static int mxt_regulator_enable(struct mxt_data *data)
+{
+ int error;
+
+ if (data->reset_gpio) {
+ error = regulator_enable(data->vdd_reg);
+ if (error) {
+ dev_err(&data->client->dev,
+ "Failed to enable vdd regulator: %d\n", error);
+ return error;
+ }
+
+ error = regulator_enable(data->avdd_reg);
+ if (error) {
+ dev_err(&data->client->dev,
+ "Failed to enable avdd regulator: %d\n", error);
+ return error;
+ }
+
+ /*
+ * According to maXTouch power sequencing specification,
+ * RESET line must be kept low until some time
+ * after regulators come up to voltage
+ */
+ msleep(MXT_REGULATOR_DELAY);
+ gpiod_set_value(data->reset_gpio, 1);
+ msleep(MXT_RESET_INVALID_CHG);
+ }
+
+ return 0;
+}
+
static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct mxt_data *data;
@@ -3098,6 +3133,22 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
return error;
}
+ data->vdd_reg = devm_regulator_get(&client->dev, "vdd");
+ if (IS_ERR(data->vdd_reg)) {
+ error = PTR_ERR(data->vdd_reg);
+ dev_err(&client->dev, "Failed to get vdd regulator: %d\n",
+ error);
+ return error;
+ }
+
+ data->avdd_reg = devm_regulator_get(&client->dev, "avdd");
+ if (IS_ERR(data->avdd_reg)) {
+ error = PTR_ERR(data->avdd_reg);
+ dev_err(&client->dev, "Failed to get avdd regulator: %d\n",
+ error);
+ return error;
+ }
+
error = devm_request_threaded_irq(&client->dev, client->irq,
NULL, mxt_interrupt, IRQF_ONESHOT,
client->name, data);
@@ -3108,11 +3159,9 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
disable_irq(client->irq);
- if (data->reset_gpio) {
- msleep(MXT_RESET_GPIO_TIME);
- gpiod_set_value(data->reset_gpio, 1);
- msleep(MXT_RESET_INVALID_CHG);
- }
+ error = mxt_regulator_enable(data);
+ if (error)
+ return error;
error = mxt_initialize(data);
if (error)
@@ -3138,6 +3187,10 @@ static int mxt_remove(struct i2c_client *client)
struct mxt_data *data = i2c_get_clientdata(client);
disable_irq(data->irq);
+ if (data->reset_gpio) {
+ regulator_disable(data->avdd_reg);
+ regulator_disable(data->vdd_reg);
+ }
sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);
mxt_free_input_device(data);
mxt_free_object_table(data);
--
2.17.1
^ permalink raw reply related
* [PATCH v4 2/3] Input: atmel_mxt_ts: Wait for device be ready for communication
From: Paweł Chmiel @ 2018-12-07 14:28 UTC (permalink / raw)
To: nick
Cc: dmitry.torokhov, robh+dt, mark.rutland, nicolas.ferre,
alexandre.belloni, linux-input, devicetree, linux-arm-kernel,
linux-kernel, Paweł Chmiel
In-Reply-To: <20181207142857.15818-1-pawel.mikolaj.chmiel@gmail.com>
According to documentation, device isn't ready for communication,
until firmware asserts the CHG line. Add missing wait for this.
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
Changes from v3:
- Fix checkpatch issues
---
drivers/input/touchscreen/atmel_mxt_ts.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 1dc8ad0da5af..3f956d07d09e 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -202,6 +202,7 @@ enum t100_type {
#define MXT_CRC_TIMEOUT 1000 /* msec */
#define MXT_FW_RESET_TIME 3000 /* msec */
#define MXT_FW_CHG_TIMEOUT 300 /* msec */
+#define MXT_POWERON_DELAY 150 /* msec */
/* Command to unlock bootloader */
#define MXT_UNLOCK_CMD_MSB 0xaa
@@ -3068,6 +3069,16 @@ static int mxt_regulator_enable(struct mxt_data *data)
msleep(MXT_REGULATOR_DELAY);
gpiod_set_value(data->reset_gpio, 1);
msleep(MXT_RESET_INVALID_CHG);
+
+retry_wait:
+ reinit_completion(&data->bl_completion);
+ data->in_bootloader = true;
+ error = mxt_wait_for_completion(data, &data->bl_completion,
+ MXT_POWERON_DELAY);
+ if (error == -EINTR)
+ goto retry_wait;
+
+ data->in_bootloader = false;
}
return 0;
--
2.17.1
^ permalink raw reply related
* [PATCH v4 3/3] Input: atmel_mxt_ts: Document optional voltage regulators
From: Paweł Chmiel @ 2018-12-07 14:28 UTC (permalink / raw)
To: nick
Cc: dmitry.torokhov, robh+dt, mark.rutland, nicolas.ferre,
alexandre.belloni, linux-input, devicetree, linux-arm-kernel,
linux-kernel, Paweł Chmiel
In-Reply-To: <20181207142857.15818-1-pawel.mikolaj.chmiel@gmail.com>
Document new optional voltage regulators, which can be used
to power down/up touchscreen.
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes from v1:
- Added reviewed-by
---
.../devicetree/bindings/input/atmel,maxtouch.txt | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index c88919480d37..17930ecadad3 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -31,6 +31,12 @@ Optional properties for main touchpad device:
- reset-gpios: GPIO specifier for the touchscreen's reset pin (active low)
+- avdd-supply: Analog power supply. It powers up the analog channel block
+ of the controller to detect the touches.
+
+- vdd-supply: Digital power supply. It powers up the digital block
+ of the controller to enable i2c communication.
+
Example:
touch@4b {
@@ -38,4 +44,6 @@ Example:
reg = <0x4b>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_LEVEL_LOW>;
+ avdd-supply = <&atsp_reg>;
+ vdd-supply = <&tsp_reg>;
};
--
2.17.1
^ permalink raw reply related
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