From: 张晴 Date: Wed, 9 Jul 2014 07:16:58 +0000 (+0800) Subject: rk3288:tsadc:slove pull down power_hold when power on X-Git-Tag: firefly_0821_release~4988 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5ef7714bb4632d8e7ed0b2de3d0d1ecf242f6630;p=firefly-linux-kernel-4.4.55.git rk3288:tsadc:slove pull down power_hold when power on --- diff --git a/drivers/hwmon/rockchip_tsadc.c b/drivers/hwmon/rockchip_tsadc.c index 18fc1d4d3de2..eb7002042490 100755 --- a/drivers/hwmon/rockchip_tsadc.c +++ b/drivers/hwmon/rockchip_tsadc.c @@ -468,9 +468,6 @@ int rockchip_hwmon_init(struct rockchip_temp *data) g_dev = rockchip_tsadc_data; data->plat_data = rockchip_tsadc_data; - ret = tsadc_readl(TSADC_AUTO_CON); - tsadc_writel(ret | (1 << 8) , TSADC_AUTO_CON);/*gpio0_b2 = 0 shutdown*/ - if (of_property_read_u32(np, "tsadc-ht-temp", &tsadc_ht_temp)) { dev_err(&data->pdev->dev, "Missing tsadc_ht_temp in the DT.\n"); @@ -487,15 +484,22 @@ int rockchip_hwmon_init(struct rockchip_temp *data) return -EPERM; } - uap = devm_kzalloc(&data->pdev->dev, sizeof(struct tsadc_port), - GFP_KERNEL); - if (uap == NULL) - dev_err(&data->pdev->dev, - "uap is not set %s,line=%d\n", __func__, __LINE__); - uap->pctl = devm_pinctrl_get(&data->pdev->dev); - uap->pins_default = pinctrl_lookup_state(uap->pctl, "default"); - uap->pins_tsadc_int = pinctrl_lookup_state(uap->pctl, "tsadc_int"); - pinctrl_select_state(uap->pctl, uap->pins_tsadc_int); + if (tsadc_ht_pull_gpio){ + /*bit8=1 gpio0_b2 = 1 shutdown else gpio0_b2 =1 shutdown*/ + /* + ret = tsadc_readl(TSADC_AUTO_CON); + tsadc_writel(ret | (1 << 8) , TSADC_AUTO_CON); + */ + uap = devm_kzalloc(&data->pdev->dev, sizeof(struct tsadc_port), + GFP_KERNEL); + if (uap == NULL) + dev_err(&data->pdev->dev, + "uap is not set %s,line=%d\n", __func__, __LINE__); + uap->pctl = devm_pinctrl_get(&data->pdev->dev); + uap->pins_default = pinctrl_lookup_state(uap->pctl, "default"); + uap->pins_tsadc_int = pinctrl_lookup_state(uap->pctl, "tsadc_int"); + pinctrl_select_state(uap->pctl, uap->pins_tsadc_int); + } rockchip_tsadc_set_auto_temp(1);