The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Kenneth Heitke <kheitke@codeaurora.org>,
	Ben Dooks <ben-linux@fluff.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	davidb@codeaurora.org, bryanh@codeaurora.org,
	linux-arm-msm@vger.kernel.org,
	Sagar Dharia <sdharia@codeaurora.org>,
	rdunlap@xenotime.net, john.stultz@linaro.org, arnd@arndb.de,
	akpm@linux-foundation.org, ohad@wizery.com, gregkh@suse.de,
	stefanr@s5r6.in-berlin.de, lethal@linux-sh.org,
	linville@tuxdriver.com, zajec5@gmail.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] slimbus: Linux driver framework for SLIMbus.
Date: Tue, 16 Aug 2011 21:33:49 +0200	[thread overview]
Message-ID: <20110816213349.5b042f80@endymion.delvare> (raw)
In-Reply-To: <20110815193724.GB2465@flint.arm.linux.org.uk>

Hi Russell,

On Mon, 15 Aug 2011 20:37:24 +0100, Russell King wrote:
> On Wed, Aug 10, 2011 at 05:31:28PM -0600, Kenneth Heitke wrote:
> > From: Sagar Dharia <sdharia@codeaurora.org>
> > 
> > SLIMbus (Serial Low Power Interchip Media Bus) is a specification
> > developed by MIPI (Mobile Industry Processor Interface) alliance.
> > SLIMbus is a 2-wire implementation, which is used to communicate with
> > peripheral components like audio. Commonly used digital audio
> > interfaces such as I2S, PCM are intended for point-to-point connection
> > between application processor and single audio device and support one
> > or two channels. Adding more channels or functions is difficult
> > without increasing number of bus structures and hence pin count.
> > In parallel to audio channels, control buses such as I2C are typically
> > used for low-bandwidth control tasks.
> > SLIMbus replaces many digital audio buses and control buses by
> > providing flexible and dynamic bus-bandwidth between data-functions
> > and control-functions.
> > 
> > The framework supports message APIs, channel scheduling for SLIMbus.
> > Message APIs are used for status/control type of communication with a
> > device. Data Channel APIs are used for setting data channels between
> > SLIMbus devices.
> > 
> > Framework supports multiple busses (1 controller per bus) and multiple
> > clients/slave devices per controller.
> 
> This looks like another bus doing the same thing as SPI and I2C.
> 
> We seem to be having a growing number of bus_types which:
> 
> 1. Supply some kind of boardinfo array containing device names against
>    a device.
> struct i2c_board_info {
>         char            type[I2C_NAME_SIZE];
>         unsigned short  flags;
>         unsigned short  addr;
>         void            *platform_data;
>         struct dev_archdata     *archdata;
>         struct device_node *of_node;
>         int             irq;
> };
> struct spi_board_info {
>         char            modalias[SPI_NAME_SIZE];
>         const void      *platform_data;
>         void            *controller_data;
>         int             irq;
>         u32             max_speed_hz;
>         u16             bus_num;
>         u16             chip_select;
>         u8              mode;
> };
> 
> 2. match drivers to this against (i2c) type (spi) modalias.
> 
> 3. drivers contain essentially the same ID structure:
> #define I2C_NAME_SIZE   20
> #define I2C_MODULE_PREFIX "i2c:"
> struct i2c_device_id {
>         char name[I2C_NAME_SIZE];
>         kernel_ulong_t driver_data      /* Data private to the driver */
>                         __attribute__((aligned(sizeof(kernel_ulong_t))));
> };
> #define SPI_NAME_SIZE   32
> #define SPI_MODULE_PREFIX "spi:"
> struct spi_device_id {
>         char name[SPI_NAME_SIZE];
>         kernel_ulong_t driver_data      /* Data private to the driver */
>                         __attribute__((aligned(sizeof(kernel_ulong_t))));
> };
> +#define SLIMBUS_NAME_SIZE      32
> +#define SLIMBUS_MODULE_PREFIX "slim:"
> +struct slim_device_id {
> +       char name[SLIMBUS_NAME_SIZE];
> +       kernel_ulong_t driver_data      /* Data private to the driver */
> +                       __attribute__((aligned(sizeof(kernel_ulong_t))));
> +};

The similarities are certainly due to the fact that spi and i2c were
designed by the same person (David Brownell), and slimbus most probably
was originally cloned from either. I'm glad we don't reinvent the wheel
each time.

> I heard of another bus type at the recent Linaro conference which sounds
> like it's going to do yet again a similar thing.  So it sounds like we're
> heading for about four of these things.
> 
> Is there any way to consolidate this before we end up with four ways of
> solving the same problem?

Each bus type has its own specificity, so I doubt we can make them all
fit in a single model. Of course they have common points, but USB and
PCI also do to some extent, still we don't have a common framework for
these.

At this point I am unsure, what problem you are trying to solve
exactly. The amount of code you refer to above is low, so I see very
little room for improvement. But if you have a concrete proposal, I am
ready to evaluate it.

-- 
Jean Delvare

  parent reply	other threads:[~2011-08-16 19:34 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10 23:31 [RFC PATCH] slimbus: Linux driver framework for SLIMbus Kenneth Heitke
2011-08-11 12:55 ` Arnd Bergmann
2011-08-11 20:51   ` Kenneth Heitke
2011-08-12 16:46   ` Mark Brown
2011-08-16 13:37     ` Arnd Bergmann
2011-08-16 13:50       ` David Brown
2011-08-16 14:32         ` Arnd Bergmann
2011-08-16 15:40           ` Mark Brown
2011-08-16 17:13           ` Kenneth Heitke
2011-08-16 17:16             ` Kenneth Heitke
2011-08-16 17:44             ` sdharia
2011-08-16 19:49               ` Arnd Bergmann
2011-08-16 23:27                 ` Kenneth Heitke
2011-08-17  0:59                   ` Mark Brown
2011-08-17  1:54                     ` Sagar Dharia
2011-08-17  6:32                       ` Mark Brown
2011-08-17  7:09                   ` Arnd Bergmann
2011-08-17  8:03                     ` Mark Brown
2011-08-17 10:42                       ` Arnd Bergmann
2011-08-17 13:04                         ` Mark Brown
2011-08-17 13:17                           ` Linus Walleij
2011-08-18  3:00                             ` Mark Brown
2011-08-24  9:15                               ` Linus Walleij
2011-08-24  9:21                                 ` Mark Brown
2011-08-25  7:10                                   ` Linus Walleij
2011-08-25  9:44                                     ` Mark Brown
2011-08-17 14:00                           ` Arnd Bergmann
2011-08-19  3:24                             ` Mark Brown
2011-08-21 22:10                               ` Sagar Dharia
2011-08-22 13:47                                 ` Arnd Bergmann
2011-08-16 15:23       ` Mark Brown
2011-08-14 14:34 ` Mark Brown
2011-08-15 17:55   ` Kenneth Heitke
2011-08-15 19:37 ` Russell King
2011-08-15 20:12   ` Kenneth Heitke
2011-08-16 19:33   ` Jean Delvare [this message]
2011-08-17 13:12   ` Mark Brown
2011-08-23 23:24 ` Randy Dunlap
2011-08-23 23:32   ` Kenneth Heitke

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=20110816213349.5b042f80@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=ben-linux@fluff.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@suse.de \
    --cc=john.stultz@linaro.org \
    --cc=kheitke@codeaurora.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=ohad@wizery.com \
    --cc=rdunlap@xenotime.net \
    --cc=rmk@arm.linux.org.uk \
    --cc=sdharia@codeaurora.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=zajec5@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