Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 ed22cee91a88c47e564478b012fdbcb079653499.

Link: https://lore.kernel.org/lkml/154783267051.169631.3197836544646625747@swboyd.mtv.corp.google.com/
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Lubomir Rintel and committed by
Stephen Boyd
0113613f b488517b

-18
-4
Documentation/devicetree/bindings/serio/olpc,ap-sp.txt
··· 4 4 - compatible : "olpc,ap-sp" 5 5 - reg : base address and length of SoC's WTM registers 6 6 - interrupts : SP-AP interrupt 7 - - clocks : phandle + clock-specifier for the clock that drives the WTM 8 - - clock-names: should be "sp" 9 7 10 8 Example: 11 9 ap-sp@d4290000 { 12 10 compatible = "olpc,ap-sp"; 13 11 reg = <0xd4290000 0x1000>; 14 12 interrupts = <40>; 15 - clocks = <&soc_clocks MMP2_CLK_SP>; 16 - clock-names = "sp"; 17 13 }
-14
drivers/input/serio/olpc_apsp.c
··· 23 23 #include <linux/of.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/delay.h> 26 - #include <linux/clk.h> 27 26 28 27 /* 29 28 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller. ··· 74 75 struct serio *kbio; 75 76 struct serio *padio; 76 77 void __iomem *base; 77 - struct clk *clk; 78 78 int open_count; 79 79 int irq; 80 80 }; ··· 146 148 struct olpc_apsp *priv = port->port_data; 147 149 unsigned int tmp; 148 150 unsigned long l; 149 - int error; 150 151 151 152 if (priv->open_count++ == 0) { 152 - error = clk_prepare_enable(priv->clk); 153 - if (error) 154 - return error; 155 - 156 153 l = readl(priv->base + COMMAND_FIFO_STATUS); 157 154 if (!(l & CMD_STS_MASK)) { 158 155 dev_err(priv->dev, "SP cannot accept commands.\n"); 159 - clk_disable_unprepare(priv->clk); 160 156 return -EIO; 161 157 } 162 158 ··· 171 179 /* Disable interrupt 0 */ 172 180 tmp = readl(priv->base + PJ_INTERRUPT_MASK); 173 181 writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK); 174 - 175 - clk_disable_unprepare(priv->clk); 176 182 } 177 183 } 178 184 ··· 195 205 priv->irq = platform_get_irq(pdev, 0); 196 206 if (priv->irq < 0) 197 207 return priv->irq; 198 - 199 - priv->clk = devm_clk_get(&pdev->dev, "sp"); 200 - if (IS_ERR(priv->clk)) 201 - return PTR_ERR(priv->clk); 202 208 203 209 /* KEYBOARD */ 204 210 kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);