Skip to content

Conversation

@bogdanovs
Copy link
Contributor

@bogdanovs bogdanovs commented Nov 5, 2025

This PR introduce MFD driver for RV3032 to expose Temperature sensor and Timer counter.

  • MFD driver is taking gave for communication with the device via I2C and handling IRQs which are dispached accordingly
  • Temperature sensor is implementing sensor API
  • Timer counter is implementing couter API
  • Existing RTC driver is reworked to match this

RV3032 RTC driver changes:

  • IRQ is not handled by the driver anymore but MFD take ownership over that
  • I2C call are made via mfd_rv3032 prefixed functions from MFD guarded from semaphor
  • There was unclear behavior of the driver if device did no go through full hardware power cycle and POR bit is not marked. This was causing issues because if some cases driver should clean everything even if POR bit is not touched. Those cases are : During development or if device main power supply is 100% online but MCU reboot via RESET button or other and should get clear device.driver. For that reason always-on (AON) flag is introduced in MFD driver, as parent driver. RTc access it and act accordingly.

@bogdanovs bogdanovs changed the title Add RV3032 MFD drive to expose Timer counter and temp sensor Add RV3032 MFD drive to expose Timer counter and Temperature sensor Nov 5, 2025
@bogdanovs bogdanovs force-pushed the sbogdanov/rv-3032-mfd-counter-sensor branch 9 times, most recently from 7d3e031 to 89100ef Compare November 6, 2025 22:16
Add MFD driver for managing rv3032 functionality which did not fit RTC
api. That way are implemented part which otherwise will not be used:
- RTC
- counter/timer
- temperature sensor

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Add dependecy for MFD driver and remove I2C dependency since it will
be managed from MFD driver together with interrupts.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Remove gpio-int since interrupts will be managed from MFD driver
insted, acticting like dispatcher for interrupts.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Remove backup flag from RTC driver and move it to parent instead.
RTC driver still can access the values of the flags but MFD need
to know what is expected in term of initial behaviour.
Some assumptions done in RTC driver are causing inconsistant behaviour.
We cannot assume that the RTC alarms and notifications need to be
cleaned only if POR bit is triggered. We can have situation where
whole system go throigh soft restart and need to zero RV3032, so driver
need to have option to allow that kind of behaviour.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Rework rv3032 implementaion to use MFD driver unstead of local
implementaion for I2C access and Interrupt managements. This way
could be utilized parts which are not implemented because did not fit
in to RTC api - counter and temperature sensor. To have propper
sincronization arbitration is need which is handled from mfd_rv3032.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Expose timer functionality from rv-3032-c7 via counter api.
I2C communication and IRQs are arbitrated via MFD parent driver
for rtc, sensor and counter at once.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Expose internal temperature sensor for rv-3032-c7. Driver is reporting
temperature from internal deice sensors and have HIGH an LOW temperature
treshhold which are triggering interrupts. I2C communication and IRQ are
handled from parent MFD driver.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Update rv3032 to reflect latest chanes to the driver.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Ensure this driver is tested in the build_all test suite.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Ensure this driver is tested in the build_all test suite.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
Add missing new line before channel entry for fdc2x1x
which was causing CI fail

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
@bogdanovs bogdanovs force-pushed the sbogdanov/rv-3032-mfd-counter-sensor branch from 9c5c0c9 to b92dd25 Compare November 7, 2025 14:01
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant