Lines Matching refs:pdata
23 struct w1_gpio_platform_data *pdata = data; in w1_gpio_set_pullup() local
26 pdata->pullup_duration = delay; in w1_gpio_set_pullup()
28 if (pdata->pullup_duration) { in w1_gpio_set_pullup()
33 gpiod_set_raw_value(pdata->gpiod, 1); in w1_gpio_set_pullup()
34 msleep(pdata->pullup_duration); in w1_gpio_set_pullup()
39 gpiod_set_value(pdata->gpiod, 1); in w1_gpio_set_pullup()
41 pdata->pullup_duration = 0; in w1_gpio_set_pullup()
49 struct w1_gpio_platform_data *pdata = data; in w1_gpio_write_bit() local
51 gpiod_set_value(pdata->gpiod, bit); in w1_gpio_write_bit()
56 struct w1_gpio_platform_data *pdata = data; in w1_gpio_read_bit() local
58 return gpiod_get_value(pdata->gpiod) ? 1 : 0; in w1_gpio_read_bit()
72 struct w1_gpio_platform_data *pdata; in w1_gpio_probe() local
80 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); in w1_gpio_probe()
81 if (!pdata) in w1_gpio_probe()
93 pdev->dev.platform_data = pdata; in w1_gpio_probe()
95 pdata = dev_get_platdata(dev); in w1_gpio_probe()
97 if (!pdata) { in w1_gpio_probe()
109 pdata->gpiod = devm_gpiod_get_index(dev, NULL, 0, gflags); in w1_gpio_probe()
110 if (IS_ERR(pdata->gpiod)) { in w1_gpio_probe()
112 return PTR_ERR(pdata->gpiod); in w1_gpio_probe()
115 pdata->pullup_gpiod = in w1_gpio_probe()
117 if (IS_ERR(pdata->pullup_gpiod)) { in w1_gpio_probe()
120 return PTR_ERR(pdata->pullup_gpiod); in w1_gpio_probe()
123 master->data = pdata; in w1_gpio_probe()
125 gpiod_direction_output(pdata->gpiod, 1); in w1_gpio_probe()
143 if (pdata->enable_external_pullup) in w1_gpio_probe()
144 pdata->enable_external_pullup(1); in w1_gpio_probe()
146 if (pdata->pullup_gpiod) in w1_gpio_probe()
147 gpiod_set_value(pdata->pullup_gpiod, 1); in w1_gpio_probe()
157 struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); in w1_gpio_remove() local
159 if (pdata->enable_external_pullup) in w1_gpio_remove()
160 pdata->enable_external_pullup(0); in w1_gpio_remove()
162 if (pdata->pullup_gpiod) in w1_gpio_remove()
163 gpiod_set_value(pdata->pullup_gpiod, 0); in w1_gpio_remove()
172 struct w1_gpio_platform_data *pdata = dev_get_platdata(dev); in w1_gpio_suspend() local
174 if (pdata->enable_external_pullup) in w1_gpio_suspend()
175 pdata->enable_external_pullup(0); in w1_gpio_suspend()
182 struct w1_gpio_platform_data *pdata = dev_get_platdata(dev); in w1_gpio_resume() local
184 if (pdata->enable_external_pullup) in w1_gpio_resume()
185 pdata->enable_external_pullup(1); in w1_gpio_resume()