From patchwork Mon Jul 29 07:47:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 816 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 92E893F0E1 for ; Mon, 29 Jul 2019 09:47:52 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id e20sf37980389pfd.3 for ; Mon, 29 Jul 2019 00:47:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564386471; cv=pass; d=google.com; s=arc-20160816; b=zbDrm2UhAQP5hCUKHB9DjAangRo+BkgM3bAMY3wl1dntYg4V+3TuxMbLiTHEX+lnzf k4QLZXzGbCR1YCwqqRIk/UX57byQtzYTNaD9atVzsdwZCN08nTNxDLqPJvmwPS6yRNXP RBj8ApnY3MW+ipeqE66N+NHX5xKzFOndXce9tihJgd07hH04JYGpFrrYs8Wmlxba5Zjd UyCGJdU18LcNPiJDWBy/UPyDEa26FSIQ1V9C8X2bin/iR/HNysvj4CkGS7QpJ9xikeF5 eWHQ6VlU8vlNkTPmXDNVxGSJth0oB0fcy/AdwHeKX0PcJQt9vur4cgX//lc912hUPtUw pdTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hS07LSoaVYHzagSIsAxrHdE+uAw5fkE95CpiT+3OrU0=; b=UsbEF5avs8hNK6Hnc6g8yqLoPPPgFXOXMLRqMYA+AtLyXePT38zW9pDc+aMSBarGsg ZIx+Hkjgghie+G+ET4xmuVr0Cf2zqU7Tx3h4s1HtIT8nmIeW7rrmbZnAUlX7hI+Iz3kR XzN55milIjJKgmYEYB5nfOJfswFyzjde4m5umkvL2AuyUji4wctSUYOzWK/ELwL7iz5b UOhUbzAj3IqZKPXvoP/d8AbyjPlLJ6w6fuq+w2brltWYdL4EagPmaoskgjWgv19A69pR pQ/wld2drHnOezGJvlbT+1nTssKzG0eVzgnkxydexCa3Uuhzl6vjnHqmsBTisVKayxga TkAg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Zw8yjHY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=hS07LSoaVYHzagSIsAxrHdE+uAw5fkE95CpiT+3OrU0=; b=gjZoMomtVCMll3gCEADFnc7C6eMC2BE/nJS655u/7uLBG5K7oS4yOJ1lkHf6ftz2pj iesFKBhtMKov59UgfAUvCj8fpMT+Z3GdfdadCamKjLmp2BMkJCcwKliIWjvI97aQdV5n acrYjFh8/XDbhfCN1Qpq+lpFlD1aXdWDGlxG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=hS07LSoaVYHzagSIsAxrHdE+uAw5fkE95CpiT+3OrU0=; b=t6/zgS8KP8MCYMrEEJCXryjT7sujSYQIWTzBE2MwW9Quwmuc35YicPtHSW+vTSZiLU pBDBAFG3PPoIHV2FUXEpwPAOLnlvQiA4MjfzagCnzTWphR8vepNng7ahXz3/upeku/aO XGP++h3FsVZlwZKAh+Ai+1w73SEXCxLTdHOLFJcXKClvOQUL7m1RJNFRuPLWXYVirevp 7VbYpHKjdQh0b4YNHgreJWDE06/plVKqlUpOpoFtN23V4bObYIXm5yg+9KkhFe8SDqaD /LrMApcBnIraDkSsRnWVer3hqhj1dHJjNTtD2dmIljmh7gwpA+kGDeiyroKJEvWbqHjL 2ZYA== X-Gm-Message-State: APjAAAVgZHvsOM4Uqdbkxo4n3nUg0Y6KwD85Pn6SA/LbpVht1wYgX60p WZoN1GHJ+VHEGP/Pz/xdc9bFaZbO X-Google-Smtp-Source: APXvYqx4wYMv8WyfdHrcfQ+623s4+VXP+yUvRMHm0omTKe7JmSss8n+9TbsJe7y8YHjFXFLaGAoCxw== X-Received: by 2002:a17:902:1aa:: with SMTP id b39mr60869617plb.333.1564386470964; Mon, 29 Jul 2019 00:47:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3467:: with SMTP id o94ls20990810pjb.2.gmail; Mon, 29 Jul 2019 00:47:50 -0700 (PDT) X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr112409530pjd.70.1564386470609; Mon, 29 Jul 2019 00:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564386470; cv=none; d=google.com; s=arc-20160816; b=Vb8g+ia3cJNz7zY99gIvgdk0qNnKX68AeuWxvJP943MSML4RYKXiCptPLDX7rpn+Qn PdqNOLGR8mhGyLBD8aHUjUkGgsgLedA+DB49AMzUPGhNCf+zriqPNm8YJC5aN6RTL1Uk /nfj7r8R40bN6nJmNtDZasv05hCdgQIrJ4rMS+0e/L1wGuhP9ulEsmE3f9IkeMjLYdfg 1TRIJdhcEvmHrObeePM+QCg25227JRH6BEIdXCyPw82Z41ALiVRO33e3e2T6V5lqiIaZ SbLzOT06Al9LrYfpZdDEhro0AypoPgFX/nlPIdkNP5XJOWilsP60opOwM412395R/8/o zNOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=8hP6rdkEvhhT0hEj14Sjz70+JpS0tBwbVOMye6DfvhQ=; b=EDbrh8vdL7n0LTOL3vRdLH4VvacaO2qzLCpMrAssr7S1O0Q3YRbes4DeEY5O1O3EM4 YvC5BzTV7lBJiSCiFr8Rvmfsh4F/unA1WQPNC8/gApBYgpabtnPiG6aXfN0VT29mT6C9 rTLzK+FHC7v4J57FLxbl/kIMoTZCQyINfllRzz6ZjjLVvGojmNNIP9ce3mnblWwJzXj1 aIpomzHwNIiZ4htZIxZddqh2/XjCa5Q5IuGlkMFsfz4ZhwZoUS0SmG/SMxsHxko7F14Q lKUmFWreB58Ax50gH0tES0C3jGLrLw5Ba3M9s1RltM3a/eEArNqRSxHN5AS6BKf3vvRa QiDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Zw8yjHY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a68sor81213955pje.1.2019.07.29.00.47.50 for (Google Transport Security); Mon, 29 Jul 2019 00:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90b:8cd:: with SMTP id ds13mr105023725pjb.141.1564386470284; Mon, 29 Jul 2019 00:47:50 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.41]) by smtp.gmail.com with ESMTPSA id h14sm75723348pfq.22.2019.07.29.00.47.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 00:47:49 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Akash Gajjar , u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , Chin Liang See , Andy Shevchenko Subject: [PATCH 07/15] wdt: designware: Simplify enable function Date: Mon, 29 Jul 2019 13:17:03 +0530 Message-Id: <20190729074711.16988-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190729074711.16988-1-jagan@amarulasolutions.com> References: <20190729074711.16988-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Zw8yjHY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Simplify dw watchdog enable function by using proper macro and drop unwanted macros. Cc: Chin Liang See Cc: Andy Shevchenko Signed-off-by: Jagan Teki --- drivers/watchdog/designware_wdt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index bd858f0608..2979fda44e 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -14,7 +14,6 @@ #define DW_WDT_CR_EN_OFFSET 0x00 #define DW_WDT_CR_RMOD_OFFSET 0x01 -#define DW_WDT_CR_RMOD_VAL 0x00 #define DW_WDT_CRR_RESTART_VAL 0x76 /* @@ -38,9 +37,11 @@ static int designware_wdt_settimeout(unsigned int timeout) static void designware_wdt_enable(void) { - writel(((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) | - (0x1 << DW_WDT_CR_EN_OFFSET)), - (CONFIG_DW_WDT_BASE + DW_WDT_CR)); + u32 val = readl(CONFIG_DW_WDT_BASE + DW_WDT_CR); + + /* Enable watchdog */ + val |= DW_WDT_CR_RMOD_OFFSET; + writel(val, CONFIG_DW_WDT_BASE + DW_WDT_CR); } static unsigned int designware_wdt_is_enabled(void)