• Home
  • Raw
  • Download

Lines Matching refs:pdata

21 	struct max8903_pdata *pdata;  member
45 if (gpio_is_valid(data->pdata->chg)) { in max8903_get_property()
46 if (gpio_get_value(data->pdata->chg) == 0) in max8903_get_property()
74 struct max8903_pdata *pdata = data->pdata; in max8903_dcin() local
78 ta_in = gpio_get_value(pdata->dok) ? false : true; in max8903_dcin()
86 if (gpio_is_valid(pdata->dcm)) in max8903_dcin()
87 gpio_set_value(pdata->dcm, ta_in ? 1 : 0); in max8903_dcin()
90 if (gpio_is_valid(pdata->cen)) in max8903_dcin()
91 gpio_set_value(pdata->cen, ta_in ? 0 : in max8903_dcin()
115 struct max8903_pdata *pdata = data->pdata; in max8903_usbin() local
119 usb_in = gpio_get_value(pdata->uok) ? false : true; in max8903_usbin()
129 if (gpio_is_valid(pdata->cen)) in max8903_usbin()
130 gpio_set_value(pdata->cen, usb_in ? 0 : in max8903_usbin()
154 struct max8903_pdata *pdata = data->pdata; in max8903_fault() local
157 fault = gpio_get_value(pdata->flt) ? false : true; in max8903_fault()
175 struct max8903_pdata *pdata = NULL; in max8903_parse_dt_data() local
180 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); in max8903_parse_dt_data()
181 if (!pdata) in max8903_parse_dt_data()
184 pdata->dc_valid = false; in max8903_parse_dt_data()
185 pdata->usb_valid = false; in max8903_parse_dt_data()
187 pdata->cen = of_get_named_gpio(np, "cen-gpios", 0); in max8903_parse_dt_data()
188 if (!gpio_is_valid(pdata->cen)) in max8903_parse_dt_data()
189 pdata->cen = -EINVAL; in max8903_parse_dt_data()
191 pdata->chg = of_get_named_gpio(np, "chg-gpios", 0); in max8903_parse_dt_data()
192 if (!gpio_is_valid(pdata->chg)) in max8903_parse_dt_data()
193 pdata->chg = -EINVAL; in max8903_parse_dt_data()
195 pdata->flt = of_get_named_gpio(np, "flt-gpios", 0); in max8903_parse_dt_data()
196 if (!gpio_is_valid(pdata->flt)) in max8903_parse_dt_data()
197 pdata->flt = -EINVAL; in max8903_parse_dt_data()
199 pdata->usus = of_get_named_gpio(np, "usus-gpios", 0); in max8903_parse_dt_data()
200 if (!gpio_is_valid(pdata->usus)) in max8903_parse_dt_data()
201 pdata->usus = -EINVAL; in max8903_parse_dt_data()
203 pdata->dcm = of_get_named_gpio(np, "dcm-gpios", 0); in max8903_parse_dt_data()
204 if (!gpio_is_valid(pdata->dcm)) in max8903_parse_dt_data()
205 pdata->dcm = -EINVAL; in max8903_parse_dt_data()
207 pdata->dok = of_get_named_gpio(np, "dok-gpios", 0); in max8903_parse_dt_data()
208 if (!gpio_is_valid(pdata->dok)) in max8903_parse_dt_data()
209 pdata->dok = -EINVAL; in max8903_parse_dt_data()
211 pdata->dc_valid = true; in max8903_parse_dt_data()
213 pdata->uok = of_get_named_gpio(np, "uok-gpios", 0); in max8903_parse_dt_data()
214 if (!gpio_is_valid(pdata->uok)) in max8903_parse_dt_data()
215 pdata->uok = -EINVAL; in max8903_parse_dt_data()
217 pdata->usb_valid = true; in max8903_parse_dt_data()
219 return pdata; in max8903_parse_dt_data()
226 struct max8903_pdata *pdata = pdev->dev.platform_data; in max8903_setup_gpios() local
232 if (pdata->dc_valid) { in max8903_setup_gpios()
233 if (gpio_is_valid(pdata->dok)) { in max8903_setup_gpios()
234 ret = devm_gpio_request(dev, pdata->dok, in max8903_setup_gpios()
239 pdata->dok, ret); in max8903_setup_gpios()
243 gpio = pdata->dok; /* PULL_UPed Interrupt */ in max8903_setup_gpios()
251 if (gpio_is_valid(pdata->dcm)) { in max8903_setup_gpios()
252 ret = devm_gpio_request(dev, pdata->dcm, data->psy_desc.name); in max8903_setup_gpios()
256 pdata->dcm, ret); in max8903_setup_gpios()
260 gpio = pdata->dcm; /* Output */ in max8903_setup_gpios()
264 if (pdata->usb_valid) { in max8903_setup_gpios()
265 if (gpio_is_valid(pdata->uok)) { in max8903_setup_gpios()
266 ret = devm_gpio_request(dev, pdata->uok, in max8903_setup_gpios()
271 pdata->uok, ret); in max8903_setup_gpios()
275 gpio = pdata->uok; in max8903_setup_gpios()
284 if (gpio_is_valid(pdata->cen)) { in max8903_setup_gpios()
285 ret = devm_gpio_request(dev, pdata->cen, data->psy_desc.name); in max8903_setup_gpios()
289 pdata->cen, ret); in max8903_setup_gpios()
293 gpio_set_value(pdata->cen, (ta_in || usb_in) ? 0 : 1); in max8903_setup_gpios()
296 if (gpio_is_valid(pdata->chg)) { in max8903_setup_gpios()
297 ret = devm_gpio_request(dev, pdata->chg, data->psy_desc.name); in max8903_setup_gpios()
301 pdata->chg, ret); in max8903_setup_gpios()
306 if (gpio_is_valid(pdata->flt)) { in max8903_setup_gpios()
307 ret = devm_gpio_request(dev, pdata->flt, data->psy_desc.name); in max8903_setup_gpios()
311 pdata->flt, ret); in max8903_setup_gpios()
316 if (gpio_is_valid(pdata->usus)) { in max8903_setup_gpios()
317 ret = devm_gpio_request(dev, pdata->usus, data->psy_desc.name); in max8903_setup_gpios()
321 pdata->usus, ret); in max8903_setup_gpios()
337 struct max8903_pdata *pdata = pdev->dev.platform_data; in max8903_probe() local
345 if (IS_ENABLED(CONFIG_OF) && !pdata && dev->of_node) in max8903_probe()
346 pdata = max8903_parse_dt_data(dev); in max8903_probe()
348 if (!pdata) { in max8903_probe()
353 pdev->dev.platform_data = pdata; in max8903_probe()
354 data->pdata = pdata; in max8903_probe()
358 if (pdata->dc_valid == false && pdata->usb_valid == false) { in max8903_probe()
384 if (pdata->dc_valid) { in max8903_probe()
385 ret = devm_request_threaded_irq(dev, gpio_to_irq(pdata->dok), in max8903_probe()
392 gpio_to_irq(pdata->dok), ret); in max8903_probe()
397 if (pdata->usb_valid) { in max8903_probe()
398 ret = devm_request_threaded_irq(dev, gpio_to_irq(pdata->uok), in max8903_probe()
405 gpio_to_irq(pdata->uok), ret); in max8903_probe()
410 if (gpio_is_valid(pdata->flt)) { in max8903_probe()
411 ret = devm_request_threaded_irq(dev, gpio_to_irq(pdata->flt), in max8903_probe()
418 gpio_to_irq(pdata->flt), ret); in max8903_probe()