Re: [PATCH] Add DCD line support to CP210x driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This behavior is expected to be enabled by default, i think.
I'm using CP210x converter with GPS connected to it and DCD line is used
as PPS discipline to NTP daemon (this is standard behavior).

Moreover, it should be nice to add CTS/DSR handling same way.

Here is the patch against latest usb-serial tree.

23.03.2016 19:25, Konstantin Shkolnyy пишет:
>> -----Original Message-----
>> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-
>> owner@xxxxxxxxxxxxxxx] On Behalf Of Valentin Yakovenkov
>> Sent: Tuesday, March 22, 2016 11:12
>> To: linux-usb@xxxxxxxxxxxxxxx
>> Subject: [PATCH] Add DCD line support to CP210x driver
> [...]
>
>>   static struct usb_serial_driver * const serial_drivers[] = {
>> @@ -460,6 +471,11 @@ static int cp210x_open(struct tty_struct *tty, struct
>> usb_serial_port *port)
>>   {
>>   	int result;
>>
>> +	struct usb_serial *serial = port->serial;
>> +	struct cp210x_serial_private *spriv = usb_get_serial_data(serial);
>> +
>> +	spriv->cp210x_tstate = CP210X_STATE_IDLE;
>> +
>>   	result = cp210x_set_config_single(port, CP210X_IFC_ENABLE,
>>
>> 	UART_ENABLE);
>>   	if (result) {
>> @@ -474,6 +490,15 @@ static int cp210x_open(struct tty_struct *tty, struct
>> usb_serial_port *port)
>>   	if (tty)
>>   		cp210x_change_speed(tty, port, NULL);
>>
>> +	/* Enable events embedding to data stream */
>> +	result = cp210x_set_config_single(port, CP210X_EMBED_EVENTS,
>> +
>> 	CP210X_ESCCHAR);
>> +	if (result) {
>> +		dev_err(&port->dev, "%s - Unable to enable event
>> embedding on UART\n",
>> +				__func__);
>> +		return result;
>> +	}
>> +
>
> This unconditionally enables the behavior every time the device is opened. Instead it needs to be enabled by the application explicitly, otherwise it'll hurt people who don't except it.
>
> [...]
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux