[U-Boot-Users] DS1374 watchdog capabilities

Hi,
I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking about something like this:
#if (defined(CONFIG_RTC_DS1374)) &&
#if (CONFIG_COMMANDS & CFG_CMD_DATE) existing stuff #endif
#if (CONFIG_WATCHDOG) new stuff #endif
#endif
If it is not acceptable, where should I put the new stuff?
TIA, llandre
DAVE Electronics System House - R&D Department web: http://www.dave-tech.it email: r&d2@dave-tech.it

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking about something like this:
#if (defined(CONFIG_RTC_DS1374)) &&
#if (CONFIG_COMMANDS & CFG_CMD_DATE) existing stuff #endif
#if (CONFIG_WATCHDOG) new stuff #endif
#endif
If it is not acceptable, where should I put the new stuff?
I remember the u-boot of git support DS1374 RTC function.
-DAve

In message 44F2C473.5030000@dave-tech.it you wrote:
I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking
I don't like this idea. Nobody will search there when looking for watchdog code.
#if (CONFIG_WATCHDOG) new stuff #endif
How much of such "new stuff" code will be needed? I guess it's just some intialization, and eventually the trigger routine?
If it is not acceptable, where should I put the new stuff?
drivers/watchdog/ds1374.c ?
Best regards,
Wolfgang Denk

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking
I don't like this idea. Nobody will search there when looking for watchdog code.
I see.
How much of such "new stuff" code will be needed? I guess it's just some intialization, and eventually the trigger routine?
Yes, something like that.
If it is not acceptable, where should I put the new stuff?
drivers/watchdog/ds1374.c ?
Ok. What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h and to make and to make functions rtc_read and rtc_write_raw non-static?

What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h and to make functions rtc_read and rtc_write_raw non-static?
What about this proposal?

In message 44F6C648.9010904@dave-tech.it you wrote:
What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h
Sounds ok to me.
and to make functions rtc_read and rtc_write_raw non-static?
Then the functions should probably be renamed, too.
Best regards,
Wolfgang Denk
participants (3)
-
Liu Dave-r63238
-
llandre
-
Wolfgang Denk