W dniu 2014-11-17 o 18:00, Janusz Użycki pisze:
W dniu 2014-11-17 o 09:28, Uwe Kleine-König pisze:
I think:
struct mctrl_gpios {
struct uart_port *port;
struct {
gpio_desc *gpio;
unsigned int irq;
} mctrl_line[UART_GPIO_MAX];
};
struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port,
unsigned int idx_if_needed);
int mctrl_gpio_enable_ms(struct mctrl_gpios *gpios);
int mctrl_gpio_disable_ms(struct mctrl_gpios *gpios);
void mctrl_gpio_free(struct mctrl_gpios *gpios);
It looks there could be one more helper useful.
Both atmel_serial.c and mxs-auart.c checks if the line is supported by
mctrl_gpio.
One time it is eg.:
(s->gpio_irq[UART_GPIO_DCD] > 0)
another time it is eg.:
IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(s->gpios, UART_GPIO_RTS))
The first one is no possible now. The second seems rude.
bool mctrl_gpio_is_gpio((struct mctrl_gpios *gpios, enum
mctrl_gpio_idx gidx);
The name is hard. Moreover the implementation could be very similar
to mctrl_gpio_to_gpiod(). Any ideas?
The differences:
- faster
- not exported
- used mainly in uart's interrupt
- assumes that struct mctrl_gpios *gpios exists
Just inline function?
best regards
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html