Re: [PATCH 7/7] mfd: Add support for the MediaTek MT6397 PMIC

From: Lee Jones
Date: Mon Jan 26 2015 - 06:11:33 EST


On Mon, 26 Jan 2015, Sascha Hauer wrote:
> On Fri, Jan 23, 2015 at 04:14:40PM +0000, Lee Jones wrote:
> > On Fri, 23 Jan 2015, Sascha Hauer wrote:
> >
> > > From: Flora Fu <flora.fu@xxxxxxxxxxxx>
> > >
> > > This adds support for the MediaTek MT6397 PMIC. This is a
> > > multifunction device with the following sub modules:
> > >
> > > - Regulator
> > > - RTC
> > > - Audio codec
> > > - GPIO
> > > - Clock
> > >
> > > It is interfaced to the host controller using SPI interface by a proprietary
> > > hardware called PMIC wrapper or pwrap. MT6397 MFD is a child device of the
> > > pwrap.
> > >
> > > Signed-off-by: Flora Fu, MediaTek
> > > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > > Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
> > > Cc: Lee Jones <lee.jones@xxxxxxxxxx>
> > > ---
> > > Documentation/devicetree/bindings/mfd/mt6397.txt | 70 +++++

[...]

> > > + struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq);
> > > + int shift = mt6397_irq_shift(data->hwirq);
> > > + int reg = mt6397_irq_reg(data->hwirq);
> > > + int reg_ofs = MT6397_INT_CON0 + reg * 2;
> > > +
> > > + mt6397->irq_masks_cur[reg] &= ~(1 << shift);
> >
> > s/(1 << shift)/BIT(shift)/
>
> Is it mentioned somewhere that these BIT macros shall be used? There are
> quadrillions of examples for both styles in the kernel and personally I
> think 1 << x is more readable.

I haven't seen a hard and fast 'rule' per say. I think it's left up
to the Maintainer of any given subsystem. ;)

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/