Re: [PATCH] drivers:staging: sources for ST core

From: Pavan Savoy
Date: Mon Apr 05 2010 - 12:18:40 EST

--- On Fri, 2/4/10, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:

> From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
> Subject: Re: [PATCH] drivers:staging: sources for ST core
> To: "Pavan Savoy" <pavan_savoy@xxxxxxxxxxx>
> Cc: "Greg KH" <gregkh@xxxxxxx>, "Marcel Holtmann" <marcel@xxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
> Date: Friday, 2 April, 2010, 4:57 AM
> Sorry but I can't make head or tail
> of this and the code flow you are
> trying to achieve.
> The usual way you do stuff is to put per device stuff in a
> per device
> struct, driver wide stuff in a driver struct (or static
> variables) and
> then run everything from the device end.
> I'd expect a low level driver to do something like
>     probe()
>         create device entry
>         initialise device (eg
> download firmware)
>         register itself with
> anything higher level

What I am trying to achieve is something like this,

HCI-core V4L2-radio Char-device=/dev/tigps for fops
^ ^ ^
| | |
| | |
BT FM GPS [these register themselves to ST]
\ | /
\ | /
\ | /
Shared Transport Ldisc driver
TTY Layer <-- UART driver has already registered.

So, when a BT device try and registers itself to ST (shared transport) driver, I need to toggle chip enable line and 'download_firmware', and in case another _register from FM or GPS happens at the same time, I need to signal it pending, and call a callback upon completion of firmware download.

Now which are to be identified as per-device or bus or driver ?
Because when an st_register is called, I need to do some tty_* operations from the ldisc driver itself - i.e I cannot embed tty into any of BT, FM or GPS per-device structures.

I also expose a st_write function, where in any of BT, FM and GPS driver upon being ready (fw download completed) sends across an SKB, which I queue up and write.

All of what I wanted to do, could not be done when I tried ST ldisc as a bus and each of BT, FM and GPS as per-device structs registering with type ST as bus.
So again, Now which are to be identified as per-device or bus or driver ?

The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at