Re: MFD device driver on top of UART/RS232

2015-11-16 Thread Sascha Hauer
Hi Andrey,

+Cc NeilBrown 

On Mon, Nov 16, 2015 at 07:24:58PM +0300, Andrey Vostrikov wrote:
> Hi,
> 
> I have an embedded system with microcontroller connected via
> UART/RS232 port. This microcontroller implements several low-level
> functions that need to be exposed as device drivers in other
> subsystems (watchdog, LEDs, HWMON, firmware read/write).
> 
> I checked many drivers implemented in the kernel, searched through
> mail list archives and it looks like there are three different ways to
> solve this task:
> A) most of the devices that are connected using UART have user space
> program that configures and manages it (either directly or with help
> of dedicated line discipline, SLIP, SL-CAN, etc)
> B) serio - mostly used for input devices
> C) direct use of UART port taking control from serial_core.
> 
> The best match I have found so far is MFD driver for Atmel
> Microcontroller on iPaq h3xxx (drivers/mfd/ipaq-micro.c) that follows
> concept "C)"

There's also D) TTY slave device support: https://lkml.org/lkml/2015/3/18/40

Unfortunately this hasn't made it to mainline yet and it seems the
parties lost interest after some lengthy discussion of device tree phandles
vs. subnodes, but I think this is what you're looking for.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


MFD device driver on top of UART/RS232

2015-11-16 Thread Andrey Vostrikov

Hi,

I have an embedded system with microcontroller connected via UART/RS232 port. 
This microcontroller implements several low-level functions that need to be 
exposed as device drivers in other subsystems (watchdog, LEDs, HWMON, firmware 
read/write).

I checked many drivers implemented in the kernel, searched through mail list 
archives and it looks like there are three different ways to solve this task:
A) most of the devices that are connected using UART have user space program 
that configures and manages it (either directly or with help of dedicated line 
discipline, SLIP, SL-CAN, etc)
B) serio - mostly used for input devices
C) direct use of UART port taking control from serial_core.

The best match I have found so far is MFD driver for Atmel Microcontroller on iPaq h3xxx 
(drivers/mfd/ipaq-micro.c) that follows concept "C)"

Is this a good enough example to use for this task? This platform is a legacy 
one so I am confused a little if new driver will fit nicely into the mainline.

It would be great if someone could point me to another example to follow or 
advise better way to implement MFD driver without user space involvement.

Best regards,
Andrey





--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html