Lines Matching refs:serial
193 static int f81534_logic_to_phy_port(struct usb_serial *serial, in f81534_logic_to_phy_port() argument
197 usb_get_serial_data(port->serial); in f81534_logic_to_phy_port()
214 static int f81534_set_register(struct usb_serial *serial, u16 reg, u8 data) in f81534_set_register() argument
216 struct usb_interface *interface = serial->interface; in f81534_set_register()
217 struct usb_device *dev = serial->dev; in f81534_set_register()
255 static int f81534_get_register(struct usb_serial *serial, u16 reg, u8 *data) in f81534_get_register() argument
257 struct usb_interface *interface = serial->interface; in f81534_get_register()
258 struct usb_device *dev = serial->dev; in f81534_get_register()
298 static int f81534_set_mask_register(struct usb_serial *serial, u16 reg, in f81534_set_mask_register() argument
304 status = f81534_get_register(serial, reg, &tmp); in f81534_set_mask_register()
311 return f81534_set_register(serial, reg, tmp); in f81534_set_mask_register()
314 static int f81534_set_phy_port_register(struct usb_serial *serial, int phy, in f81534_set_phy_port_register() argument
317 return f81534_set_register(serial, reg + F81534_UART_OFFSET * phy, in f81534_set_phy_port_register()
321 static int f81534_get_phy_port_register(struct usb_serial *serial, int phy, in f81534_get_phy_port_register() argument
324 return f81534_get_register(serial, reg + F81534_UART_OFFSET * phy, in f81534_get_phy_port_register()
333 return f81534_set_register(port->serial, in f81534_set_port_register()
342 return f81534_get_register(port->serial, in f81534_get_port_register()
350 static int f81534_wait_for_spi_idle(struct usb_serial *serial) in f81534_wait_for_spi_idle() argument
357 status = f81534_get_register(serial, F81534_BUS_REG_STATUS, in f81534_wait_for_spi_idle()
371 dev_err(&serial->interface->dev, in f81534_wait_for_spi_idle()
377 return f81534_set_register(serial, F81534_BUS_REG_STATUS, in f81534_wait_for_spi_idle()
381 static int f81534_get_spi_register(struct usb_serial *serial, u16 reg, in f81534_get_spi_register() argument
386 status = f81534_get_register(serial, reg, data); in f81534_get_spi_register()
390 return f81534_wait_for_spi_idle(serial); in f81534_get_spi_register()
393 static int f81534_set_spi_register(struct usb_serial *serial, u16 reg, u8 data) in f81534_set_spi_register() argument
397 status = f81534_set_register(serial, reg, data); in f81534_set_spi_register()
401 return f81534_wait_for_spi_idle(serial); in f81534_set_spi_register()
404 static int f81534_read_flash(struct usb_serial *serial, u32 address, in f81534_read_flash() argument
415 status = f81534_set_spi_register(serial, F81534_BUS_REG_START, in f81534_read_flash()
420 status = f81534_set_spi_register(serial, F81534_BUS_REG_START, in f81534_read_flash()
425 status = f81534_set_spi_register(serial, F81534_BUS_REG_START, in f81534_read_flash()
430 status = f81534_set_spi_register(serial, F81534_BUS_REG_START, in f81534_read_flash()
451 status = f81534_set_spi_register(serial, reg_tmp, in f81534_read_flash()
456 status = f81534_get_spi_register(serial, in f81534_read_flash()
731 static int f81534_find_config_idx(struct usb_serial *serial, u8 *index) in f81534_find_config_idx() argument
736 status = f81534_read_flash(serial, F81534_CUSTOM_ADDRESS_START, 1, in f81534_find_config_idx()
739 dev_err(&serial->interface->dev, "%s: read failed: %d\n", in f81534_find_config_idx()
760 static bool f81534_check_port_hw_disabled(struct usb_serial *serial, int phy) in f81534_check_port_hw_disabled() argument
770 status = f81534_get_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
778 status = f81534_set_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
784 status = f81534_get_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
789 status = f81534_set_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
794 status = f81534_set_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
801 status = f81534_get_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
806 status = f81534_set_phy_port_register(serial, phy, in f81534_check_port_hw_disabled()
835 static int f81534_calc_num_ports(struct usb_serial *serial, in f81534_calc_num_ports() argument
839 struct device *dev = &serial->interface->dev; in f81534_calc_num_ports()
853 serial_priv = devm_kzalloc(&serial->interface->dev, in f81534_calc_num_ports()
858 usb_set_serial_data(serial, serial_priv); in f81534_calc_num_ports()
862 status = f81534_find_config_idx(serial, &serial_priv->setting_idx); in f81534_calc_num_ports()
864 dev_err(&serial->interface->dev, "%s: find idx failed: %d\n", in f81534_calc_num_ports()
874 status = f81534_read_flash(serial, in f81534_calc_num_ports()
880 dev_err(&serial->interface->dev, in f81534_calc_num_ports()
886 dev_dbg(&serial->interface->dev, in f81534_calc_num_ports()
891 status = f81534_read_flash(serial, in f81534_calc_num_ports()
896 dev_err(&serial->interface->dev, in f81534_calc_num_ports()
902 dev_dbg(&serial->interface->dev, "%s: read default config\n", in f81534_calc_num_ports()
908 if (f81534_check_port_hw_disabled(serial, i)) in f81534_calc_num_ports()
918 dev_warn(&serial->interface->dev, in f81534_calc_num_ports()
929 dev_dbg(&serial->interface->dev, in f81534_calc_num_ports()
1009 static int f81534_submit_read_urb(struct usb_serial *serial, gfp_t flags) in f81534_submit_read_urb() argument
1011 return usb_serial_generic_submit_read_urbs(serial->port[0], flags); in f81534_submit_read_urb()
1081 usb_get_serial_data(port->serial); in f81534_open()
1105 status = f81534_submit_read_urb(port->serial, GFP_KERNEL); in f81534_open()
1122 usb_get_serial_data(port->serial); in f81534_close()
1123 struct usb_serial_port *port0 = port->serial->port[0]; in f81534_close()
1256 struct usb_serial *serial; in f81534_process_read_urb() local
1268 serial = port->serial; in f81534_process_read_urb()
1270 serial_priv = usb_get_serial_data(serial); in f81534_process_read_urb()
1282 port = serial->port[tty_port_num]; in f81534_process_read_urb()
1332 struct usb_serial *serial; in f81534_set_port_output_pin() local
1339 serial = port->serial; in f81534_set_port_output_pin()
1340 serial_priv = usb_get_serial_data(serial); in f81534_set_port_output_pin()
1359 status = f81534_set_mask_register(serial, in f81534_set_port_output_pin()
1377 serial_priv = usb_get_serial_data(port->serial); in f81534_port_probe()
1393 ret = f81534_logic_to_phy_port(port->serial, port); in f81534_port_probe()
1514 static int f81534_resume(struct usb_serial *serial) in f81534_resume() argument
1517 usb_get_serial_data(serial); in f81534_resume()
1530 status = f81534_submit_read_urb(serial, GFP_NOIO); in f81534_resume()
1539 for (i = 0; i < serial->num_ports; i++) { in f81534_resume()
1540 port = serial->port[i]; in f81534_resume()