[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4500103.Z38Pp35WUa@typ>
Date: Mon, 28 Apr 2014 00:39:19 +0200
From: Max Schwarz <max.schwarz@...ine.de>
To: Heiko Stübner <heiko@...ech.de>
Cc: Wolfram Sang <wsa@...-dreams.de>,
Grant Likely <grant.likely@...aro.org>,
Rob Herring <robh+dt@...nel.org>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH] i2c: add driver for Rockchip RK3xxx SoC I2C adapter
Hello Heiko,
thanks for your comments.
> both the grf as well as the bus-idx are rockchip specific, so they should be
> prefixed (rockchip,grf, etc) and from my personal taste I would hope we
> could invest in an "n" and "e", to make it a full bus-index ;-)
I will change the names to rockchip,grf and rockchip,bus-index.
> the convention seems to be "clock-frequency" for the desired bus speed
> (checked i2c-sirf, i2c-exynos, i2c-at91and i2c-qup).
Thanks for looking that up, will change.
> > + * Driver for I2C unit in Rockchip RK3188 SoC
>
> RK3188 -> RK3xxx?
yes, of course.
> > +static inline void i2c_writel(struct rk3x_i2c *i2c, u32 value,
> > + unsigned int offset)
> > +{
> > + writel(value, i2c->regs + offset);
> > +}
> > +
> > +static inline u32 i2c_readl(struct rk3x_i2c *i2c, unsigned int offset)
> > +{
> > + return readl(i2c->regs + offset);
> > +}
>
> I'm not sure what the policy here is, but is this indirection really
> necessary when it's only doing a normal readl/writel?
I saw that pattern in several device drivers (a quick grep for
"static inline void .*_writel" turns up quite a bit of those). Obviously, it
doesn't hurt performance-wise as they are just inline functions. I personally
think that
i2c_writel(i2c, val, REG_CON);
is a bit more concise than
writel(val, i2c->regs + REG_CON);
And it makes tracing easier by giving me a single function were I can trace
all register accesses, if needed.
But as you said, there might be some policy I don't know about. If you feel
strongly about it or someone else also votes for plain readl/writel, I will
happily change it.
Thanks,
Max
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists