Commit 0113613f authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Stephen Boyd

Revert "Input: olpc_apsp - enable the SP clock"

Turns out this is not such a great idea. Once the SP clock is disabled,
it's not sufficient to just enable in order to bring the SP core back up.

It seems that the kernel has no business managing this clock. Just let
the firmware keep it enabled.

This reverts commit ed22cee9.

Link: https://lore.kernel.org/lkml/154783267051.169631.3197836544646625747@swboyd.mtv.corp.google.com/Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent b488517b
...@@ -4,14 +4,10 @@ Required properties: ...@@ -4,14 +4,10 @@ Required properties:
- compatible : "olpc,ap-sp" - compatible : "olpc,ap-sp"
- reg : base address and length of SoC's WTM registers - reg : base address and length of SoC's WTM registers
- interrupts : SP-AP interrupt - interrupts : SP-AP interrupt
- clocks : phandle + clock-specifier for the clock that drives the WTM
- clock-names: should be "sp"
Example: Example:
ap-sp@d4290000 { ap-sp@d4290000 {
compatible = "olpc,ap-sp"; compatible = "olpc,ap-sp";
reg = <0xd4290000 0x1000>; reg = <0xd4290000 0x1000>;
interrupts = <40>; interrupts = <40>;
clocks = <&soc_clocks MMP2_CLK_SP>;
clock-names = "sp";
} }
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.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. * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
...@@ -75,7 +74,6 @@ struct olpc_apsp { ...@@ -75,7 +74,6 @@ struct olpc_apsp {
struct serio *kbio; struct serio *kbio;
struct serio *padio; struct serio *padio;
void __iomem *base; void __iomem *base;
struct clk *clk;
int open_count; int open_count;
int irq; int irq;
}; };
...@@ -148,17 +146,11 @@ static int olpc_apsp_open(struct serio *port) ...@@ -148,17 +146,11 @@ static int olpc_apsp_open(struct serio *port)
struct olpc_apsp *priv = port->port_data; struct olpc_apsp *priv = port->port_data;
unsigned int tmp; unsigned int tmp;
unsigned long l; unsigned long l;
int error;
if (priv->open_count++ == 0) { if (priv->open_count++ == 0) {
error = clk_prepare_enable(priv->clk);
if (error)
return error;
l = readl(priv->base + COMMAND_FIFO_STATUS); l = readl(priv->base + COMMAND_FIFO_STATUS);
if (!(l & CMD_STS_MASK)) { if (!(l & CMD_STS_MASK)) {
dev_err(priv->dev, "SP cannot accept commands.\n"); dev_err(priv->dev, "SP cannot accept commands.\n");
clk_disable_unprepare(priv->clk);
return -EIO; return -EIO;
} }
...@@ -179,8 +171,6 @@ static void olpc_apsp_close(struct serio *port) ...@@ -179,8 +171,6 @@ static void olpc_apsp_close(struct serio *port)
/* Disable interrupt 0 */ /* Disable interrupt 0 */
tmp = readl(priv->base + PJ_INTERRUPT_MASK); tmp = readl(priv->base + PJ_INTERRUPT_MASK);
writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK); writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
clk_disable_unprepare(priv->clk);
} }
} }
...@@ -206,10 +196,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) ...@@ -206,10 +196,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (priv->irq < 0) if (priv->irq < 0)
return priv->irq; return priv->irq;
priv->clk = devm_clk_get(&pdev->dev, "sp");
if (IS_ERR(priv->clk))
return PTR_ERR(priv->clk);
/* KEYBOARD */ /* KEYBOARD */
kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL); kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!kb_serio) if (!kb_serio)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment