Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752806AbbG2Goh (ORCPT ); Wed, 29 Jul 2015 02:44:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:48301 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbbG2Gof (ORCPT ); Wed, 29 Jul 2015 02:44:35 -0400 Subject: Re: [PATCH 3/5] iTCO_wdt: Add support for TCO on Intel Sunrisepoint From: Jean Delvare To: Matt Fleming Cc: Wim Van Sebroeck , linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Mika Westerberg , Andy Shevchenko , Wolfram Sang , Matt Fleming In-Reply-To: <1438004292-16382-4-git-send-email-matt@codeblueprint.co.uk> References: <1438004292-16382-1-git-send-email-matt@codeblueprint.co.uk> <1438004292-16382-4-git-send-email-matt@codeblueprint.co.uk> Content-Type: text/plain; charset="UTF-8" Organization: Suse Linux Date: Tue, 28 Jul 2015 19:03:41 +0200 Message-ID: <1438103021.24962.46.camel@chaos.site> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1779 Lines: 46 Hi Matt, Le Monday 27 July 2015 à 14:38 +0100, Matt Fleming a écrit : > From: Matt Fleming > > The revision of the watchdog hardware in Sunrisepoint necessitates a new > "version" inside the TCO watchdog driver because some of the register > layouts have changed. > > Cc: Wim Van Sebroeck > Signed-off-by: Matt Fleming > --- > drivers/watchdog/iTCO_wdt.c | 58 ++++++++++++++++++++++++++------------------- > 1 file changed, 34 insertions(+), 24 deletions(-) > > diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c > index 9a6e70976f64..17dfbc51b85a 100644 > --- a/drivers/watchdog/iTCO_wdt.c > +++ b/drivers/watchdog/iTCO_wdt.c > (...) > @@ -503,7 +510,10 @@ static int iTCO_wdt_probe(struct platform_device *dev) > pdata->name, pdata->iTCO_version, (u64)TCOBASE); > > /* Clear out the (probably old) status */ > - if (iTCO_wdt_private.iTCO_version == 3) { > + if (iTCO_wdt_private.iTCO_version == 4) { > + outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ > + outw(0x0002, TCO2_STS); /* Clear SECOND_TO_STS bit */ > + } else if (iTCO_wdt_private.iTCO_version == 3) { > outl(0x20008, TCO1_STS); > } else { > outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ The "version == 4" branch is a subset of the "else" branch, so you could merge both with a conditional. If you prefer not to, then it probably makes sense to change the whole block to a switch/case construct. -- Jean Delvare SUSE L3 Support -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/