linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/2] i2c: imx: Add Vybrid VF610 I2C controller support
Date: Mon, 5 Aug 2013 11:53:22 +0200	[thread overview]
Message-ID: <20130805095322.GP26614@pengutronix.de> (raw)
In-Reply-To: <B56CDBE15CE27145A4B77D2D24263E851FC075@039-SN1MPN1-004.039d.mgd.msft.net>

On Mon, Aug 05, 2013 at 09:32:11AM +0000, Lu Jingchang-B35083 wrote:
> > Subject: Re: [PATCH v3 2/2] i2c: imx: Add Vybrid VF610 I2C controller
> > > +struct imx_i2c_clk_pair {
> > > +	u16	div;
> > > +	u16	regval;
> > > +}i;
> > 
> > Converting this to a struct should be a separate patch. This is an
> > obvious cleanup which makes maintainers happy and more willing to take
> > the features you are adding later.
> > 
> [Lu Jingchang-B35083] 
> Do you mean all changes to i.MX common should be a separate patch including the clk div pair, and 
> the struct imx_i2c_hwdata, struct imx_i2c_drvdata and other things changed to be easier to
> use adding other SoCs support later. Thanks.

I mean that each patch should only contain a single logical change.

Converting the two dimensional array into an array of struct is such a
logical change and thus should be a separate patch.

The smaller a patch is the easier it is for people to review it.

> > >
> > > +#define IMX_I2C_IADR	(0x00 << i2c_imx->i2c_hwdata->regshift)
> > > +#define IMX_I2C_IFDR	(0x01 << i2c_imx->i2c_hwdata->regshift)
> > > +#define IMX_I2C_I2CR	(0x02 << i2c_imx->i2c_hwdata->regshift)
> > > +#define IMX_I2C_I2SR	(0x03 << i2c_imx->i2c_hwdata->regshift)
> > > +#define IMX_I2C_I2DR	(0x04 << i2c_imx->i2c_hwdata->regshift)
> > 
> > Macros should not assume there is a i2c_imx variable present in a
> > function. Instead, add static inline accessor functions.
> [Lu Jingchang-B35083] 
> Ok, I will add inline functions instead. Thanks.
> > 
> > 
> > > +	[VF610_I2C] = {
> > > +		.devtype = VF610_I2C,
> > > +		.hwdata = &vf610_i2c_hwdata
> > > +	},
> > >  };
> > 
> > Why add this array?
> > You should reference imx_i2c_hwdata/vf610_i2c_hwdata directly here.
> [Lu Jingchang-B35083] 
> The "is_imx1_i2c()"function need the devtype variable the test the arch, so the devtype is out of the
> imx_i2c_hwdata struct to let all other i.MX i2c device can sharing the same imx_i2c_hwdata setting. Thanks.

Then add the devtype variable to struct imx_i2c_hwdata and split
imx_i2c_hwdata into imx1_i2c_hwdata and imx21_i2c_hwdata.

> > 
> > >
> > >  	if (of_id)
> > >  		pdev->id_entry = of_id->data;
> > 
> > This is wrong in the original driver code. This field should be changed
> > in a driver.
> [Lu Jingchang-B35083] 
> Could you please give some more comments on this? Thanks.

It's not the drivers business of changing pdev->id_entry. This should
only be modified by the driver core.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2013-08-05  9:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02  4:44 [PATCH RESEND 1/2] ARM: dts: vf610-twr: enable i2c0 device Jingchang Lu
2013-08-02  4:44 ` [PATCH v3 2/2] i2c: imx: Add Vybrid VF610 I2C controller support Jingchang Lu
2013-08-05  8:30   ` Sascha Hauer
2013-08-05  9:32     ` Lu Jingchang-B35083
2013-08-05  9:53       ` Sascha Hauer [this message]
2013-08-05 15:51         ` 答复: " Lu Jingchang-B35083
2013-08-10 14:08   ` Mark Rutland
2013-08-12 12:56     ` 答复: " Lu Jingchang-B35083
2013-08-12 16:43       ` Mark Rutland
2013-08-12 16:59         ` Tomasz Figa
2013-08-12 17:04           ` Kumar Gala
2013-08-12 23:23         ` 答复: " Stephen Warren
2013-08-13  7:46           ` s.hauer at pengutronix.de
2013-08-13 15:48             ` Stephen Warren
2013-08-13 16:12               ` s.hauer at pengutronix.de
2013-08-14  3:29                 ` Shawn Guo
2013-08-15  9:48                 ` Wolfram Sang
2013-08-04 13:30 ` [PATCH RESEND 1/2] ARM: dts: vf610-twr: enable i2c0 device Shawn Guo

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=20130805095322.GP26614@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).