Lines Matching full:error
133 int error, value = 0; in cpcap_usb_vbus_valid() local
135 error = iio_read_channel_processed(ddata->vbus, &value); in cpcap_usb_vbus_valid()
136 if (error >= 0) in cpcap_usb_vbus_valid()
139 dev_err(ddata->dev, "error reading VBUS: %i\n", error); in cpcap_usb_vbus_valid()
170 int val, error; in cpcap_phy_get_ints_state() local
172 error = regmap_read(ddata->reg, CPCAP_REG_INTS1, &val); in cpcap_phy_get_ints_state()
173 if (error) in cpcap_phy_get_ints_state()
174 return error; in cpcap_phy_get_ints_state()
180 error = regmap_read(ddata->reg, CPCAP_REG_INTS2, &val); in cpcap_phy_get_ints_state()
181 if (error) in cpcap_phy_get_ints_state()
182 return error; in cpcap_phy_get_ints_state()
189 error = regmap_read(ddata->reg, CPCAP_REG_INTS4, &val); in cpcap_phy_get_ints_state()
190 if (error) in cpcap_phy_get_ints_state()
191 return error; in cpcap_phy_get_ints_state()
205 int error; in cpcap_usb_try_musb_mailbox() local
207 error = musb_mailbox(status); in cpcap_usb_try_musb_mailbox()
208 if (!error) in cpcap_usb_try_musb_mailbox()
212 __func__, error); in cpcap_usb_try_musb_mailbox()
220 int error; in cpcap_usb_detect() local
224 error = cpcap_phy_get_ints_state(ddata, &s); in cpcap_usb_detect()
225 if (error) in cpcap_usb_detect()
236 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3, in cpcap_usb_detect()
240 if (error) in cpcap_usb_detect()
260 error = cpcap_usb_set_usb_mode(ddata); in cpcap_usb_detect()
261 if (error) in cpcap_usb_detect()
282 error = cpcap_usb_set_usb_mode(ddata); in cpcap_usb_detect()
283 if (error) in cpcap_usb_detect()
288 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3, in cpcap_usb_detect()
292 if (error) in cpcap_usb_detect()
298 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3, in cpcap_usb_detect()
301 if (error) in cpcap_usb_detect()
309 error = cpcap_usb_set_usb_mode(ddata); in cpcap_usb_detect()
310 if (error) in cpcap_usb_detect()
322 error = cpcap_usb_set_uart_mode(ddata); in cpcap_usb_detect()
323 if (error) in cpcap_usb_detect()
331 dev_err(ddata->dev, "error setting cable state: %i\n", error); in cpcap_usb_detect()
350 int irq, error; in cpcap_usb_init_irq() local
356 error = devm_request_threaded_irq(ddata->dev, irq, NULL, in cpcap_usb_init_irq()
361 if (error) { in cpcap_usb_init_irq()
363 name, error); in cpcap_usb_init_irq()
365 return error; in cpcap_usb_init_irq()
385 int i, error; in cpcap_usb_init_interrupts() local
388 error = cpcap_usb_init_irq(pdev, ddata, cpcap_phy_irqs[i]); in cpcap_usb_init_interrupts()
389 if (error) in cpcap_usb_init_interrupts()
390 return error; in cpcap_usb_init_interrupts()
416 int error; in cpcap_usb_set_uart_mode() local
419 error = cpcap_usb_gpio_set_mode(ddata, CPCAP_UNKNOWN_DISABLED); in cpcap_usb_set_uart_mode()
420 if (error) in cpcap_usb_set_uart_mode()
424 error = pinctrl_select_state(ddata->pins, ddata->pins_uart); in cpcap_usb_set_uart_mode()
425 if (error) in cpcap_usb_set_uart_mode()
429 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC1, in cpcap_usb_set_uart_mode()
432 if (error) in cpcap_usb_set_uart_mode()
435 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC2, in cpcap_usb_set_uart_mode()
438 if (error) in cpcap_usb_set_uart_mode()
441 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3, 0x7fff, in cpcap_usb_set_uart_mode()
443 if (error) in cpcap_usb_set_uart_mode()
447 error = cpcap_usb_gpio_set_mode(ddata, CPCAP_DM_DP); in cpcap_usb_set_uart_mode()
448 if (error) in cpcap_usb_set_uart_mode()
454 dev_err(ddata->dev, "%s failed with %i\n", __func__, error); in cpcap_usb_set_uart_mode()
456 return error; in cpcap_usb_set_uart_mode()
461 int error; in cpcap_usb_set_usb_mode() local
464 error = cpcap_usb_gpio_set_mode(ddata, CPCAP_UNKNOWN_DISABLED); in cpcap_usb_set_usb_mode()
465 if (error) in cpcap_usb_set_usb_mode()
466 return error; in cpcap_usb_set_usb_mode()
469 error = pinctrl_select_state(ddata->pins, ddata->pins_utmi); in cpcap_usb_set_usb_mode()
470 if (error) { in cpcap_usb_set_usb_mode()
472 error); in cpcap_usb_set_usb_mode()
474 return error; in cpcap_usb_set_usb_mode()
478 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC1, in cpcap_usb_set_usb_mode()
480 if (error) in cpcap_usb_set_usb_mode()
483 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC3, in cpcap_usb_set_usb_mode()
489 if (error) in cpcap_usb_set_usb_mode()
492 error = regmap_update_bits(ddata->reg, CPCAP_REG_USBC2, in cpcap_usb_set_usb_mode()
495 if (error) in cpcap_usb_set_usb_mode()
499 error = cpcap_usb_gpio_set_mode(ddata, CPCAP_OTG_DM_DP); in cpcap_usb_set_usb_mode()
500 if (error) in cpcap_usb_set_usb_mode()
506 dev_err(ddata->dev, "%s failed with %i\n", __func__, error); in cpcap_usb_set_usb_mode()
508 return error; in cpcap_usb_set_usb_mode()
564 int error; in cpcap_usb_init_iio() local
568 error = PTR_ERR(ddata->vbus); in cpcap_usb_init_iio()
573 error = -ENXIO; in cpcap_usb_init_iio()
577 error = iio_get_channel_type(ddata->vbus, &type); in cpcap_usb_init_iio()
578 if (error < 0) in cpcap_usb_init_iio()
582 error = -EINVAL; in cpcap_usb_init_iio()
590 error); in cpcap_usb_init_iio()
592 return error; in cpcap_usb_init_iio()
614 int error; in cpcap_usb_phy_probe() local
643 error = regulator_enable(ddata->vusb); in cpcap_usb_phy_probe()
644 if (error) in cpcap_usb_phy_probe()
645 return error; in cpcap_usb_phy_probe()
649 error = PTR_ERR(generic_phy); in cpcap_usb_phy_probe()
658 error = PTR_ERR(phy_provider); in cpcap_usb_phy_probe()
662 error = cpcap_usb_init_optional_pins(ddata); in cpcap_usb_phy_probe()
663 if (error) in cpcap_usb_phy_probe()
668 error = cpcap_usb_init_iio(ddata); in cpcap_usb_phy_probe()
669 if (error) in cpcap_usb_phy_probe()
672 error = cpcap_usb_init_interrupts(pdev, ddata); in cpcap_usb_phy_probe()
673 if (error) in cpcap_usb_phy_probe()
685 return error; in cpcap_usb_phy_probe()
691 int error; in cpcap_usb_phy_remove() local
694 error = cpcap_usb_set_uart_mode(ddata); in cpcap_usb_phy_remove()
695 if (error) in cpcap_usb_phy_remove()