From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH v4 2/2] I2C: mediatek: Add driver for MediaTek I2C controller Date: Wed, 21 Jan 2015 09:20:22 +0100 Message-ID: <20150121082022.GT22880@pengutronix.de> References: <1421404418-50718-1-git-send-email-eddie.huang@mediatek.com> <1421404418-50718-3-git-send-email-eddie.huang@mediatek.com> <20150118101816.GF22880@pengutronix.de> <1421810004.15468.825.camel@mtksdaap41> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1421810004.15468.825.camel@mtksdaap41> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Eddie Huang Cc: Wolfram Sang , Matthias Brugger , srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , Jean Delvare , Arnd Bergmann , Doug Anderson , Andrew Bresticker , Max Schwarz , Boris BREZILLON , Anders Berg , Neelesh Gupta , Wei Yan , Lee Jones , Simon Glass , Jim Cromie , Bjorn Andersson , Beniamino Galvani List-Id: devicetree@vger.kernel.org Hello, On Wed, Jan 21, 2015 at 11:13:24AM +0800, Eddie Huang wrote: > > > + /* set when doing the transfer */ > > > + u16 irq_stat; /* interrupt status */ > > > + unsigned int speed_hz; /* The speed in transfer */ > > > + bool trans_stop; /* i2c transfer stop */ > > > + enum mtk_trans_op op; > > > + u16 msg_len; > > > + u8 *msg_buf; /* pointer to msg data */ > > > + u16 msg_aux_len; /* WRRD mode to set AUX_LEN register*/ > > > + u16 addr; /* 7bit slave address, without read/write bit */ > > Wouldn't it be easier to maintain a pointer to the message to be > > transferred? > I think use mtk_i2c pointer is more flexible than maintain a pointer = to > message. Not sure you understood what I intended to suggest. My idea was to drop u16 msg_len; u8 *msg_buf; u16 msg_aux_len; // maybe u16 addr; from struct mtk_i2c and add a struct i2c_msg *msg instead. Up to you to decide. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig = | Industrial Linux Solutions | http://www.pengutronix.de/= | -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html