* [PATCH] HID: google: drop superfluous const before SIMPLE_DEV_PM_OPS()
From: Jiri Kosina @ 2018-10-09 8:48 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
From: Jiri Kosina <jkosina@suse.cz>
SIMPLE_DEV_PM_OPS() already implies const for the type; drop the extra
modifier.
Fixes: eb1aac4c8744f75460c34d71b0c73bebf3e8ee5c ("HID: google: add support tablet mode switch for Whiskers")
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
In hid.git#for-4.20/google
drivers/hid/hid-google-hammer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
index de3e7d055ca4..ee5e0bdcf078 100644
--- a/drivers/hid/hid-google-hammer.c
+++ b/drivers/hid/hid-google-hammer.c
@@ -161,7 +161,7 @@ static __maybe_unused int cbas_ec_resume(struct device *dev)
return 0;
}
-static const SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
+static SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
static void cbas_ec_set_input(struct input_dev *input)
{
--
Jiri Kosina
SUSE Labs
^ permalink raw reply related
* Re: [PATCH 1/5] mfd: ti_am335x_tscadc: Don't mark TSCADC MFD as wakeup capable
From: Lee Jones @ 2018-10-09 10:29 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-2-vigneshr@ti.com>
On Sat, 30 Jun 2018, Vignesh R wrote:
> Currently tscadc MFD is marked as wakeup capable which incorrect
> because, its actually touch event by child TSC device that wakes up the
> system. Therefore, remove device_init_wakeup() call that marks TSCADC
> device as wakeup capable in favor of moving to mark TSC input device as
> wakeup capable later.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
> drivers/mfd/ti_am335x_tscadc.c | 1 -
> 1 file changed, 1 deletion(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH 2/5] Input: ti_am335x_tsc: Mark TSC device as wakeup source
From: Lee Jones @ 2018-10-09 10:29 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-3-vigneshr@ti.com>
On Sat, 30 Jun 2018, Vignesh R wrote:
> Instead of TSCADC MFD device, mark TSC as wakeup source and change all
> wakeup related PM calls to operate on TSC device.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
> drivers/input/touchscreen/ti_am335x_tsc.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Keep ADC interface on if child is wakeup capable
From: Lee Jones @ 2018-10-09 10:30 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-4-vigneshr@ti.com>
On Sat, 30 Jun 2018, Vignesh R wrote:
> If a child device like touchscreen is wakeup capable, then keep ADC
> interface on, so that a touching resistive screen will generate wakeup
> event to the system.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
> drivers/mfd/ti_am335x_tscadc.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH 4/5] iio: adc: ti_am335x_adc: Disable ADC during suspend unconditionally
From: Lee Jones @ 2018-10-09 10:30 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-5-vigneshr@ti.com>
On Sat, 30 Jun 2018, Vignesh R wrote:
> Parent MFD device takes care of enabling ADC interface whenever
> touchscreen is marked wakeup capable. Therefore, unconditionally disable
> ADC interface during system suspend to save power in case of system with
> just ADC and no TSC.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
> drivers/iio/adc/ti_am335x_adc.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH 5/5] Input: ti_am335x_tsc: Mark IRQ as wakeup capable
From: Lee Jones @ 2018-10-09 10:30 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-6-vigneshr@ti.com>
On Sat, 30 Jun 2018, Vignesh R wrote:
> On AM335x, ti_am335x_tsc can wake up the system from suspend, mark the
> IRQ as wakeup capable, so that device irq is not disabled during system
> suspend.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
> drivers/input/touchscreen/ti_am335x_tsc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* [GIT PULL] Immutable branch between MFD, IIO and Input due for the v4.20 merge window
From: Lee Jones @ 2018-10-09 10:33 UTC (permalink / raw)
To: Vignesh R
Cc: Jonathan Cameron, Dmitry Torokhov, linux-iio, linux-omap,
linux-kernel, linux-input
In-Reply-To: <20180630103318.25355-1-vigneshr@ti.com>
Enjoy!
The following changes since commit 5b394b2ddf0347bef56e50c69a58773c94343ff3:
Linux 4.19-rc1 (2018-08-26 14:11:59 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-iio-input-v4.20
for you to fetch changes up to 7a39915b723ae46e78c5189dfb3fc889df976a8d:
Input: ti_am335x_tsc: Mark IRQ as wakeup capable (2018-10-09 11:28:31 +0100)
----------------------------------------------------------------
Immutable branch between MFD, IIO and Input due for the v4.20 merge window
----------------------------------------------------------------
Vignesh R (5):
mfd: ti_am335x_tscadc: Don't mark TSCADC MFD as wakeup capable
Input: ti_am335x_tsc: Mark TSC device as wakeup source
mfd: ti_am335x_tscadc: Keep ADC interface on if child is wakeup capable
iio: adc: ti_am335x_adc: Disable ADC during suspend unconditionally
Input: ti_am335x_tsc: Mark IRQ as wakeup capable
drivers/iio/adc/ti_am335x_adc.c | 12 ++++--------
drivers/input/touchscreen/ti_am335x_tsc.c | 22 +++++++++++++++++-----
drivers/mfd/ti_am335x_tscadc.c | 14 +++++++++++++-
3 files changed, 34 insertions(+), 14 deletions(-)
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* Re: [PATCH] HID: elan: fix spelling mistake "registred" -> "registered"
From: Jiri Kosina @ 2018-10-09 11:32 UTC (permalink / raw)
To: Colin King; +Cc: Benjamin Tissoires, linux-input, kernel-janitors, linux-kernel
In-Reply-To: <20180927140052.28166-1-colin.king@canonical.com>
On Thu, 27 Sep 2018, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in hid_err error message
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/hid/hid-elan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c
> index 07e26c3567eb..0bfd6d1b44c1 100644
> --- a/drivers/hid/hid-elan.c
> +++ b/drivers/hid/hid-elan.c
> @@ -497,7 +497,7 @@ static int elan_probe(struct hid_device *hdev, const struct hid_device_id *id)
> return 0;
>
> if (!drvdata->input) {
> - hid_err(hdev, "Input device is not registred\n");
> + hid_err(hdev, "Input device is not registered\n");
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v3 5/8] dt-bindings: input: document stpmic1 pmic onkey
From: Pascal PAILLET-LME @ 2018-10-09 13:52 UTC (permalink / raw)
To: dmitry.torokhov@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, lee.jones@linaro.org, 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
In-Reply-To: <1539016176-4072-6-git-send-email-p.paillet@st.com>
Le 10/08/2018 06:29 PM, Pascal PAILLET-LME a écrit :
> From: pascal paillet <p.paillet@st.com>
>
> The stpmic1 pmic is able to manage an onkey button. It can be configured
> to shut-down the power supplies on a long key-press with an adjustable
> duration.
>
> Signed-off-by: pascal paillet <p.paillet@st.com>
> ---
> changes in v3:
> * Replace st,onkey-long-press-seconds and st,onkey-pwroff-enabled by
> power-off-time-sec.
>
> .../devicetree/bindings/input/st,stpmic1-onkey.txt | 30 ++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
>
> diff --git a/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt b/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
> new file mode 100644
> index 0000000..8c58186
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
> @@ -0,0 +1,30 @@
> +STMicroelectronics STPMIC1 Onkey
> +
> +Required properties:
> +
> +- compatible = "st,stpmic1-onkey";
> +- interrupt-parent: phandle to the parent interrupt controller
> +- interrupts: interrupt line to use
> +- interrupt-names = "onkey-falling", "onkey-rising"
> + onkey-falling: happens when onkey is pressed; IT_PONKEY_F of pmic
> + onkey-rising: happens when onkey is released; IT_PONKEY_R of pmic
> +
> +Optional properties:
> +
> +- st,onkey-clear-cc-flag: onkey is able power on after an
> + over-current shutdown event.
> +- st,onkey-pu-inactive: onkey pull up is not active
> +- power-off-time-sec: Duration in seconds which the key should be kept
> + pressed for device to power off automatically (from 1 to 16 seconds).
> + see See Documentation/devicetree/bindings/input/keys.txt
> +
> +Example:
> +
> +onkey {
> + compatible = "st,stpmic1-onkey";
> + interrupt-parent = <&pmic>;
> + interrupts = <IT_PONKEY_F 0>,<IT_PONKEY_R 1>;
> + interrupt-names = "onkey-falling", "onkey-rising";
> + st,onkey-pwroff-enabled;
> + st,onkey-long-press-seconds = <10>;
st,onkey-pwroff-enabled and st,onkey-long-press-seconds to be replaced
by power-off-time-sec
> +};
^ permalink raw reply
* Re: [PATCH] HID: google: drop superfluous const before SIMPLE_DEV_PM_OPS()
From: Dmitry Torokhov @ 2018-10-09 17:34 UTC (permalink / raw)
To: Jiri Kosina; +Cc: open list:HID CORE LAYER, lkml
In-Reply-To: <nycvar.YFH.7.76.1810091046050.14430@cbobk.fhfr.pm>
On Tue, Oct 9, 2018 at 1:48 AM Jiri Kosina <jikos@kernel.org> wrote:
>
> From: Jiri Kosina <jkosina@suse.cz>
>
> SIMPLE_DEV_PM_OPS() already implies const for the type; drop the extra
> modifier.
>
> Fixes: eb1aac4c8744f75460c34d71b0c73bebf3e8ee5c ("HID: google: add support tablet mode switch for Whiskers")
> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
FWIW
Acked-by: Dmitry Torokhov <dtor@chromium.org>
> ---
>
> In hid.git#for-4.20/google
>
> drivers/hid/hid-google-hammer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
> index de3e7d055ca4..ee5e0bdcf078 100644
> --- a/drivers/hid/hid-google-hammer.c
> +++ b/drivers/hid/hid-google-hammer.c
> @@ -161,7 +161,7 @@ static __maybe_unused int cbas_ec_resume(struct device *dev)
> return 0;
> }
>
> -static const SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
> +static SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
>
> static void cbas_ec_set_input(struct input_dev *input)
> {
>
> --
> Jiri Kosina
> SUSE Labs
^ permalink raw reply
* Re: [PATCH v3 8/8] watchdog: stpmic1: add stpmic1 watchdog driver
From: Guenter Roeck @ 2018-10-09 21:44 UTC (permalink / raw)
To: Pascal PAILLET-LME
Cc: kbuild-all, dmitry.torokhov@gmail.com, robh+dt@kernel.org,
mark.rutland@arm.com, lee.jones@linaro.org, lgirdwood@gmail.com,
broonie@kernel.org, wim@linux-watchdog.org,
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
In-Reply-To: <201810090846.it9ed9td%fengguang.wu@intel.com>
On Tue, Oct 09, 2018 at 08:47:26AM +0800, kbuild test robot wrote:
> Hi pascal,
>
> Thank you for the patch! Perhaps something to improve:
>
[ ... ]
> 42
> 43 static int pmic_wdt_stop(struct watchdog_device *wdd)
> 44 {
> 45 struct stpmic1_wdt *wdt = watchdog_get_drvdata(wdd);
> 46
> 47 return regmap_update_bits(wdt->pmic->regmap,
> > 48 WCHDG_CR, WDT_START_MASK, ~WDT_START);
Maybe use
#define WDT_STOP 0
instead, or just write 0. ~WDT_START may be convenient but not really correct.
Guenter
^ permalink raw reply
* [PATCH v2 0/8] OLPC 1.75 Keyboard/Touchpad fixes
From: Lubomir Rintel @ 2018-10-10 14:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk
This makes keyboard/touchpad work on a DT MMP2 platform.
I believe that it would be a good idea if this, once reviewed, went in
via the input tree. The DT and CLK parts got reviews/acks.
Changes from v1:
- Basically none, just re-send, including Ack and Review tags in patches
that received them. Plus an extra Cc.
I'd be very thankful for reviews.
Lubi
^ permalink raw reply
* [PATCH v2 1/8] dt-bindings: olpc,ap-sp: add clock
From: Lubomir Rintel @ 2018-10-10 14:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
The clock is necessary for the device operation, hence it's required.
Its name, "sp", stands for "Security Processor". It is one of several
names that are used for the processor that serves as the keyboard
controller on an OLPC and is consistent with the node name.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
Documentation/devicetree/bindings/serio/olpc,ap-sp.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt b/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
index 0e72183f52bc..36603419d6f8 100644
--- a/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
+++ b/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
@@ -4,10 +4,14 @@ Required properties:
- compatible : "olpc,ap-sp"
- reg : base address and length of SoC's WTM registers
- interrupts : SP-AP interrupt
+- clocks : phandle + clock-specifier for the clock that drives the WTM
+- clock-names: should be "sp"
Example:
ap-sp@d4290000 {
compatible = "olpc,ap-sp";
reg = <0xd4290000 0x1000>;
interrupts = <40>;
+ clocks = <&soc_clocks MMP2_CLK_SP>;
+ clock-names = "sp";
}
--
2.19.0
^ permalink raw reply related
* [PATCH v2 2/8] dt-bindings: olpc,ap-sp: add GPIO lines
From: Lubomir Rintel @ 2018-10-10 14:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
Add properties describing the GPIO lines used by the keyboard controller.
The olpc-apsp driver will do happily without them, but they are still part
of the hardware description. The driver could still reserve the lines,
so that nothing else touches them.
This makes the device node almost compatible with "ps2-gpio". I'm not
adding a compatible property, because ps2-gpio would use a different
interrupt, so that we'd need to name it. And I haven't actually tried it.
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
Documentation/devicetree/bindings/serio/olpc,ap-sp.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt b/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
index 36603419d6f8..2b1b1dbb54c1 100644
--- a/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
+++ b/Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
@@ -7,6 +7,10 @@ Required properties:
- clocks : phandle + clock-specifier for the clock that drives the WTM
- clock-names: should be "sp"
+Optional properties:
+- data-gpios : GPIO line used for PS/2 interface data
+- clk-gpios : GPIO line used for PS/2 interface clock
+
Example:
ap-sp@d4290000 {
compatible = "olpc,ap-sp";
@@ -14,4 +18,6 @@ Example:
interrupts = <40>;
clocks = <&soc_clocks MMP2_CLK_SP>;
clock-names = "sp";
+ data-gpios = <&gpio 72 GPIO_ACTIVE_HIGH>;
+ clk-gpios = <&gpio 71 GPIO_ACTIVE_HIGH>;
}
--
2.19.0
^ permalink raw reply related
* [PATCH v2 3/8] dt-bindings: marvell,mmp2: Add clock id for the SP clock
From: Lubomir Rintel @ 2018-10-10 14:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
This is the clock for the "security processor" core.
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
include/dt-bindings/clock/marvell,mmp2.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/dt-bindings/clock/marvell,mmp2.h b/include/dt-bindings/clock/marvell,mmp2.h
index 228a5e234af0..7b24fc791146 100644
--- a/include/dt-bindings/clock/marvell,mmp2.h
+++ b/include/dt-bindings/clock/marvell,mmp2.h
@@ -71,6 +71,7 @@
#define MMP2_CLK_CCIC1_MIX 117
#define MMP2_CLK_CCIC1_PHY 118
#define MMP2_CLK_CCIC1_SPHY 119
+#define MMP2_CLK_SP 120
#define MMP2_NR_CLKS 200
#endif
--
2.19.0
^ permalink raw reply related
* [PATCH v2 4/8] clk: mmp2: add SP clock
From: Lubomir Rintel @ 2018-10-10 14:25 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
The "security processor", sometimes referred to as "wireless trusted
module" or "generic encrypt unit" is a low-power core present on MMP2,
that has nothing to do with security, wireless, trust or encryption.
On an OLPC machine it runs CForth and serves as a keyboard controller:
http://dev.laptop.org/git/users/wmb/cforth/tree/src/app/arm-xo-1.75/ps2.fth
The register address was obtained from the OLPC kernel, since the
datasheet seems to be the Marvell's most important business secret.
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/clk/mmp/clk-of-mmp2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c
index 0fc75c395957..1da50f827a15 100644
--- a/drivers/clk/mmp/clk-of-mmp2.c
+++ b/drivers/clk/mmp/clk-of-mmp2.c
@@ -53,6 +53,7 @@
#define APMU_DISP1 0x110
#define APMU_CCIC0 0x50
#define APMU_CCIC1 0xf4
+#define APMU_SP 0x68
#define MPMU_UART_PLL 0x14
struct mmp2_clk_unit {
@@ -209,6 +210,8 @@ static struct mmp_clk_mix_config ccic1_mix_config = {
.reg_info = DEFINE_MIX_REG_INFO(4, 16, 2, 6, 32),
};
+static DEFINE_SPINLOCK(sp_lock);
+
static struct mmp_param_mux_clk apmu_mux_clks[] = {
{MMP2_CLK_DISP0_MUX, "disp0_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP0, 6, 2, 0, &disp0_lock},
{MMP2_CLK_DISP1_MUX, "disp1_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP1, 6, 2, 0, &disp1_lock},
@@ -239,6 +242,7 @@ static struct mmp_param_gate_clk apmu_gate_clks[] = {
{MMP2_CLK_CCIC1, "ccic1_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x1b, 0x1b, 0x0, 0, &ccic1_lock},
{MMP2_CLK_CCIC1_PHY, "ccic1_phy_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x24, 0x24, 0x0, 0, &ccic1_lock},
{MMP2_CLK_CCIC1_SPHY, "ccic1_sphy_clk", "ccic1_sphy_div", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x300, 0x300, 0x0, 0, &ccic1_lock},
+ {MMP2_CLK_SP, "sp_clk", NULL, CLK_SET_RATE_PARENT, APMU_SP, 0x1b, 0x1b, 0x0, 0, &sp_lock},
};
static void mmp2_axi_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
--
2.19.0
^ permalink raw reply related
* [PATCH v2 5/8] Input: olpc_apsp: depend on CONFIG_OF
From: Lubomir Rintel @ 2018-10-10 14:25 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
This is a device-tree enabled driver. Moreover CONFIG_OLPC is specific
to the x86 platform code, while the driver is for an ARM-based laptop.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/input/serio/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index d90d9f1098ff..a4f70021b53e 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -254,7 +254,7 @@ config SERIO_APBPS2
config SERIO_OLPC_APSP
tristate "OLPC AP-SP input support"
- depends on OLPC || COMPILE_TEST
+ depends on OF
help
Say Y here if you want support for the keyboard and touchpad included
in the OLPC XO-1.75 and XO-4 laptops.
--
2.19.0
^ permalink raw reply related
* [PATCH v2 6/8] Input: olpc_apsp: check FIFO status on open(), not probe()
From: Lubomir Rintel @ 2018-10-10 14:25 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
Let's defer the FIFO status checking until open().
When we'll get a clk handle, this will allow us to defer clock enablement
until the device is actually used.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/input/serio/olpc_apsp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index 8e9a4209fcad..8b19a47dfa46 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -145,8 +145,15 @@ static int olpc_apsp_open(struct serio *port)
{
struct olpc_apsp *priv = port->port_data;
unsigned int tmp;
+ unsigned long l;
if (priv->open_count++ == 0) {
+ l = readl(priv->base + COMMAND_FIFO_STATUS);
+ if (!(l & CMD_STS_MASK)) {
+ dev_err(priv->dev, "SP cannot accept commands.\n");
+ return -EIO;
+ }
+
/* Enable interrupt 0 by clearing its bit */
tmp = readl(priv->base + PJ_INTERRUPT_MASK);
writel(tmp & ~INT_0, priv->base + PJ_INTERRUPT_MASK);
@@ -173,7 +180,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
struct olpc_apsp *priv;
struct resource *res;
struct device_node *np;
- unsigned long l;
int error;
priv = devm_kzalloc(&pdev->dev, sizeof(struct olpc_apsp), GFP_KERNEL);
@@ -192,12 +198,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (priv->irq < 0)
return priv->irq;
- l = readl(priv->base + COMMAND_FIFO_STATUS);
- if (!(l & CMD_STS_MASK)) {
- dev_err(&pdev->dev, "SP cannot accept commands.\n");
- return -EIO;
- }
-
/* KEYBOARD */
kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!kb_serio)
--
2.19.0
^ permalink raw reply related
* [PATCH v2 7/8] Input: olpc_apsp: enable the SP clock
From: Lubomir Rintel @ 2018-10-10 14:25 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
Without the clock, the keyboard controller won't operate.
Tested on an OLPC XO 1.75.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/input/serio/olpc_apsp.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index 8b19a47dfa46..fe9e19014e70 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -23,6 +23,7 @@
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/clk.h>
/*
* The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
@@ -74,6 +75,7 @@ struct olpc_apsp {
struct serio *kbio;
struct serio *padio;
void __iomem *base;
+ struct clk *clk;
int open_count;
int irq;
};
@@ -146,8 +148,13 @@ static int olpc_apsp_open(struct serio *port)
struct olpc_apsp *priv = port->port_data;
unsigned int tmp;
unsigned long l;
+ int error;
if (priv->open_count++ == 0) {
+ error = clk_prepare_enable(priv->clk);
+ if (error)
+ return error;
+
l = readl(priv->base + COMMAND_FIFO_STATUS);
if (!(l & CMD_STS_MASK)) {
dev_err(priv->dev, "SP cannot accept commands.\n");
@@ -171,6 +178,8 @@ static void olpc_apsp_close(struct serio *port)
/* Disable interrupt 0 */
tmp = readl(priv->base + PJ_INTERRUPT_MASK);
writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
+
+ clk_disable_unprepare(priv->clk);
}
}
@@ -198,6 +207,10 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (priv->irq < 0)
return priv->irq;
+ priv->clk = devm_clk_get(&pdev->dev, "sp");
+ if (IS_ERR(priv->clk))
+ return PTR_ERR(priv->clk);
+
/* KEYBOARD */
kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!kb_serio)
--
2.19.0
^ permalink raw reply related
* [PATCH v2 8/8] Input: olpc_apsp: allocate the GPIOs used
From: Lubomir Rintel @ 2018-10-10 14:25 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk,
Lubomir Rintel
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
Take the GPIO lines are used by the SP. The driver doesn't touch the
lines -- this is done to disallow anything else from fiddling with
them because that would confuse the SP firmware.
Also, the lines are now nicely visible in /sys/kernel/debug/gpio.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/input/serio/olpc_apsp.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index fe9e19014e70..287759c5f36d 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/clk.h>
+#include <linux/gpio/consumer.h>
/*
* The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
@@ -76,6 +77,8 @@ struct olpc_apsp {
struct serio *padio;
void __iomem *base;
struct clk *clk;
+ struct gpio_desc *clk_gpio;
+ struct gpio_desc *data_gpio;
int open_count;
int irq;
};
@@ -211,6 +214,16 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (IS_ERR(priv->clk))
return PTR_ERR(priv->clk);
+ priv->clk_gpio = devm_gpiod_get_optional(&pdev->dev, "clk",
+ GPIOD_ASIS);
+ if (IS_ERR(priv->clk_gpio))
+ return PTR_ERR(priv->clk_gpio);
+
+ priv->data_gpio = devm_gpiod_get_optional(&pdev->dev, "data",
+ GPIOD_ASIS);
+ if (IS_ERR(priv->data_gpio))
+ return PTR_ERR(priv->data_gpio);
+
/* KEYBOARD */
kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!kb_serio)
--
2.19.0
^ permalink raw reply related
* [PATCH] Input: elants_i2c - Use DMA safe i2c when possible
From: Stephen Boyd @ 2018-10-10 16:55 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, linux-input, Wolfram Sang
This irq handler is always reading bytes from the device into a
kmalloced buffer, so it's safe to mark this transaction as DMA safe.
This avoids bouncing the buffer when an i2c controller decides to use
DMA for a transaction.
Cc: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
drivers/input/touchscreen/elants_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index d21ca39b0fdb..be44abb8de33 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -863,7 +863,7 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev)
int i;
int len;
- len = i2c_master_recv(client, ts->buf, sizeof(ts->buf));
+ len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf));
if (len < 0) {
dev_err(&client->dev, "%s: failed to read data: %d\n",
__func__, len);
--
Sent by a computer through tubes
^ permalink raw reply related
* Re: [PATCH] Input: elants_i2c - Use DMA safe i2c when possible
From: Dmitry Torokhov @ 2018-10-10 17:07 UTC (permalink / raw)
To: Stephen Boyd; +Cc: linux-kernel, linux-input, Wolfram Sang
In-Reply-To: <20181010165517.178545-1-swboyd@chromium.org>
On Wed, Oct 10, 2018 at 09:55:17AM -0700, Stephen Boyd wrote:
> This irq handler is always reading bytes from the device into a
> kmalloced buffer, so it's safe to mark this transaction as DMA safe.
> This avoids bouncing the buffer when an i2c controller decides to use
> DMA for a transaction.
>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
No, the buffer is in kmalloc()ed memory, but it is not DMA safe, as it
it not guaranteed to be aligned on cache line size. If you want to do
DMA to it, you need to change:
struct elants_data {
...
u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned;
};
i.e. mark it ____cacheline_aligned and move it to the very end (or mark
the next element in the structure cacheline aligned as well).
Otherwise DMA might smash nearby fileds in this structire.
> ---
> drivers/input/touchscreen/elants_i2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
> index d21ca39b0fdb..be44abb8de33 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -863,7 +863,7 @@ static irqreturn_t elants_i2c_irq(int irq, void *_dev)
> int i;
> int len;
>
> - len = i2c_master_recv(client, ts->buf, sizeof(ts->buf));
> + len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf));
> if (len < 0) {
> dev_err(&client->dev, "%s: failed to read data: %d\n",
> __func__, len);
> --
> Sent by a computer through tubes
>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 7/8] Input: olpc_apsp: enable the SP clock
From: Dmitry Torokhov @ 2018-10-10 17:09 UTC (permalink / raw)
To: Lubomir Rintel
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk
In-Reply-To: <20181010142504.233467-8-lkundrak@v3.sk>
On Wed, Oct 10, 2018 at 04:25:03PM +0200, Lubomir Rintel wrote:
> Without the clock, the keyboard controller won't operate.
> Tested on an OLPC XO 1.75.
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
> drivers/input/serio/olpc_apsp.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
> index 8b19a47dfa46..fe9e19014e70 100644
> --- a/drivers/input/serio/olpc_apsp.c
> +++ b/drivers/input/serio/olpc_apsp.c
> @@ -23,6 +23,7 @@
> #include <linux/of.h>
> #include <linux/slab.h>
> #include <linux/delay.h>
> +#include <linux/clk.h>
>
> /*
> * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
> @@ -74,6 +75,7 @@ struct olpc_apsp {
> struct serio *kbio;
> struct serio *padio;
> void __iomem *base;
> + struct clk *clk;
> int open_count;
> int irq;
> };
> @@ -146,8 +148,13 @@ static int olpc_apsp_open(struct serio *port)
> struct olpc_apsp *priv = port->port_data;
> unsigned int tmp;
> unsigned long l;
> + int error;
>
> if (priv->open_count++ == 0) {
> + error = clk_prepare_enable(priv->clk);
> + if (error)
> + return error;
> +
> l = readl(priv->base + COMMAND_FIFO_STATUS);
> if (!(l & CMD_STS_MASK)) {
> dev_err(priv->dev, "SP cannot accept commands.\n");
I think you need to disable clock here.
> @@ -171,6 +178,8 @@ static void olpc_apsp_close(struct serio *port)
> /* Disable interrupt 0 */
> tmp = readl(priv->base + PJ_INTERRUPT_MASK);
> writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
> +
> + clk_disable_unprepare(priv->clk);
> }
> }
>
> @@ -198,6 +207,10 @@ static int olpc_apsp_probe(struct platform_device *pdev)
> if (priv->irq < 0)
> return priv->irq;
>
> + priv->clk = devm_clk_get(&pdev->dev, "sp");
> + if (IS_ERR(priv->clk))
> + return PTR_ERR(priv->clk);
> +
> /* KEYBOARD */
> kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
> if (!kb_serio)
> --
> 2.19.0
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 8/8] Input: olpc_apsp: allocate the GPIOs used
From: Dmitry Torokhov @ 2018-10-10 17:10 UTC (permalink / raw)
To: Lubomir Rintel
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk
In-Reply-To: <20181010142504.233467-9-lkundrak@v3.sk>
On Wed, Oct 10, 2018 at 04:25:04PM +0200, Lubomir Rintel wrote:
> Take the GPIO lines are used by the SP. The driver doesn't touch the
> lines -- this is done to disallow anything else from fiddling with
> them because that would confuse the SP firmware.
>
> Also, the lines are now nicely visible in /sys/kernel/debug/gpio.
Linus, is this something that should be handled by GPIO "hogs"?
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
> drivers/input/serio/olpc_apsp.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
> index fe9e19014e70..287759c5f36d 100644
> --- a/drivers/input/serio/olpc_apsp.c
> +++ b/drivers/input/serio/olpc_apsp.c
> @@ -24,6 +24,7 @@
> #include <linux/slab.h>
> #include <linux/delay.h>
> #include <linux/clk.h>
> +#include <linux/gpio/consumer.h>
>
> /*
> * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
> @@ -76,6 +77,8 @@ struct olpc_apsp {
> struct serio *padio;
> void __iomem *base;
> struct clk *clk;
> + struct gpio_desc *clk_gpio;
> + struct gpio_desc *data_gpio;
> int open_count;
> int irq;
> };
> @@ -211,6 +214,16 @@ static int olpc_apsp_probe(struct platform_device *pdev)
> if (IS_ERR(priv->clk))
> return PTR_ERR(priv->clk);
>
> + priv->clk_gpio = devm_gpiod_get_optional(&pdev->dev, "clk",
> + GPIOD_ASIS);
> + if (IS_ERR(priv->clk_gpio))
> + return PTR_ERR(priv->clk_gpio);
> +
> + priv->data_gpio = devm_gpiod_get_optional(&pdev->dev, "data",
> + GPIOD_ASIS);
> + if (IS_ERR(priv->data_gpio))
> + return PTR_ERR(priv->data_gpio);
> +
> /* KEYBOARD */
> kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
> if (!kb_serio)
> --
> 2.19.0
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 8/8] Input: olpc_apsp: allocate the GPIOs used
From: Dmitry Torokhov @ 2018-10-10 17:11 UTC (permalink / raw)
To: Lubomir Rintel, Linus Walleij
Cc: Michael Turquette, Rob Herring, Mark Rutland, Stephen Boyd,
James Cameron, linux-input, devicetree, linux-kernel, linux-clk
In-Reply-To: <20181010171013.GD47260@dtor-ws>
On Wed, Oct 10, 2018 at 10:10:13AM -0700, Dmitry Torokhov wrote:
> On Wed, Oct 10, 2018 at 04:25:04PM +0200, Lubomir Rintel wrote:
> > Take the GPIO lines are used by the SP. The driver doesn't touch the
> > lines -- this is done to disallow anything else from fiddling with
> > them because that would confuse the SP firmware.
> >
> > Also, the lines are now nicely visible in /sys/kernel/debug/gpio.
>
> Linus, is this something that should be handled by GPIO "hogs"?
Argh, meant to add Linus Walleij here.
>
> >
> > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > ---
> > drivers/input/serio/olpc_apsp.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
> > index fe9e19014e70..287759c5f36d 100644
> > --- a/drivers/input/serio/olpc_apsp.c
> > +++ b/drivers/input/serio/olpc_apsp.c
> > @@ -24,6 +24,7 @@
> > #include <linux/slab.h>
> > #include <linux/delay.h>
> > #include <linux/clk.h>
> > +#include <linux/gpio/consumer.h>
> >
> > /*
> > * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
> > @@ -76,6 +77,8 @@ struct olpc_apsp {
> > struct serio *padio;
> > void __iomem *base;
> > struct clk *clk;
> > + struct gpio_desc *clk_gpio;
> > + struct gpio_desc *data_gpio;
> > int open_count;
> > int irq;
> > };
> > @@ -211,6 +214,16 @@ static int olpc_apsp_probe(struct platform_device *pdev)
> > if (IS_ERR(priv->clk))
> > return PTR_ERR(priv->clk);
> >
> > + priv->clk_gpio = devm_gpiod_get_optional(&pdev->dev, "clk",
> > + GPIOD_ASIS);
> > + if (IS_ERR(priv->clk_gpio))
> > + return PTR_ERR(priv->clk_gpio);
> > +
> > + priv->data_gpio = devm_gpiod_get_optional(&pdev->dev, "data",
> > + GPIOD_ASIS);
> > + if (IS_ERR(priv->data_gpio))
> > + return PTR_ERR(priv->data_gpio);
> > +
> > /* KEYBOARD */
> > kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
> > if (!kb_serio)
> > --
> > 2.19.0
> >
>
> --
> Dmitry
--
Dmitry
^ 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