From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDC1EC433F5 for ; Wed, 10 Nov 2021 12:32:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8ABF6610CB for ; Wed, 10 Nov 2021 12:32:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8ABF6610CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6PxuAjQwYoGE8XmEIZqrRB5uzAqqAhrQ/JRUNGBwb04=; b=ORnHNv71bmweb9 U360qKHWAYLnPXgTjZlUkIxxz0jpX+6JrGHP6G+7xN14IVRbKoVKULRAjJPYVkAc/6ePrqoGfciOA 7xWpqGZNtFZqiyrF2Otq1M/zexdjCsIjYBrsoxjNNDtU2bJAnvqQlzaL2QUYaB7T/hr545bRJL8Lx N1EwE8aoBVdAl3JmISNmUQ0jAeCiXb4Mjy7uq2XXkE5EYHQ9NQfS+816D2ab41zzk326OZrVksYcY woIgNYTLCaBhddgNmgVvHT8Uz5sG8dVNl18foKpGuYjiWhfHJ7vpG9OU17WJMbE+7RA9FwPcIUJF7 0y9M5HsPLF/xSlJlnzSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkmkT-005P6q-3O; Wed, 10 Nov 2021 12:30:41 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkmk5-005P1t-Gl for linux-arm-kernel@lists.infradead.org; Wed, 10 Nov 2021 12:30:19 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id CBBB4580867; Wed, 10 Nov 2021 07:30:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 10 Nov 2021 07:30:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=LuBuJ51kAs683 zqagRQH/JKcv0PkL6c6myFxIpkwVuU=; b=WXqqYsLPWMrZFTi+OsHclSw1gfZ93 lKgMeeGpn+t/n5l7QFtDeqOnnEETnyPTSbVFmoliEZ0WVBgB5ZF1GpQ85IsAKuCZ RpG4Ou49VyjMHeJnCt6AG9BgmiG8/+9hU+QEyoglVw5x6V4yGviaaPBSw0Pa/qMC 6OheWgKn3zpLWfuHyiJCDlZrz1pgiJHHK2afUVxWkfOydO5A//lu5jRGhrw/pSpd 6o3TVk/WwYUt1EtZFILw0KnWfzjysj2mf8/5DZdluYV8Y+FCTBOqE5iOuZ80gxjf ubv+h2sXabu1qtmYLhrtQfQLwOUcRdzA5FDh6FsKsHnMwIkLOtt2RfRig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=LuBuJ51kAs683zqagRQH/JKcv0PkL6c6myFxIpkwVuU=; b=JXjigXYy 6YiwB1K4VPfRsQO8R3uJoLjF4r1VWJwEJeAAVcWx573qVvoIecA8K8W7NTbafrpa xSK6XWtapGILZM+0+iLPa5kzMvVmsK9MyQSjR/WnFxdWX1feUha5ga8tLPwbGzCz O7p6BbUYQ+r6jsxbVYZrc4wBhJqjJD5Axbb1xHBNs7W07o8616jPcrS9LjbEyI3P yFgi+xyFg1kRoRl4Hoh0ootxhBHreS4dhALw8nhQOSLKWmk/RsHpMIzN7YdxQ1Lc tu2rBJbGRufQwPFJGuMqoWHod63DMR74lRhzIsKbZtH1C6dF8lZKrU/8CewL+gnw vFEvbxJr8pGDrg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudejgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepheffjeetteetke ffhfdvgefhgeevvddvueejheehfeevfedufeegiedtheeujeelnecuffhomhgrihhnpehr vghmrghrkhgrsghlvgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 07:30:10 -0500 (EST) From: Alistair Francis To: lee.jones@linaro.org, broonie@kernel.org, kernel@pengutronix.de, lgirdwood@gmail.com, robh+dt@kernel.org Cc: linux-kernel@vger.kernel.org, rui.zhang@intel.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, s.hauer@pengutronix.de, linux-hwmon@vger.kernel.org, amitk@kernel.org, linux-pm@vger.kernel.org, linux-imx@nxp.com, alistair23@gmail.com, andreas@kemnade.info, shawnguo@kernel.org, Alistair Francis Subject: [PATCH v15 3/8] mfd: simple-mfd-i2c: Enable support for the silergy, sy7636a Date: Wed, 10 Nov 2021 22:29:43 +1000 Message-Id: <20211110122948.188683-4-alistair@alistair23.me> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211110122948.188683-1-alistair@alistair23.me> References: <20211110122948.188683-1-alistair@alistair23.me> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211110_043017_680771_F3978146 X-CRM114-Status: GOOD ( 13.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Alistair Francis Acked-for-MFD-by: Lee Jones --- drivers/mfd/simple-mfd-i2c.c | 11 +++++++++++ include/linux/mfd/sy7636a.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 include/linux/mfd/sy7636a.h diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 51536691ad9d..f4c8fc3ee463 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -62,8 +62,19 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c) return ret; } +static const struct mfd_cell sy7636a_cells[] = { + { .name = "sy7636a-regulator", }, + { .name = "sy7636a-temperature", }, +}; + +static const struct simple_mfd_data silergy_sy7636a = { + .mfd_cell = sy7636a_cells, + .mfd_cell_size = ARRAY_SIZE(sy7636a_cells), +}; + static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, + { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a}, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); diff --git a/include/linux/mfd/sy7636a.h b/include/linux/mfd/sy7636a.h new file mode 100644 index 000000000000..2797c22dabc2 --- /dev/null +++ b/include/linux/mfd/sy7636a.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Functions to access SY3686A power management chip. + * + * Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/ + */ + +#ifndef __MFD_SY7636A_H +#define __MFD_SY7636A_H + +#define SY7636A_REG_OPERATION_MODE_CRL 0x00 +#define SY7636A_OPERATION_MODE_CRL_VCOMCTL BIT(6) +#define SY7636A_OPERATION_MODE_CRL_ONOFF BIT(7) +#define SY7636A_REG_VCOM_ADJUST_CTRL_L 0x01 +#define SY7636A_REG_VCOM_ADJUST_CTRL_H 0x02 +#define SY7636A_REG_VCOM_ADJUST_CTRL_MASK 0x01ff +#define SY7636A_REG_VLDO_VOLTAGE_ADJULST_CTRL 0x03 +#define SY7636A_REG_POWER_ON_DELAY_TIME 0x06 +#define SY7636A_REG_FAULT_FLAG 0x07 +#define SY7636A_FAULT_FLAG_PG BIT(0) +#define SY7636A_REG_TERMISTOR_READOUT 0x08 + +#define SY7636A_REG_MAX 0x08 + +#define VCOM_MIN 0 +#define VCOM_MAX 5000 + +#define VCOM_ADJUST_CTRL_MASK 0x1ff +// Used to shift the high byte +#define VCOM_ADJUST_CTRL_SHIFT 8 +// Used to scale from VCOM_ADJUST_CTRL to mv +#define VCOM_ADJUST_CTRL_SCAL 10000 + +#define FAULT_FLAG_SHIFT 1 + +#endif /* __LINUX_MFD_SY7636A_H */ -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel