Re: [PATCH 1/2] mfd: intel-m10-bmc: specify the retimer sub devices
From: Xu Yilun
Date: Wed Jan 06 2021 - 23:22:37 EST
On Wed, Jan 06, 2021 at 08:23:30AM +0000, Lee Jones wrote:
> On Wed, 06 Jan 2021, Xu Yilun wrote:
>
> > The patch specifies the 2 retimer sub devices and their resources in the
> > parent driver's mfd_cell. It also adds the register definition of the
> > retimer sub devices.
> >
> > There are 2 ethernet retimer chips (C827) connected to the Intel MAX 10
> > BMC. They are managed by the BMC firmware, and host could query them via
> > retimer interfaces (shared registers) on the BMC. The 2 retimers have
> > identical register interfaces in different register addresses or fields,
> > so it is better we define 2 retimer devices and handle them with the same
> > driver.
> >
> > Signed-off-by: Xu Yilun <yilun.xu@xxxxxxxxx>
> > ---
> > drivers/mfd/intel-m10-bmc.c | 19 ++++++++++++++++++-
> > include/linux/mfd/intel-m10-bmc.h | 7 +++++++
> > 2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/intel-m10-bmc.c b/drivers/mfd/intel-m10-bmc.c
> > index b84579b..e0a99a0 100644
> > --- a/drivers/mfd/intel-m10-bmc.c
> > +++ b/drivers/mfd/intel-m10-bmc.c
> > @@ -17,9 +17,26 @@ enum m10bmc_type {
> > M10_N3000,
> > };
> >
> > +static struct resource retimer0_resources[] = {
> > + {M10BMC_PKVL_A_VER, M10BMC_PKVL_A_VER, "version", IORESOURCE_REG, },
> > +};
> > +
> > +static struct resource retimer1_resources[] = {
> > + {M10BMC_PKVL_B_VER, M10BMC_PKVL_B_VER, "version", IORESOURCE_REG, },
> > +};
>
> Please use the DEFINE_RES_*() helpers for this.
Yes, will change it.
Thanks,
Yilun