Hi Geert, > Subject: Re: [PATCH v2 4/5] mfd: Add Renesas PMIC RAA215300 RTC driver > > Hi Biju, > > On Tue, May 9, 2023 at 9:35 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote: > > > Subject: Re: [PATCH v2 4/5] mfd: Add Renesas PMIC RAA215300 RTC > > > driver On Tue, May 9, 2023 at 9:06 AM Biju Das > <biju.das.jz@xxxxxxxxxxxxxx> wrote: > > > > > Subject: [PATCH v2 4/5] mfd: Add Renesas PMIC RAA215300 RTC > > > > > driver > > > > > > > > > > Currently, it is not possible to instantiate the i2c client > > > > > driver using MFD cell as it is not a platform driver. Add > > > > > support for Renesas PMIC > > > > > RAA215300 RTC platform driver, so that it can be instantiated by > > > > > MFD > > > API. > > > > > The rtc device is created by using i2c_new_ancillary_device() > > > > > and it register as the rtc device by the helper function > > > > > provided by > > > > > rtc-isl2108 driver. > > > > > > > > Not sure this platform driver has to be placed in RTC subsystem > > > > rather than MFD subsystem as PMIC MFD driver, can instantiate it using > MFD cell?? > > > > > > Can't you just instantiate the i2c ancillary device from the PMIC > > > driver, and drop the new mfd and platform rtc drivers? > > > > Yes, it is possible. > > > > The only reason MFD is used for future expansion like adding support > > for > > > > 1) battery charger > > Or > > 2) regulator > > I'd just start with a skeleton regulator ("PMIC") driver... > > > In that case, we can share regmap to sub devices. But these drivers are > not currently planned. > > > > Apart from that, > > > > 1) It avoids subsystem dependencies, ie, PMIC driver directly calling rtc > driver > > for registering RTC device. > > You mean the direct call into raa215300_rtc_probe_helper()? Yes, indeed. > I think that can be solved by enhancing i2c_new_ancillary_device() to take a > proper device name, instead of using "dummy"? Geert, Wolfram, Any pointers for instantiating i2c_client device(for eg: rtc_isl1208.c) by enhancing i2c_new_ancillary_device() api? Apart for this, since a single compatible(the pmic one) is used, In rtc device probe, How do we identify this PMIC RTC device and use the "TYPE_ISL1208" config in RTC driver, once we instantiate RTC device? > > > 2) I guess, the current split will also give some modular design. > > We have a control to enable or disable the driver. > > ie, Enable the driver PMIC with RTC enabled and > > disable the driver PMIC with RTC not enabled(ie, XIN/XOUT grounded) in > the system design > > by controlling the config "PMIC_RAA215300_RTC". > > You already have CONFIG_RTC_DRV_ISL1208, and look at "renesas,rtc-enabled" > before activating the RTC? I agree. this will take care. I just added this CONFIG, so that we can have Built-in PMIC driver and RTC module driver?? Cheers, Biju > > > These are the reasons for creating MFD driver and platform device. > > > > I may be totally wrong. Please correct me if that is the case.