Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp523115pxb; Thu, 21 Oct 2021 04:28:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKtuc3r8Ov8guDzkFwbntDpkWIAsWNbUbH3QoIQ7oqG4bnRCakNfLggIrrLdHwouwq9/A8 X-Received: by 2002:a17:90a:1a4c:: with SMTP id 12mr5843947pjl.175.1634815717345; Thu, 21 Oct 2021 04:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634815717; cv=none; d=google.com; s=arc-20160816; b=HdwYUlJMXn87/QUCdT9blWMZqRYr9hPRVLzIjNFjSkRDrN5ihy8mTRrL8EJUkfUx48 AxBuoiWl/qj68cvscW/nSO5jxI3d3CBJawbc2bUcu9u6wDxbsgkk75E2qAKLy5ciZ5hh HM8IrS+TYrMvjpzjFb5BIPoew2WCEOK/6l/HJDVYg1xVtJXrx4rEkwKQSKvGSnKO3nGo x8YDKgqBJip2dxE9o85NeXiYHYKqen1CtNfqlvWtqGZIDkD9sdA1ZB3o/LgNGPiTROKP 5sKkTFBTY3PBoRmPDBfdpV/fMPcC7WXXZgFyd6aKFrSUa4R8q9gf4WMyI1VuA/T8tle8 IqWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HRccYAAxKQH+n0Ne7PXP5DxOUX/iyOBZsE6vUgryPPA=; b=R8lCUwr2KbbpCb99ZPRCnRgulZ1lPSuGTptrBHI2ynVnoY+ydUC44eOrJLhiRPSuPX GeGEi0sxVqJ/iE1jOkG4/Pu+95NFGHoBfl6ocEzxLRL2nHD9piyvrvh/nWIT3wZAD6ZX QzPgC0Yjz37P4AqAXftlOuUHEfT+nWekiaUxHGET2mEh26GwS4rP2yBHTnWL+S8qFviR QM95xsvIfXN1t3Q98iWpK7Kvj1RADjlzKDBa6cnnXBtLqud3Rjs2hrNhWMtq0rek31hZ 0AMcB63uE1ezalKk6iKBFa4PZfWIXpS8QjbkKk+dphwZSBByIbFB4BSIGmx5gWQkIXpS aehA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wCYYjM4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h62si202800pge.509.2021.10.21.04.28.24; Thu, 21 Oct 2021 04:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wCYYjM4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbhJUL3Z (ORCPT + 99 others); Thu, 21 Oct 2021 07:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhJUL3W (ORCPT ); Thu, 21 Oct 2021 07:29:22 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6876C061749 for ; Thu, 21 Oct 2021 04:27:06 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 193-20020a1c01ca000000b00327775075f7so979147wmb.5 for ; Thu, 21 Oct 2021 04:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=HRccYAAxKQH+n0Ne7PXP5DxOUX/iyOBZsE6vUgryPPA=; b=wCYYjM4NSyxWT4PSGKrKws6r32sIgJNKs34OdlwLebZBAaAVP+417F8eBMUbSvsGYl 8H/0QZsL5tNohQsHBRbu9L+SLBZMrzXg68OSPaEoLqBwnysv9ryUlqY+D5aZVJHhTS2e tvCuD3hx0xGS3Qx7qIH5lrx+xJIqA5BGp14Bq3RBQaD6ErdnkLDqx9Y7459uZEKcstLU Ge+S9FFM/2k8rUSCq+oJ4Vqenn8ZNoix8iyR//SUt9vozAFV2cDfnlbQBeS1UA6rpK0I Ru4aN8sz2Hp/Kd7XXsG9OKGikOtg5jWYIXtVKM3xOqfr6ELXJQTFFCK+0Jq0qx8OMbuK MfuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=HRccYAAxKQH+n0Ne7PXP5DxOUX/iyOBZsE6vUgryPPA=; b=ZBSg574s0qHthUeCJIlC0dyP2eLs5IHqSzIypdVPP9U+biSooyAIFDndWWDMeiHEIP HFiqWZRTbpUhNoqlICdyCAw2tBwXYFqvQxMyLMLFmHwo2y17Kc8EXiEr870cwg9rApZZ 3/SOIiP9NyXvDTc64SymfGGFjt4OkWtFEv9YDu0PEhCEJUkh8wsz0uyQ5uKqUn5uqbLc 7+gnlNabEMAdZ/tN7FMpU4z2Ofa8MEF6zSTOPOfeX5AiTRgJvTptoqqtE+6EEBUW7cRb F+9IkQX7DLbgaaICWj/Eozln9KdIOMrOA4nbKhjg4983/ry9oUfg8GuEW3scoIshvnr6 8BHg== X-Gm-Message-State: AOAM533MG1NfKjMQ47Oj36+VV+Y6O6PepJMbQlxNdhiiDKAaXuGeZr5S jEhVXqIUXYrQ++oMQowqEs+AXQ== X-Received: by 2002:a05:600c:1c1b:: with SMTP id j27mr5689836wms.1.1634815625514; Thu, 21 Oct 2021 04:27:05 -0700 (PDT) Received: from google.com ([95.148.6.207]) by smtp.gmail.com with ESMTPSA id f8sm53282wrj.41.2021.10.21.04.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 04:27:05 -0700 (PDT) Date: Thu, 21 Oct 2021 12:27:03 +0100 From: Lee Jones To: Alistair Francis Cc: robh+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, kernel@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, linux-imx@nxp.com, amitk@kernel.org, rui.zhang@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com, linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v13 3/9] mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a Message-ID: References: <20211015122551.38951-1-alistair@alistair23.me> <20211015122551.38951-4-alistair@alistair23.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211015122551.38951-4-alistair@alistair23.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Oct 2021, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-for-MFD-by: Lee Jones > --- > drivers/mfd/simple-mfd-i2c.c | 12 +++++++++++ > include/linux/mfd/sy7636a.h | 41 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 53 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..fbc6d6aed6c0 100644 > --- a/drivers/mfd/simple-mfd-i2c.c > +++ b/drivers/mfd/simple-mfd-i2c.c > @@ -62,8 +62,20 @@ 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", }, > + { .name = "sy7636a-thermal", }, > +}; > + > +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..15caa54f0432 > --- /dev/null > +++ b/include/linux/mfd/sy7636a.h > @@ -0,0 +1,41 @@ > +/* 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 > + > +#include > +#include > +#include > +#include Why are these needed? > +#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 */ -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog