All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Ajay Gupta <ajayg@nvidia.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	"heikki.krogerus@linux.intel.com"
	<heikki.krogerus@linux.intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: [v5,2/2] usb: typec: ucsi: add support for Cypress CCGx
Date: Thu, 6 Sep 2018 00:31:27 +0200	[thread overview]
Message-ID: <20180905223127.GA12930@kunai> (raw)

On Wed, Sep 05, 2018 at 10:17:26PM +0000, Ajay Gupta wrote:
> Hi Greg,
> 
> > > +static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
> > > +{
> > > +	struct device *dev = uc->dev;
> > > +	struct i2c_client *client = uc->client;
> > > +	unsigned char buf[2];
> > > +	struct i2c_msg msgs[] = {
> > > +		{
> > > +			.addr	= client->addr,
> > > +			.flags  = 0x0,
> > > +			.len	= 0x2,
> > > +			.buf	= buf,
> > > +		},
> > > +		{
> > > +			.addr	= client->addr,
> > > +			.flags  = I2C_M_RD,
> > > +			.buf	= data,
> > > +		},
> > > +	};
> > 
> > Are you sure you are allowed to do i2c messages off of the stack like this?
> > Will that work on all platforms?

DMA is optional with I2C. These messages do not set the I2C_M_DMASAFE
flag, so it should be OK.

             reply	other threads:[~2018-09-05 22:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 22:31 Wolfram Sang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-05 22:17 [v5,2/2] usb: typec: ucsi: add support for Cypress CCGx Ajay Gupta
2018-09-05 18:04 Ajay Gupta
2018-09-05 12:31 Greg Kroah-Hartman
2018-09-05 12:26 Greg Kroah-Hartman
2018-08-31 20:22 Ajay Gupta

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=20180905223127.GA12930@kunai \
    --to=wsa@the-dreams.de \
    --cc=ajayg@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-usb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.