From: Pavan Savoy <pavan_savoy@yahoo.co.in>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: greg <gregkh@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] drivers: staging: GPS protocol driver for wl128x
Date: Fri, 11 Jun 2010 17:55:04 +0530 (IST) [thread overview]
Message-ID: <840278.13741.qm@web94914.mail.in2.yahoo.com> (raw)
In-Reply-To: <141474.48175.qm@web94902.mail.in2.yahoo.com>
Alan, (slightly long mail warning..)
as I mentioned before, the problem is how can I know which platform device's registration caused the tty_open to be called ?
Background: [apart from the mail chain below...]
A platform driver by name ST_0 allows registration of certain protocol driver like BT_0 to be registered onto it, and use it as the transport.
This plat driver ST_O now signals the user-space to open up a TTY device and install the ldisc on top of it. (ldisc being ST_0's registered ldisc during it's plat probe).
Now the plat driver's tty_open previously registered is called, but here lies the problem - On what basis do I know that it was because of ST_0 and also How can I send the device number 'x' information in ttySx for user-space application to open/tiocsetd on that device.
All these problems would be solved, if only we could open/tiocsetd a ldisc from the kernel space - basically the ability to claim/use a TTY interface.
something like,
tty_register_ldisc(N_TI_WL, &ldisc_ops, UART_NUM_1);
tty_set_ldisc(); from ldisc drivers itself..
please comment...
> Here are the 2 ST platform devices,
> struct platform_device st_device_0 = {
> .name = "ST_DEV_0",
> .id = -1,
> .dev.platform_data =
> &array,
> .dev.release =
> any_device_release,
> };
> struct platform_device st_device_1 = {
> .name = "ST_DEV_1",
> .id = -1,
> .dev.platform_data =
> &array,
> .dev.release =
> any_device_release,
> };
>
> BT attaching itself to ST_DEV_0,
> static struct protocol_platform_data bt_data = {
> .parent_dev =
> &st_device_0,
> .name = "BT",
> };
>
> static struct platform_device bt_device = {
> .name = "BT",
> .id = -1,
> .dev.platform_data =
> &bt_data,
> .dev.release =
> bt_device_release,
> };
>
> And FM attaching itself to - ST_DEV_1,
> static struct protocol_platform_data fm_data = {
> .parent_dev =
> &st_device_1,
> .name = "FM",
> };
> static struct platform_device fm_device = {
> .name = "FM",
> .id = -1,
> .dev.platform_data =
> &fm_data,
> .dev.release =
> fm_device_release,
> };
>
> My "ST_REGISTER" would now look like,
> int st_register(struct protocol_platform_data *data)
> {
> struct st_data_s *st_data;
> struct platform_device *parent
> = data->parent_dev;
>
> st_data =
> dev_get_drvdata(&parent->dev);
>
> printk("%s registering into
> %s\n", data->name, parent->name);
>
> printk("data got is %s\n",
> st_data->name);
> st_data->name = "Changed
> Name";
> return 0;
> }
> EXPORT_SYMBOL(st_register);
prev parent reply other threads:[~2010-06-11 12:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 16:25 Pavan Savoy
2010-05-05 11:11 ` Alan Cox
2010-05-05 16:04 ` Savoy, Pavan
2010-05-06 20:30 ` Savoy, Pavan
2010-05-06 21:34 ` Pavan Savoy
2010-06-11 12:25 ` Pavan Savoy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=840278.13741.qm@web94914.mail.in2.yahoo.com \
--to=pavan_savoy@yahoo.co.in \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®