1

I am currently building a device and its driver in an embedded Android.

The device is basically an embedded Linux behaving like a touchscreen. The device and the embedded Android are connected with UART. (I am using Lemaker Guitar eval boards). The communication is working : I receive data sent on /dev/ttyS0 (using minicom or cat /dev/ttyS0).

Now, I need to create the driver that will receive this input (it will be touches, so coordinates, the protocol is already written). I found this resource and its lab.

We can read that : "The driver name must be “atmel_usart” to match the device definitions in arch/arm/mach­at91/"

So I looked for it and found that the device (ie. the Linux embedded) has to be declared in the device tree OR in the file under a platform_device with a name matching the name of the platform_driver.

That made me question a lot about my approach to this problem.

  1. I can read from /dev/ttyS0. But this is a just a device node, but not a device. Is it true ?
  2. When implementing platform_device structure, we must allocate resources. Is there any way to let the system handle the resources ?
  3. I've seen also another library that can be used but could not find any real documentation : serio. It might be a better path to resolve my issues ?

Thanks for reading. I am open to suggestions in order to solve this issue : what shape should have my driver. Thanks again, you might be saving my internship :) :)

EDIT :

These words were not clear enough.

So I have two parts : one embedded Linux (ie. Ubuntu Mate) that will behave like a touchscreen. This will send the coordinates of the touches to an embedded Android.
The linux embedded is connected to the UART via serial link ; this communication works. Now, I want to make a driver in order to perform the touches in the Android.

Here is the block diagram :

Block diagram

Thanks again :)

GautierD
  • 83
  • 10
  • 3
    What do you mean by *"UART device"* (i.e. you overuse the word "device")? The UART itself? Or the device connected to the UART by the serial link? A block diagram of what you have would probably explain it a lot better than the words you wrote. – sawdust May 10 '16 at 20:07
  • Hi and thanks for your time. I added a block diagram made quickly. By UART device I meant the device connected to the UART by the serial link that I made. Thanks again. :) – GautierD May 11 '16 at 07:09
  • you want give input events from the Ubuntu machine and that should be executed in embedded android board, if this is your requirement there is an open source tool uinput it does the same using ethernet connection – vkumar May 11 '16 at 08:52
  • 2
    The (remote) device that is connected by a serial link typically does not have a kernel driver associated with it in the host computer. There may be a line discipline or service for it, but usually there's just a userspace application program communicating through the serial port. E.G. create a process that reads the serial port, and generates events (that can be read using some IPC method).. – sawdust May 11 '16 at 08:56
  • Thanks to both of you. I finally decided to use uinput as @vkumar suggested. I ran into difficulties but should definitely work. Thanks again, Gautier. – GautierD May 24 '16 at 17:13

0 Answers0