linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Par-Gunnar Hjalmdahl" <pghatwork@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linus.walleij@stericsson.com, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, Lukasz.Rymanowski@tieto.com
Subject: Re: [PATCH 5/9] mfd: Add UART support for the ST-Ericsson CG2900.
Date: Mon, 8 Nov 2010 06:24:49 +0100	[thread overview]
Message-ID: <201011080624.49224.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTimEYAmocFh_c-KftpL2zRm+LaHzgJOBX31iicLj@mail.gmail.com>

On Friday 05 November 2010, Par-Gunnar Hjalmdahl wrote:
> 2010/10/31, Alan Cox <alan@lxorguk.ukuu.org.uk>:
> >> It's about the ldisc number. Both bluetooth and cg2900 register themselves
> >> to ldisc 15 (N_HCI). A user doing TIOCSETD can only get one of the two.
> >
> > Ah I see - I had assumed any actual final merge would be assigning it a
> > new LDISC code as is required.
> 
> Sorry for not answering quicker. We in my department have been
> discussing new design as well as trying out some solutions.
> 
> As an answer to previous comments, both from Arnd and Alan, we would
> like to do the following:
>  - Introduce a new ldisc called N_H4_COMBO with a ldisc driver
> accordingly that will be placed under drivers/char

I'm not convinced, although that's what Alan was suggesting. I'd like
to hear from the bluetooth people what they think about this.

Could you summarize why you think that cg2900 is different enough from
an HCI to require a different line discipline? From your previous
explanation it sounded like it was mostly added functionality,
not something entirely different.

>  - Keep CG2900 driver as an MFD. We will however register the MFD
> cells in each driver and remove the function API. The functions
> (write, reset, etc) will instead be placed in each MFD cell using
> function pointers. This way we can use different functions for
> different channels as needed. By placing the MFD cell registration in
> each chip driver we will also only expose the channels that are
> actually supported by each chip. This way we can also remove the
> pretty ugly matching between the devices and respective H4 channel as
> well as the add_h4_user function and the similar other functions.

Ok, excellent.

> We were thinking about if we could re-use the existing hci_ldisc
> driver. As stated before the big problem here is however that
> hci_ldisc directly registers to the Bluetooth stack. We could separate
> the data for FM and GPS in the protocol driver, but it is pretty ugly
> to have two separate data paths within the same driver.

One of us must be misreading the code. As far as I can tell, hci_ldisc
does not register to the bluetooth stack at all, it just provides
the basic multiplex for multiple HCI protocols, while hci_h4.c
communicates to the bluetooth stack.

If I read it correctly, that means that you can still use hci_ldisc,
but need to add another protocol next to hci_h4 and hci_bcsp for
your cg2900.

> As I've state earlier this would also not work with other transports
> such as SPI.I appreciate Arnd's suggestion to create a TTY for SPI,
> but I think that would overcomplicate the situation and create a
> solution more complex than actually needed. We think that creating a
> new ldisc creates a cleaner solution. It will to some extent remind of
> hci_ldisc, but it will not register to any framework except tty.

How would registering ony to tty solve the problem of SPI?

If you just add another hci_cg2900 module, it can register to both
the hci_ldisc and the spi code.

> We've thought about if we should switch cg2900 to a bus, but after
> discussing this we feel that CG2900 has such individual
> characteristics that it could be hard to create a bus that would suite
> it. We therefore will keep the MFD type. We might in the future add
> new chips to the driver, but they will most likely not require so much
> rework of the driver that we will have to create something completely
> new. We will rather create a lib file that contains common code to
> reduce total code size of the driver.

Yes, makes sense.

	Arnd


  parent reply	other threads:[~2010-11-08  5:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 10:38 [PATCH 5/9] mfd: Add UART support for the ST-Ericsson CG2900 Par-Gunnar Hjalmdahl
2010-10-22 12:51 ` Alan Cox
2010-10-22 14:54   ` Par-Gunnar Hjalmdahl
2010-10-22 15:33     ` Alan Cox
2010-10-28 10:37       ` Par-Gunnar Hjalmdahl
2010-10-28 12:22     ` Arnd Bergmann
2010-10-29 11:58       ` Par-Gunnar Hjalmdahl
2010-10-29 12:08         ` Par-Gunnar Hjalmdahl
2010-10-30  0:09           ` Arnd Bergmann
2010-10-29 16:22         ` Alan Cox
2010-10-30  0:01           ` Arnd Bergmann
2010-10-31 12:04             ` Alan Cox
2010-11-05 17:02               ` Par-Gunnar Hjalmdahl
2010-11-05 17:19                 ` Alan Cox
2010-11-08  5:24                 ` Arnd Bergmann [this message]
2010-11-11 14:28                   ` Par-Gunnar Hjalmdahl
2010-11-11 14:40                     ` Par-Gunnar Hjalmdahl
2010-11-11 15:12                       ` Arnd Bergmann
2010-10-29 11:53   ` Par-Gunnar Hjalmdahl
2010-10-29 16:24     ` Alan Cox
2010-12-03  9:16       ` Par-Gunnar Hjalmdahl
2010-12-03 11:42         ` Vitaly Wool
2010-12-06  9:06           ` Par-Gunnar Hjalmdahl
2010-12-06  9:46             ` Vitaly Wool
2010-12-06 12:01               ` Par-Gunnar Hjalmdahl
2010-12-06 12:25                 ` Vitaly Wool
2010-12-06 14:49                   ` Arnd Bergmann
2010-12-06 14:57                     ` Vitaly Wool
2010-12-06 14:06               ` Arnd Bergmann
2010-12-06 14:54                 ` Vitaly Wool
2010-12-06 15:15                   ` Arnd Bergmann
2010-12-06 15:28                     ` Vitaly Wool
2010-12-06 16:54                       ` Arnd Bergmann
2010-12-06 21:24                         ` Vitaly Wool
2010-12-06 23:07                           ` Arnd Bergmann
2010-12-08  7:41                             ` Pavan Savoy
2010-12-08 12:21                               ` Par-Gunnar Hjalmdahl
2010-12-08 12:51                                 ` Arnd Bergmann

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=201011080624.49224.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Lukasz.Rymanowski@tieto.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pghatwork@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).