lkml.org 
[lkml]   [2013]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 3/8] watchdog: w83627hf: Enable watchdog device only if not already enabled
    Date
    There is no need to enable the watchdog device if it is already enabled.
    Also, when enabling the watchdog device, only set the watchdog device
    enable bit and do not touch other bits; depending on the chip type,
    those bits may enable other functionality.

    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    ---
    drivers/watchdog/w83627hf_wdt.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
    index bb19368..13bad31 100644
    --- a/drivers/watchdog/w83627hf_wdt.c
    +++ b/drivers/watchdog/w83627hf_wdt.c
    @@ -101,7 +101,9 @@ static void w83627hf_init(struct watchdog_device *wdog)
    }

    outb_p(0x30, WDT_EFER); /* select CR30 */
    - outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
    + t = inb(WDT_EFDR);
    + if (!(t & 0x01))
    + outb_p(t | 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */

    outb_p(0xF6, WDT_EFER); /* Select CRF6 */
    t = inb_p(WDT_EFDR); /* read CRF6 */
    --
    1.7.9.7


    \
     
     \ /
      Last update: 2013-08-17 23:21    [W:7.597 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site