From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Dzmitry Sankouski <dsankouski@gmail.com>,
Sebastian Reichel <sre@kernel.org>,
Chanwoo Choi <cw00.choi@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>, Lee Jones <lee@kernel.org>,
Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Hans de Goede <hdegoede@redhat.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
Purism Kernel Team <kernel@puri.sm>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-input@vger.kernel.org,
linux-leds@vger.kernel.org
Subject: Re: [PATCH v11 6/9] mfd: Add new driver for MAX77705 PMIC
Date: Tue, 10 Dec 2024 23:02:32 +0100 [thread overview]
Message-ID: <99cfb914-dc4e-4cb1-b4c7-c8b0e62cc3fa@wanadoo.fr> (raw)
In-Reply-To: <20241209-starqltechn_integration_upstream-v11-6-dc0598828e01@gmail.com>
Le 09/12/2024 à 12:26, Dzmitry Sankouski a écrit :
> Add the core MFD driver for max77705 PMIC. We define five sub-devices
> for which the drivers will be added in subsequent patches.
>
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
>
> ---
...
> diff --git a/drivers/mfd/max77705.c b/drivers/mfd/max77705.c
> new file mode 100644
> index 000000000000..bf71d4399b23
> --- /dev/null
> +++ b/drivers/mfd/max77705.c
> @@ -0,0 +1,233 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// Maxim MAX77705 PMIC core driver
> +//
> +// Copyright (C) 2024 Dzmitry Sankouski <dsankouski@gmail.com>
> +
> +#include <linux/i2c.h>
> +#include <linux/interrupt.h>
> +#include <linux/mfd/core.h>
> +#include <linux/mfd/max77705-private.h>
> +#include <linux/mfd/max77693-common.h>
> +#include <linux/pm.h>
> +#include <linux/power/max17042_battery.h>
> +#include <linux/module.h>
> +#include <linux/regmap.h>
> +#include <linux/of.h>
> +
> +#define I2C_ADDR_FG 0x36
> +#define FUEL_GAUGE_NAME "max77705-battery"
> +
> +const struct dev_pm_ops max77705_pm_ops;
I'm not sure that this is needed.
DEFINE_SIMPLE_DEV_PM_OPS() at the end of the file already define it, IIUC.
...
> +static int max77705_resume(struct device *dev)
> +{
> + struct i2c_client *i2c = to_i2c_client(dev);
> + struct max77693_dev *max77705 = i2c_get_clientdata(i2c);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(max77705->irq);
> +
> + enable_irq(max77705->irq);
> +
> + return 0;
> +}
> +DEFINE_SIMPLE_DEV_PM_OPS(max77705_pm_ops, max77705_suspend, max77705_resume);
> +
> +static const struct of_device_id max77705_i2c_of_match[] = {
> + { .compatible = "maxim,max77705" },
> + { },
Nitpick: Unneeded ending comma
> +};
> +MODULE_DEVICE_TABLE(of, max77705_i2c_of_match);
...
> +enum max77705_reg {
> + MAX77705_PMIC_REG_PMICID1 = 0x00,
> + MAX77705_PMIC_REG_PMICREV = 0x01,
> + MAX77705_PMIC_REG_MAINCTRL1 = 0x02,
> + MAX77705_PMIC_REG_BSTOUT_MASK = 0x03,
> + MAX77705_PMIC_REG_FORCE_EN_MASK = 0x08,
> + MAX77705_PMIC_REG_MCONFIG = 0x10,
> + MAX77705_PMIC_REG_MCONFIG2 = 0x11,
> + MAX77705_PMIC_REG_INTSRC = 0x22,
> + MAX77705_PMIC_REG_INTSRC_MASK = 0x23,
> + MAX77705_PMIC_REG_SYSTEM_INT = 0x24,
> + MAX77705_PMIC_REG_RESERVED_25 = 0x25,
> + MAX77705_PMIC_REG_SYSTEM_INT_MASK = 0x26,
> + MAX77705_PMIC_REG_RESERVED_27 = 0x27,
> + MAX77705_PMIC_REG_RESERVED_28 = 0x28,
> + MAX77705_PMIC_REG_RESERVED_29 = 0x29,
> + MAX77705_PMIC_REG_BOOSTCONTROL1 = 0x4C,
> + MAX77705_PMIC_REG_BOOSTCONTROL2 = 0x4F,
> + MAX77705_PMIC_REG_SW_RESET = 0x50,
> + MAX77705_PMIC_REG_USBC_RESET = 0x51,
> +
> + MAX77705_PMIC_REG_END,
Nitpick: Unneeded ending comma
> +};
...
> +enum max77705_fuelgauge_reg {
> + STATUS_REG = 0x00,
> + VALRT_THRESHOLD_REG = 0x01,
> + TALRT_THRESHOLD_REG = 0x02,
> + SALRT_THRESHOLD_REG = 0x03,
> + REMCAP_REP_REG = 0x05,
> + SOCREP_REG = 0x06,
> + TEMPERATURE_REG = 0x08,
> + VCELL_REG = 0x09,
> + TIME_TO_EMPTY_REG = 0x11,
> + FULLSOCTHR_REG = 0x13,
> + CURRENT_REG = 0x0A,
> + AVG_CURRENT_REG = 0x0B,
> + SOCMIX_REG = 0x0D,
> + SOCAV_REG = 0x0E,
> + REMCAP_MIX_REG = 0x0F,
> + FULLCAP_REG = 0x10,
> + RFAST_REG = 0x15,
> + AVR_TEMPERATURE_REG = 0x16,
> + CYCLES_REG = 0x17,
> + DESIGNCAP_REG = 0x18,
> + AVR_VCELL_REG = 0x19,
> + TIME_TO_FULL_REG = 0x20,
> + CONFIG_REG = 0x1D,
> + ICHGTERM_REG = 0x1E,
> + REMCAP_AV_REG = 0x1F,
> + FULLCAP_NOM_REG = 0x23,
> + LEARN_CFG_REG = 0x28,
> + FILTER_CFG_REG = 0x29,
> + MISCCFG_REG = 0x2B,
> + QRTABLE20_REG = 0x32,
> + FULLCAP_REP_REG = 0x35,
> + RCOMP_REG = 0x38,
> + VEMPTY_REG = 0x3A,
> + FSTAT_REG = 0x3D,
> + DISCHARGE_THRESHOLD_REG = 0x40,
> + QRTABLE30_REG = 0x42,
> + ISYS_REG = 0x43,
> + DQACC_REG = 0x45,
> + DPACC_REG = 0x46,
> + AVGISYS_REG = 0x4B,
> + QH_REG = 0x4D,
> + VSYS_REG = 0xB1,
> + TALRTTH2_REG = 0xB2,
> + VBYP_REG = 0xB3,
> + CONFIG2_REG = 0xBB,
> + IIN_REG = 0xD0,
> + OCV_REG = 0xEE,
> + VFOCV_REG = 0xFB,
> + VFSOC_REG = 0xFF,
> +
> + MAX77705_FG_END,
Nitpick: Unneeded ending comma
> +};
...
CJ
next prev parent reply other threads:[~2024-12-10 22:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 11:26 [PATCH v11 0/9] Add support for Maxim Integrated MAX77705 PMIC Dzmitry Sankouski
2024-12-09 11:26 ` [PATCH v11 1/9] power: supply: add undervoltage health status property Dzmitry Sankouski
2024-12-09 11:26 ` [PATCH v11 2/9] dt-bindings: power: supply: max17042: add max77705 support Dzmitry Sankouski
2024-12-09 11:26 ` [PATCH v11 3/9] dt-bindings: power: supply: max17042: split on 2 files Dzmitry Sankouski
2024-12-09 12:40 ` Rob Herring (Arm)
2024-12-10 7:38 ` Krzysztof Kozlowski
2024-12-11 14:59 ` Dzmitry Sankouski
2024-12-18 7:56 ` Krzysztof Kozlowski
2024-12-09 11:26 ` [PATCH v11 4/9] dt-bindings: mfd: add maxim,max77705 Dzmitry Sankouski
2024-12-10 7:40 ` Krzysztof Kozlowski
2024-12-09 11:26 ` [PATCH v11 5/9] power: supply: max17042: add max77705 fuel gauge support Dzmitry Sankouski
2024-12-09 11:26 ` [PATCH v11 6/9] mfd: Add new driver for MAX77705 PMIC Dzmitry Sankouski
2024-12-10 22:02 ` Christophe JAILLET [this message]
2024-12-09 11:26 ` [PATCH v11 7/9] input: max77693: add max77705 haptic support Dzmitry Sankouski
2024-12-09 11:26 ` [PATCH v11 8/9] power: supply: max77705: Add charger driver for Maxim 77705 Dzmitry Sankouski
2024-12-10 22:07 ` Christophe JAILLET
2024-12-09 11:26 ` [PATCH v11 9/9] leds: max77705: Add LEDs support Dzmitry Sankouski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99cfb914-dc4e-4cb1-b4c7-c8b0e62cc3fa@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dsankouski@gmail.com \
--cc=hdegoede@redhat.com \
--cc=kernel@puri.sm \
--cc=krzk@kernel.org \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pavel@ucw.cz \
--cc=robh@kernel.org \
--cc=sebastian.krzyszkowiak@puri.sm \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox