diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c index 8611fb11ca79..ced01bcf832a 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c @@ -19,6 +19,7 @@ #include #include #include +#include #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) #include @@ -2161,6 +2162,7 @@ static int goodix_ts_probe(struct platform_device *pdev) { struct goodix_ts_core *core_data = NULL; struct goodix_bus_interface *bus_interface; + struct clk *stylus_clk; int ret; ts_info("goodix_ts_probe IN"); @@ -2188,6 +2190,20 @@ static int goodix_ts_probe(struct platform_device *pdev) ts_err("failed parse device info form dts, %d", ret); return -EINVAL; } + + if (of_get_property(bus_interface->dev->of_node, "clocks", NULL)) { + stylus_clk = devm_clk_get(bus_interface->dev, "stylus_clk"); + if (IS_ERR_OR_NULL(stylus_clk)) { + ts_err("failed to get stylus clk\n"); + } else { + ret = clk_prepare_enable(stylus_clk); + if(ret) { + ts_err("failed to enable stylus clk\n"); + } else + ts_info("success to enable stylus clk\n"); + } + } + } else { ts_err("no valid device tree node found"); return -ENODEV;