linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
Cc: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: I2C slave support
Date: Mon, 26 Jan 2015 17:30:13 +0100	[thread overview]
Message-ID: <20150126163013.GE13494@katana> (raw)
In-Reply-To: <20150126171745.3d6d0fec-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]


> > Own module: Again, undecided. On the one hand it makes for a nice
> > encapsulation, on the other hand there is overhead for having another
> > module. I am very happy that the core code for slave support is so slim.
> 
> I gave a try to the separate module approach and I have to agree that
> it seems overkill given the small amount of code.

OK, thanks for trying!

> Something like this?

Yes, pretty much what I had in mind. One issue, though:

> +#if IS_ENABLED(CONFIG_I2C_SLAVE)
>  enum i2c_slave_event {
>  	I2C_SLAVE_REQ_READ_START,
>  	I2C_SLAVE_REQ_READ_END,
> @@ -263,6 +266,7 @@ static inline int i2c_slave_event(struct
>  {
>  	return client->slave_cb(client, event, val);
>  }
> +#endif

This should fail because bus drivers need those enums for their slave
backend. Try building i2c-sh_mobile which builds with an x86 toolchain
as well.

* Either we leave this included, so bus drivers don't need any ifdeffery

or

* we mandate that bus drivers also use the ifedeffery. Then, we could
  also mask out the (un)reg_slave callbacks in struct i2c_adapter

What do you think?


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-01-26 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-24 20:08 I2C slave support Jean Delvare
     [not found] ` <20150124210825.521bf923-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-01-26 11:33   ` Wolfram Sang
2015-01-26 16:17     ` Jean Delvare
     [not found]       ` <20150126171745.3d6d0fec-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-01-26 16:30         ` Wolfram Sang [this message]
2015-01-26 17:07           ` Jean Delvare
     [not found]             ` <20150126180747.07ddacfd-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-01-26 17:45               ` Wolfram Sang

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=20150126163013.GE13494@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=jdelvare-l3A5Bk7waGM@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).