lkml.org 
[lkml]   [2020]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 9/9] mfd: mt6360: Merge different sub-devices I2C read/write
On Wed, 09 Sep 2020, Gene Chen wrote:

> Lee Jones <lee.jones@linaro.org> 於 2020年9月8日 週二 下午7:48寫道:
> >
> > On Tue, 01 Sep 2020, Gene Chen wrote:
> >
> > > Lee Jones <lee.jones@linaro.org> 於 2020年8月28日 週五 下午6:40寫道:
> > > >
> > > > On Mon, 17 Aug 2020, Gene Chen wrote:
> > > >
> > > > > From: Gene Chen <gene_chen@richtek.com>
> > > > >
> > > > > Remove unuse register definition.
> > > >
> > > > This should be in a separate patch.
> > > >
> > > > > Merge different sub-devices I2C read/write functions into one Regmap,
> > > > > because PMIC and LDO part need CRC bits for access protection.
> > > > >
> > > > > Signed-off-by: Gene Chen <gene_chen@richtek.com>
> > > > > ---
> > > > > drivers/mfd/Kconfig | 1 +
> > > > > drivers/mfd/mt6360-core.c | 260 +++++++++++++++++++++++++++++++++++++++------
> > > > > include/linux/mfd/mt6360.h | 240 -----------------------------------------
> > > > > 3 files changed, 226 insertions(+), 275 deletions(-)
> > > > > delete mode 100644 include/linux/mfd/mt6360.h
> > > > >
> > > > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > > > > index a37d7d1..0684ddc 100644
> > > > > --- a/drivers/mfd/Kconfig
> > > > > +++ b/drivers/mfd/Kconfig
> > > > > @@ -913,6 +913,7 @@ config MFD_MT6360
> > > > > select MFD_CORE
> > > > > select REGMAP_I2C
> > > > > select REGMAP_IRQ
> > > > > + select CRC8
> > > > > depends on I2C
> > > > > help
> > > > > Say Y here to enable MT6360 PMU/PMIC/LDO functional support.
> > > > > diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
> > > > > index 677c974..e995220 100644
> > > > > --- a/drivers/mfd/mt6360-core.c
> > > > > +++ b/drivers/mfd/mt6360-core.c
> > > > > @@ -14,7 +14,53 @@
> > > > > #include <linux/regmap.h>
> > > > > #include <linux/slab.h>
> > > > >
> > > > > -#include <linux/mfd/mt6360.h>
> > > > > +enum {
> > > > > + MT6360_SLAVE_TCPC = 0,
> > > > > + MT6360_SLAVE_PMIC,
> > > > > + MT6360_SLAVE_LDO,
> > > > > + MT6360_SLAVE_PMU,
> > > > > + MT6360_SLAVE_MAX,
> > > > > +};
> > > > > +
> > > > > +struct mt6360_ddata {
> > > > > + struct i2c_client *i2c[MT6360_SLAVE_MAX];
> > > > > + struct device *dev;
> > > > > + struct regmap *regmap;
> > > > > + struct regmap_irq_chip_data *irq_data;
> > > > > + unsigned int chip_rev;
> > > > > + u8 crc8_tbl[CRC8_TABLE_SIZE];
> > > > > +};
> > > >
> > > > This is not a new structure, right? Where was this before? Surely it
> > > > should be removed from wherever it was in the same patch that places
> > > > it here?
> > > >
> > >
> > > No, it is merge from header file to source code for unuse in other sub-module.
> >
> > So where did it come from and why don't I see the removal in this
> > patch?
> >
>
> Change is in the bottom of this patch.
> There is a little confuse part in "[PATCH v4 5/9] mfd: mt6360: Rename
> mt6360_pmu_data by mt6360_ddata"
> The "PATCH 5/9" change mt6360_pmu_data to mt6360_ddata instead of mt6360_data.
> I will update PATCH v5 to fix it.
>
> [PATCH v4 9/9]
> diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h
> -struct mt6360_data {
> - struct i2c_client *i2c[MT6360_SLAVE_MAX];
> - struct device *dev;
> - struct regmap *regmap;
> - struct regmap_irq_chip_data *irq_data;
> - unsigned int chip_rev;
> -};
>
> [PATCH v4 5/9]
> diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h
> -struct mt6360_pmu_data {
> +struct mt6360_data {
> struct i2c_client *i2c[MT6360_SLAVE_MAX];
> struct device *dev;
> struct regmap *regmap;

Oh, you've renamed it whilst moving it. That is probably not best
practise, as it causes this kind of confusion.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

\
 
 \ /
  Last update: 2020-09-09 09:38    [W:0.555 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site