On 01.12.2022 09:40:50, Vivek Yadav wrote: > > That probably depends on you power management. If I add a regulator > > to power the external tcan4x5x chip and power it up during open(), I > > need to initialize the RAM. > > > Thanks for the clarification, > > There is one doubt for which I need clarity if I add ram init in > m_can_chip_config. > > In the current implementation, m_can_ram_init is added in the probe > and m_can_class_resume function. > > If I add the ram init function in chip_config which is getting called > from m_can_start, then m_can_init_ram will be called two times, once > in resume and next from m_can_start also. As m_can_start() is called from resume, remove the direct call to m_can_init_ram() from m_can_class_resume(). > Can we add ram init inside the m_can_open function itself? Because it > is independent of m_can resume functionality. See above. mainline implementation: m_can_class_resume() -> m_can_init_ram() m_can_open() -> m_can_start() -> m_can_chip_config() -> ops->init m_can_init_ram() (for tcan only) proposed: m_can_class_resume() -> m_can_start() -> m_can_chip_config() -> m_can_init_ram() m_can_open() -> m_can_start() -> m_can_chip_config() -> m_can_init_ram() In mainline m_can_init_ram() is called for the tcan during open(). So if you call m_can_init_ram() from m_can_chip_config(), remove it from the tcan's tcan4x5x_init() functions, and from m_can_class_resume() it should only be called once for open and once for resume. regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature