History log of /linux-master/drivers/mfd/mt6360-core.c
Revision Date Author Comments
# 9816d859 15-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

mfd: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230515182752.10050-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>


# 5f4f94e9 28-Sep-2022 ChiYuan Huang <cy_huang@richtek.com>

mfd: mt6360: Add bounds checking in Regmap read/write call-backs

Fix the potential risk of OOB read if bank index is over the maximum.

Refer to the discussion list for the experiment result on mt6370.
https://lore.kernel.org/all/20220914013345.GA5802@cyhuang-hp-elitebook-840-g3.rt/
If not to check the bound, there is the same issue on mt6360.

Cc: stable@vger.kernel.org
Fixes: 3b0850440a06c (mfd: mt6360: Merge different sub-devices I2C read/write)
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/1664416817-31590-1-git-send-email-u0084500@gmail.com


# 84742a98 29-Jun-2021 Fei Shao <fshao@chromium.org>

mfd: mt6360: Sort regulator resources

Reorder the regulator resources.

Signed-off-by: Fei Shao <fshao@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 3b085044 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Merge different sub-devices I2C read/write

Merge different sub-devices I2C read/write functions into one Regmap,
because PMIC and LDO part need CRC bits for access protection.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# b042c085 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Merge header file into driver and remove unuse register define

Merge header file into driver and remove unuse register define

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# e8470294 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Fix flow which is used to check ic exist

Fix flow which is used to check ic exist.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# a75a2d56 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Remove handle_post_irq callback function

Remove handle_post_irq which is used to retrigger IRQ.
Set IRQ level low trigger in dtsi to keep IRQ always be handled.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 60a90b35 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Rename mt6360_pmu by mt6360

Rename mt6360_pmu by mt6360, because of including
not only PMU part, but also entire MT6360 IC

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# e63ce9a5 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Rename mt6360_pmu_data by mt6360_ddata

Rename mt6360_pmu_data by mt6360_ddata because of including
not only PMU part, but also entire MT6360 IC.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 4ee06e10 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Combine mt6360 pmic/ldo resources into mt6360 regulator resources

Combine mt6360 pmic/ldo resources into mt6360 regulator resources
to simplify the similar resources object.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 12f3f131 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Indicate sub-dev compatible name by using "-"

Indicate sub-dev compatible name by using "-".

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 50e89312 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Remove redundant brackets around raw numbers

Remove redundant brackets around raw numbers.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 137871bc 17-May-2021 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Rearrange include file

Rearrange include file without sorting by alphabet.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# db783e76 17-Dec-2020 Lee Jones <lee.jones@linaro.org>

mfd: Standardise MFD_CELL_* helper names

Start all helpers with "MFD_CELL_".

Cc: Gene Chen <gene_chen@richtek.com>
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d38eac29 14-Sep-2020 YueHaibing <yuehaibing@huawei.com>

mfd: mt6360: Remove unused include <linux/version.h>

This file does not make use of it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# bf6b694a 08-Jun-2020 Gene Chen <gene_chen@richtek.com>

mfd: mt6360: Fix register driver NULL pointer by adding driver name

The driver name was accidentally removed when .probe() by was replaced
by .probe_new() during an early patch review.

[ 121.243012] EAX: c2a8bc64 EBX: 00000000 ECX: 00000000 EDX: 00000000
[ 121.243012] ESI: c2a8bc79 EDI: 00000000 EBP: e54bdea8 ESP: e54bdea0
[ 121.243012] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00010286
[ 121.243012] CR0: 80050033 CR2: 00000000 CR3: 02ec3000 CR4: 000006b0
[ 121.243012] Call Trace:
[ 121.243012] kset_find_obj+0x3d/0xc0
[ 121.243012] driver_find+0x16/0x40
[ 121.243012] driver_register+0x49/0x100
[ 121.243012] ? i2c_for_each_dev+0x39/0x50
[ 121.243012] ? __process_new_adapter+0x20/0x20
[ 121.243012] ? cht_wc_driver_init+0x11/0x11
[ 121.243012] i2c_register_driver+0x30/0x80
[ 121.243012] ? intel_lpss_pci_driver_init+0x16/0x16
[ 121.243012] mt6360_pmu_driver_init+0xf/0x11
[ 121.243012] do_one_initcall+0x33/0x1a0
[ 121.243012] ? parse_args+0x1eb/0x3d0
[ 121.243012] ? __might_sleep+0x31/0x90
[ 121.243012] ? kernel_init_freeable+0x10a/0x17f
[ 121.243012] kernel_init_freeable+0x12c/0x17f
[ 121.243012] ? rest_init+0x110/0x110
[ 121.243012] kernel_init+0xb/0x100
[ 121.243012] ? schedule_tail_wrapper+0x9/0xc
[ 121.243012] ret_from_fork+0x19/0x24
[ 121.243012] Modules linked in:
[ 121.243012] CR2: 0000000000000000
[ 121.243012] random: get_random_bytes called from init_oops_id+0x3a/0x40 with crng_init=0
[ 121.243012] ---[ end trace 38a803400f1a2bee ]---
[ 121.243012] EIP: strcmp+0x11/0x30

Fixes: 7edd363421dab ("mfd: Add support for PMIC MT6360")
Signed-off-by: Gene Chen <gene_chen@richtek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@kernel.org>
[Lee: Taking the opportunity to fix the compatible string too 's/_/-/']
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 098c4adf 01-Jun-2020 Lee Jones <lee.jones@linaro.org>

mfd: mt6360: Remove duplicate REGMAP_IRQ_REG_LINE() entry

Fixes the following build warning:

>> drivers/mfd/mt6360-core.c:148:2: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/regmap.h:1191:10: note: expanded from macro 'REGMAP_IRQ_REG_LINE'
[_id] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/mt6360-core.c:124:2: note: previous initialization is here
REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/regmap.h:1191:10: note: expanded from macro 'REGMAP_IRQ_REG_LINE'
[_id] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 7edd3634 23-Apr-2020 Gene Chen <gene.chen.richtek@gmail.com>

mfd: Add support for PMIC MT6360

Add MFD driver for mt6360 pmic chip include Battery Charger/
USB_PD/Flash, LED/RGB and LED/LDO/Buck

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>