Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2530775imm; Thu, 9 Aug 2018 14:49:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzggObYtbk6aMpH3yzTNNWs55uMBmuluA1AIcKIvjhI6OTo0jroqw8Z0vVp4nLJqYLV678v X-Received: by 2002:a63:e74e:: with SMTP id j14-v6mr3665329pgk.185.1533851366323; Thu, 09 Aug 2018 14:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533851366; cv=none; d=google.com; s=arc-20160816; b=Jh2IkSmnP3Bpjbcqu/+0kRHwc7/aGckD+mPMDqBPLcqgK9hwvlu03SsTy2TWBkt8vo okV8B5jjvG5ISq1bVlzUboSk7xlEpbU8/nvkllA9y9syPr4VIJqpwniugCLk15/R3VL3 sAyedYC+p99Gkf5V/u48pAv6aHpju33WJSGE7d925OY5hqd+BsuNeDTDGXD/uYTcPhzx v1PebpfI/D/QDpwR1mc69YVKGhAzsE4zW2y5tlWfyf3rslOaRATmHdGGoB+CUG6xO7Gw GQ5MuDlCQGnmR3UjJDSl+gOzPjwuHt5Ydt5HH6zfX0Da1n1bSFuqrREiaNjn35EV4WaX UgZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=nyIzzP1aZboV8EpKEre3H/ZvYsdFlH2f6oVr9m4ehUU=; b=vjorcYPs+cp/o6v9Lg05Ny3g5gSqhCtcDDn7BlJkIfrTxPhAEQlhXanoKk8LVZsih1 UO1Km5p1uWXPX7bc7U4/5M0US3KNbikDFLJ1YXfmOmWOfN2NJvbYKiRxNMSwgw78dg7T 6b35ziMhVrGgabU/kaIQVjjhxo5PCidpKM3woCn5/d4RCMj7jU3FrSq74lli8JpOwelN 6lq4SvBT3vRbLpPCQOBYDunGJiT3VpS8pdIJ1UWXXJcNfaOU5c+Y0p+qKMQD+K3cEO7Q QOibY1S/2r/8zyb1QDwr5YIFo3hG0mdCQFCS3D3mnUm/G2KEY8c4cFRpC/f2UVGWNNSC tJfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=xJEh2knv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11-v6si7604510pgi.328.2018.08.09.14.49.11; Thu, 09 Aug 2018 14:49:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=xJEh2knv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727396AbeHJALj (ORCPT + 99 others); Thu, 9 Aug 2018 20:11:39 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:55736 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727290AbeHJALf (ORCPT ); Thu, 9 Aug 2018 20:11:35 -0400 From: Paul Cercueil To: Rob Herring , Mark Rutland , Thierry Reding , Daniel Lezcano , Thomas Gleixner , Wim Van Sebroeck , Guenter Roeck , Ralf Baechle , Paul Burton , James Hogan , Jonathan Corbet , Lee Jones , Mathieu Malaterre , Ezequiel Garcia Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-mips@linux-mips.org, linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, Paul Cercueil Subject: [PATCH v6 01/24] mfd: Add ingenic-tcu.h header Date: Thu, 9 Aug 2018 23:43:51 +0200 Message-Id: <20180809214414.20905-2-paul@crapouillou.net> In-Reply-To: <20180809214414.20905-1-paul@crapouillou.net> References: <20180809214414.20905-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1533851087; bh=nyIzzP1aZboV8EpKEre3H/ZvYsdFlH2f6oVr9m4ehUU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=xJEh2knvGp4U7u8nxN8MdodBM6fEDcSoVGd9XAesA8WubAI9ix8T0tJaVk/G1cWQTP6WG21abFgX4JM+vchc5mX0Ks+KTid5OkAb7HskLEVao4PfBBtsVVk+eg90Br2zQxdM5zLx6EvcmZjaVIhwffH6mKt0V/oNILrZ8KdXBac= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This header contains macros for the registers that are present in the regmap shared by all the drivers related to the TCU (Timer Counter Unit) of the Ingenic JZ47xx SoCs. Signed-off-by: Paul Cercueil Acked-by: Lee Jones --- include/linux/mfd/ingenic-tcu.h | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/linux/mfd/ingenic-tcu.h v2: Use SPDX identifier for the license v3: - Use macros instead of enum - Add 'TCU_' at the beginning of each macro - Remove useless include v4: No change v5: No change v6: Rename barrier macro from __LINUX_CLK_INGENIC_TCU_H__ to __LINUX_MFD_INGENIC_TCU_H__ diff --git a/include/linux/mfd/ingenic-tcu.h b/include/linux/mfd/ingenic-tcu.h new file mode 100644 index 000000000000..3d85f075d2db --- /dev/null +++ b/include/linux/mfd/ingenic-tcu.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Header file for the Ingenic JZ47xx TCU driver + */ +#ifndef __LINUX_MFD_INGENIC_TCU_H_ +#define __LINUX_MFD_INGENIC_TCU_H_ + +#include + +#define TCU_REG_WDT_TDR 0x00 +#define TCU_REG_WDT_TCER 0x04 +#define TCU_REG_WDT_TCNT 0x08 +#define TCU_REG_WDT_TCSR 0x0c +#define TCU_REG_TER 0x10 +#define TCU_REG_TESR 0x14 +#define TCU_REG_TECR 0x18 +#define TCU_REG_TSR 0x1c +#define TCU_REG_TFR 0x20 +#define TCU_REG_TFSR 0x24 +#define TCU_REG_TFCR 0x28 +#define TCU_REG_TSSR 0x2c +#define TCU_REG_TMR 0x30 +#define TCU_REG_TMSR 0x34 +#define TCU_REG_TMCR 0x38 +#define TCU_REG_TSCR 0x3c +#define TCU_REG_TDFR0 0x40 +#define TCU_REG_TDHR0 0x44 +#define TCU_REG_TCNT0 0x48 +#define TCU_REG_TCSR0 0x4c +#define TCU_REG_OST_DR 0xe0 +#define TCU_REG_OST_CNTL 0xe4 +#define TCU_REG_OST_CNTH 0xe8 +#define TCU_REG_OST_TCSR 0xec +#define TCU_REG_TSTR 0xf0 +#define TCU_REG_TSTSR 0xf4 +#define TCU_REG_TSTCR 0xf8 +#define TCU_REG_OST_CNTHBUF 0xfc + +#define TCU_TCSR_RESERVED_BITS 0x3f +#define TCU_TCSR_PARENT_CLOCK_MASK 0x07 +#define TCU_TCSR_PRESCALE_LSB 3 +#define TCU_TCSR_PRESCALE_MASK 0x38 + +#define TCU_TCSR_PWM_SD BIT(9) /* 0: Shutdown abruptly 1: gracefully */ +#define TCU_TCSR_PWM_INITL_HIGH BIT(8) /* Sets the initial output level */ +#define TCU_TCSR_PWM_EN BIT(7) /* PWM pin output enable */ + +#define TCU_WDT_TCER_TCEN BIT(0) /* Watchdog timer enable */ + +#define TCU_CHANNEL_STRIDE 0x10 +#define TCU_REG_TDFRc(c) (TCU_REG_TDFR0 + ((c) * TCU_CHANNEL_STRIDE)) +#define TCU_REG_TDHRc(c) (TCU_REG_TDHR0 + ((c) * TCU_CHANNEL_STRIDE)) +#define TCU_REG_TCNTc(c) (TCU_REG_TCNT0 + ((c) * TCU_CHANNEL_STRIDE)) +#define TCU_REG_TCSRc(c) (TCU_REG_TCSR0 + ((c) * TCU_CHANNEL_STRIDE)) + +#endif /* __LINUX_MFD_INGENIC_TCU_H_ */ -- 2.11.0