lkml.org 
[lkml]   [2007]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND] max3100 driver

On Dec 28 2007 14:01, chripell@gmail.com wrote:
>+
>+ * The initial minor number is 128 to prevent clashes with ttyS:
>+ * mknod /dev/ttyMAX0 c 4 128
>+ */

[4:128] is taken by ttyS64. Please look into Documentation/devices.txt.

>+struct max3100_port_s {
>+ struct uart_port port;
>+ struct spi_device *spi;
>+ struct tty_struct *tty;
>+
>+ struct mutex spi_txrx;/* protects access to the hw */
>+
>+ int rts; /* rts status, can be MAX3100_RTS or 0 */

possibly be bool then, if it only takes on two values?

>+ int conf; /* configuration for the MAX31000
>+ * (bits 0-7, bits 8-11 are irqs) */
>+ int last_cts_rx; /* last CTS received for flow ctrl */
>+
>+ int tx_buf_cur; /* current char to tx */
>+ int tx_buf_tot; /* current number of chars in tx buf */

Probably unsigned?

>+static int max3100_do_parity(struct max3100_port_s *s, u16 c)
>+{
>+ int parity;
>+ int i, n;
>+
>+ if (s->parity & MAX3100_PARITY_ODD)
>+ parity = 0;
>+ else
>+ parity = 1;

Or
parity = !!(s->parity & MAX3100_PARITY_ODD);
n = (s->parity & MAX3100_7BIT) ? 7 : 8;
(up to you)

>+ for (i = 0; i < n; i++)
>+ parity = parity ^ ((c>>i) & 1);

parity ^= (c >> i) & 1;

>+ return parity;
>+}
>+
>+ if (s->loopback) {
>+ if ((tx & MAX3100_CMD) == MAX3100_RC)
>+ tx |= 1;
>+ }

if (s->loopback && (tx & MAX3100_CMD) == MAX3100_RC)
tx |= 1;

>+MODULE_DESCRIPTION("MAX3100 driver");
>+MODULE_LICENSE("GPL");

I notice a steep increase in serial drivers. Everyone got their
new chips for xmas, eh? :)



\
 
 \ /
  Last update: 2007-12-29 02:41    [W:0.044 / U:25.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site