* [PATCH v2 0/9] Remove pcf50633
@ 2025-03-11 1:49 linux
2025-03-11 1:49 ` [PATCH v2 1/9] mfd: pcf50633-adc: Remove linux
` (10 more replies)
0 siblings, 11 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
I've split this up based on the subcomponents to make the size
of each patch sensible.
v2
Moved most of the mfd updates out of the subsystem patches.
Swung the backlight nearer the end, since we can't avoid fixing
up the core.
Dave
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Dr. David Alan Gilbert (9):
mfd: pcf50633-adc: Remove
rtc: pcf50633: Remove
mfd: pcF50633-gpio: Remove
Input: pcf50633-input - Remove
regulator: pcf50633-regulator: Remove
power: supply: pcf50633: Remove charger
backlight: pcf50633-backlight: Remove
mfd: pcf50633: Remove irq code
mfd: pcf50633: Remove remains
arch/mips/configs/ip27_defconfig | 3 -
drivers/input/misc/Kconfig | 7 -
drivers/input/misc/Makefile | 1 -
drivers/input/misc/pcf50633-input.c | 113 -----
drivers/mfd/Kconfig | 24 -
drivers/mfd/Makefile | 4 -
drivers/mfd/pcf50633-adc.c | 255 ----------
drivers/mfd/pcf50633-core.c | 304 ------------
drivers/mfd/pcf50633-gpio.c | 92 ----
drivers/mfd/pcf50633-irq.c | 312 -------------
drivers/power/supply/Kconfig | 6 -
drivers/power/supply/Makefile | 1 -
drivers/power/supply/pcf50633-charger.c | 466 -------------------
drivers/regulator/Kconfig | 7 -
drivers/regulator/Makefile | 1 -
drivers/regulator/pcf50633-regulator.c | 124 -----
drivers/rtc/Kconfig | 7 -
drivers/rtc/Makefile | 1 -
drivers/rtc/rtc-pcf50633.c | 284 -----------
drivers/video/backlight/Kconfig | 7 -
drivers/video/backlight/Makefile | 1 -
drivers/video/backlight/pcf50633-backlight.c | 154 ------
include/linux/mfd/pcf50633/adc.h | 69 ---
include/linux/mfd/pcf50633/backlight.h | 42 --
include/linux/mfd/pcf50633/core.h | 232 ---------
include/linux/mfd/pcf50633/gpio.h | 48 --
include/linux/mfd/pcf50633/mbc.h | 130 ------
include/linux/mfd/pcf50633/pmic.h | 68 ---
28 files changed, 2763 deletions(-)
delete mode 100644 drivers/input/misc/pcf50633-input.c
delete mode 100644 drivers/mfd/pcf50633-adc.c
delete mode 100644 drivers/mfd/pcf50633-core.c
delete mode 100644 drivers/mfd/pcf50633-gpio.c
delete mode 100644 drivers/mfd/pcf50633-irq.c
delete mode 100644 drivers/power/supply/pcf50633-charger.c
delete mode 100644 drivers/regulator/pcf50633-regulator.c
delete mode 100644 drivers/rtc/rtc-pcf50633.c
delete mode 100644 drivers/video/backlight/pcf50633-backlight.c
delete mode 100644 include/linux/mfd/pcf50633/adc.h
delete mode 100644 include/linux/mfd/pcf50633/backlight.h
delete mode 100644 include/linux/mfd/pcf50633/core.h
delete mode 100644 include/linux/mfd/pcf50633/gpio.h
delete mode 100644 include/linux/mfd/pcf50633/mbc.h
delete mode 100644 include/linux/mfd/pcf50633/pmic.h
--
2.48.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/9] mfd: pcf50633-adc: Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
@ 2025-03-11 1:49 ` linux
2025-03-11 1:49 ` [PATCH v2 2/9] rtc: pcf50633: Remove linux
` (9 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
arch/mips/configs/ip27_defconfig | 1 -
drivers/mfd/Kconfig | 7 -
drivers/mfd/Makefile | 1 -
drivers/mfd/pcf50633-adc.c | 255 -------------------------------
include/linux/mfd/pcf50633/adc.h | 69 ---------
5 files changed, 333 deletions(-)
delete mode 100644 drivers/mfd/pcf50633-adc.c
delete mode 100644 include/linux/mfd/pcf50633/adc.h
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index b08a199767d1..66085bb71bc4 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -256,7 +256,6 @@ CONFIG_I2C_STUB=m
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
CONFIG_MFD_PCF50633=m
-CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
# CONFIG_VGA_ARB is not set
CONFIG_LEDS_LP3944=m
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 6b0682af6e32..051272126fe1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1129,13 +1129,6 @@ config MFD_PCF50633
facilities, and registers devices for the various functions
so that function-specific drivers can bind to them.
-config PCF50633_ADC
- tristate "NXP PCF50633 ADC"
- depends on MFD_PCF50633
- help
- Say yes here if you want to include support for ADC in the
- NXP PCF50633 chip.
-
config PCF50633_GPIO
tristate "NXP PCF50633 GPIO"
depends on MFD_PCF50633
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 9220eaf7cf12..e085da3f13c3 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -185,7 +185,6 @@ obj-$(CONFIG_MFD_MT6397) += mt6397.o
pcf50633-objs := pcf50633-core.o pcf50633-irq.o
obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
-obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o
obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o
obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o
obj-$(CONFIG_ABX500_CORE) += abx500-core.o
diff --git a/drivers/mfd/pcf50633-adc.c b/drivers/mfd/pcf50633-adc.c
deleted file mode 100644
index 1fbba0e666d5..000000000000
--- a/drivers/mfd/pcf50633-adc.c
+++ /dev/null
@@ -1,255 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 ADC Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- *
- * NOTE: This driver does not yet support subtractive ADC mode, which means
- * you can do only one measurement per read request.
- */
-
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/completion.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/adc.h>
-
-struct pcf50633_adc_request {
- int mux;
- int avg;
- void (*callback)(struct pcf50633 *, void *, int);
- void *callback_param;
-};
-
-struct pcf50633_adc_sync_request {
- int result;
- struct completion completion;
-};
-
-#define PCF50633_MAX_ADC_FIFO_DEPTH 8
-
-struct pcf50633_adc {
- struct pcf50633 *pcf;
-
- /* Private stuff */
- struct pcf50633_adc_request *queue[PCF50633_MAX_ADC_FIFO_DEPTH];
- int queue_head;
- int queue_tail;
- struct mutex queue_mutex;
-};
-
-static inline struct pcf50633_adc *__to_adc(struct pcf50633 *pcf)
-{
- return platform_get_drvdata(pcf->adc_pdev);
-}
-
-static void adc_setup(struct pcf50633 *pcf, int channel, int avg)
-{
- channel &= PCF50633_ADCC1_ADCMUX_MASK;
-
- /* kill ratiometric, but enable ACCSW biasing */
- pcf50633_reg_write(pcf, PCF50633_REG_ADCC2, 0x00);
- pcf50633_reg_write(pcf, PCF50633_REG_ADCC3, 0x01);
-
- /* start ADC conversion on selected channel */
- pcf50633_reg_write(pcf, PCF50633_REG_ADCC1, channel | avg |
- PCF50633_ADCC1_ADCSTART | PCF50633_ADCC1_RES_10BIT);
-}
-
-static void trigger_next_adc_job_if_any(struct pcf50633 *pcf)
-{
- struct pcf50633_adc *adc = __to_adc(pcf);
- int head;
-
- head = adc->queue_head;
-
- if (!adc->queue[head])
- return;
-
- adc_setup(pcf, adc->queue[head]->mux, adc->queue[head]->avg);
-}
-
-static int
-adc_enqueue_request(struct pcf50633 *pcf, struct pcf50633_adc_request *req)
-{
- struct pcf50633_adc *adc = __to_adc(pcf);
- int head, tail;
-
- mutex_lock(&adc->queue_mutex);
-
- head = adc->queue_head;
- tail = adc->queue_tail;
-
- if (adc->queue[tail]) {
- mutex_unlock(&adc->queue_mutex);
- dev_err(pcf->dev, "ADC queue is full, dropping request\n");
- return -EBUSY;
- }
-
- adc->queue[tail] = req;
- if (head == tail)
- trigger_next_adc_job_if_any(pcf);
- adc->queue_tail = (tail + 1) & (PCF50633_MAX_ADC_FIFO_DEPTH - 1);
-
- mutex_unlock(&adc->queue_mutex);
-
- return 0;
-}
-
-static void pcf50633_adc_sync_read_callback(struct pcf50633 *pcf, void *param,
- int result)
-{
- struct pcf50633_adc_sync_request *req = param;
-
- req->result = result;
- complete(&req->completion);
-}
-
-int pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg)
-{
- struct pcf50633_adc_sync_request req;
- int ret;
-
- init_completion(&req.completion);
-
- ret = pcf50633_adc_async_read(pcf, mux, avg,
- pcf50633_adc_sync_read_callback, &req);
- if (ret)
- return ret;
-
- wait_for_completion(&req.completion);
-
- return req.result;
-}
-EXPORT_SYMBOL_GPL(pcf50633_adc_sync_read);
-
-int pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg,
- void (*callback)(struct pcf50633 *, void *, int),
- void *callback_param)
-{
- struct pcf50633_adc_request *req;
- int ret;
-
- /* req is freed when the result is ready, in interrupt handler */
- req = kmalloc(sizeof(*req), GFP_KERNEL);
- if (!req)
- return -ENOMEM;
-
- req->mux = mux;
- req->avg = avg;
- req->callback = callback;
- req->callback_param = callback_param;
-
- ret = adc_enqueue_request(pcf, req);
- if (ret)
- kfree(req);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(pcf50633_adc_async_read);
-
-static int adc_result(struct pcf50633 *pcf)
-{
- u8 adcs1, adcs3;
- u16 result;
-
- adcs1 = pcf50633_reg_read(pcf, PCF50633_REG_ADCS1);
- adcs3 = pcf50633_reg_read(pcf, PCF50633_REG_ADCS3);
- result = (adcs1 << 2) | (adcs3 & PCF50633_ADCS3_ADCDAT1L_MASK);
-
- dev_dbg(pcf->dev, "adc result = %d\n", result);
-
- return result;
-}
-
-static void pcf50633_adc_irq(int irq, void *data)
-{
- struct pcf50633_adc *adc = data;
- struct pcf50633 *pcf = adc->pcf;
- struct pcf50633_adc_request *req;
- int head, res;
-
- mutex_lock(&adc->queue_mutex);
- head = adc->queue_head;
-
- req = adc->queue[head];
- if (WARN_ON(!req)) {
- dev_err(pcf->dev, "pcf50633-adc irq: ADC queue empty!\n");
- mutex_unlock(&adc->queue_mutex);
- return;
- }
- adc->queue[head] = NULL;
- adc->queue_head = (head + 1) &
- (PCF50633_MAX_ADC_FIFO_DEPTH - 1);
-
- res = adc_result(pcf);
- trigger_next_adc_job_if_any(pcf);
-
- mutex_unlock(&adc->queue_mutex);
-
- req->callback(pcf, req->callback_param, res);
- kfree(req);
-}
-
-static int pcf50633_adc_probe(struct platform_device *pdev)
-{
- struct pcf50633_adc *adc;
-
- adc = devm_kzalloc(&pdev->dev, sizeof(*adc), GFP_KERNEL);
- if (!adc)
- return -ENOMEM;
-
- adc->pcf = dev_to_pcf50633(pdev->dev.parent);
- platform_set_drvdata(pdev, adc);
-
- pcf50633_register_irq(adc->pcf, PCF50633_IRQ_ADCRDY,
- pcf50633_adc_irq, adc);
-
- mutex_init(&adc->queue_mutex);
-
- return 0;
-}
-
-static void pcf50633_adc_remove(struct platform_device *pdev)
-{
- struct pcf50633_adc *adc = platform_get_drvdata(pdev);
- int i, head;
-
- pcf50633_free_irq(adc->pcf, PCF50633_IRQ_ADCRDY);
-
- mutex_lock(&adc->queue_mutex);
- head = adc->queue_head;
-
- if (WARN_ON(adc->queue[head]))
- dev_err(adc->pcf->dev,
- "adc driver removed with request pending\n");
-
- for (i = 0; i < PCF50633_MAX_ADC_FIFO_DEPTH; i++)
- kfree(adc->queue[i]);
-
- mutex_unlock(&adc->queue_mutex);
-}
-
-static struct platform_driver pcf50633_adc_driver = {
- .driver = {
- .name = "pcf50633-adc",
- },
- .probe = pcf50633_adc_probe,
- .remove = pcf50633_adc_remove,
-};
-
-module_platform_driver(pcf50633_adc_driver);
-
-MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
-MODULE_DESCRIPTION("PCF50633 adc driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pcf50633-adc");
-
diff --git a/include/linux/mfd/pcf50633/adc.h b/include/linux/mfd/pcf50633/adc.h
deleted file mode 100644
index 6a81896d4889..000000000000
--- a/include/linux/mfd/pcf50633/adc.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * adc.h -- Driver for NXP PCF50633 ADC
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * All rights reserved.
- */
-
-#ifndef __LINUX_MFD_PCF50633_ADC_H
-#define __LINUX_MFD_PCF50633_ADC_H
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/platform_device.h>
-
-/* ADC Registers */
-#define PCF50633_REG_ADCC3 0x52
-#define PCF50633_REG_ADCC2 0x53
-#define PCF50633_REG_ADCC1 0x54
-#define PCF50633_REG_ADCS1 0x55
-#define PCF50633_REG_ADCS2 0x56
-#define PCF50633_REG_ADCS3 0x57
-
-#define PCF50633_ADCC1_ADCSTART 0x01
-#define PCF50633_ADCC1_RES_8BIT 0x02
-#define PCF50633_ADCC1_RES_10BIT 0x00
-#define PCF50633_ADCC1_AVERAGE_NO 0x00
-#define PCF50633_ADCC1_AVERAGE_4 0x04
-#define PCF50633_ADCC1_AVERAGE_8 0x08
-#define PCF50633_ADCC1_AVERAGE_16 0x0c
-#define PCF50633_ADCC1_MUX_BATSNS_RES 0x00
-#define PCF50633_ADCC1_MUX_BATSNS_SUBTR 0x10
-#define PCF50633_ADCC1_MUX_ADCIN2_RES 0x20
-#define PCF50633_ADCC1_MUX_ADCIN2_SUBTR 0x30
-#define PCF50633_ADCC1_MUX_BATTEMP 0x60
-#define PCF50633_ADCC1_MUX_ADCIN1 0x70
-#define PCF50633_ADCC1_AVERAGE_MASK 0x0c
-#define PCF50633_ADCC1_ADCMUX_MASK 0xf0
-
-#define PCF50633_ADCC2_RATIO_NONE 0x00
-#define PCF50633_ADCC2_RATIO_BATTEMP 0x01
-#define PCF50633_ADCC2_RATIO_ADCIN1 0x02
-#define PCF50633_ADCC2_RATIO_BOTH 0x03
-#define PCF50633_ADCC2_RATIOSETTL_100US 0x04
-
-#define PCF50633_ADCC3_ACCSW_EN 0x01
-#define PCF50633_ADCC3_NTCSW_EN 0x04
-#define PCF50633_ADCC3_RES_DIV_TWO 0x10
-#define PCF50633_ADCC3_RES_DIV_THREE 0x00
-
-#define PCF50633_ADCS3_REF_NTCSW 0x00
-#define PCF50633_ADCS3_REF_ACCSW 0x10
-#define PCF50633_ADCS3_REF_2V0 0x20
-#define PCF50633_ADCS3_REF_VISA 0x30
-#define PCF50633_ADCS3_REF_2V0_2 0x70
-#define PCF50633_ADCS3_ADCRDY 0x80
-
-#define PCF50633_ADCS3_ADCDAT1L_MASK 0x03
-#define PCF50633_ADCS3_ADCDAT2L_MASK 0x0c
-#define PCF50633_ADCS3_ADCDAT2L_SHIFT 2
-#define PCF50633_ASCS3_REF_MASK 0x70
-
-extern int
-pcf50633_adc_async_read(struct pcf50633 *pcf, int mux, int avg,
- void (*callback)(struct pcf50633 *, void *, int),
- void *callback_param);
-extern int
-pcf50633_adc_sync_read(struct pcf50633 *pcf, int mux, int avg);
-
-#endif /* __LINUX_PCF50633_ADC_H */
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/9] rtc: pcf50633: Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
2025-03-11 1:49 ` [PATCH v2 1/9] mfd: pcf50633-adc: Remove linux
@ 2025-03-11 1:49 ` linux
2025-03-17 21:56 ` (subset) " Alexandre Belloni
2025-03-11 1:49 ` [PATCH v2 3/9] mfd: pcF50633-gpio: Remove linux
` (8 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/rtc/Kconfig | 7 -
drivers/rtc/Makefile | 1 -
drivers/rtc/rtc-pcf50633.c | 284 -------------------------------------
3 files changed, 292 deletions(-)
delete mode 100644 drivers/rtc/rtc-pcf50633.c
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 0bbbf778ecfa..838bdc138ffe 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1321,13 +1321,6 @@ config RTC_DRV_SPEAR
If you say Y here you will get support for the RTC found on
spear
-config RTC_DRV_PCF50633
- depends on MFD_PCF50633
- tristate "NXP PCF50633 RTC"
- help
- If you say yes here you get support for the RTC subsystem of the
- NXP PCF50633 used in embedded systems.
-
config RTC_DRV_AB8500
tristate "ST-Ericsson AB8500 RTC"
depends on AB8500_CORE
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 489b4ab07068..31473b3276d9 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -126,7 +126,6 @@ obj-$(CONFIG_RTC_DRV_PALMAS) += rtc-palmas.o
obj-$(CONFIG_RTC_DRV_PCAP) += rtc-pcap.o
obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o
obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o
-obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o
obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o
obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
deleted file mode 100644
index c019c4d91c7d..000000000000
--- a/drivers/rtc/rtc-pcf50633.c
+++ /dev/null
@@ -1,284 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 RTC Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-#include <linux/rtc.h>
-#include <linux/bcd.h>
-#include <linux/err.h>
-
-#include <linux/mfd/pcf50633/core.h>
-
-#define PCF50633_REG_RTCSC 0x59 /* Second */
-#define PCF50633_REG_RTCMN 0x5a /* Minute */
-#define PCF50633_REG_RTCHR 0x5b /* Hour */
-#define PCF50633_REG_RTCWD 0x5c /* Weekday */
-#define PCF50633_REG_RTCDT 0x5d /* Day */
-#define PCF50633_REG_RTCMT 0x5e /* Month */
-#define PCF50633_REG_RTCYR 0x5f /* Year */
-#define PCF50633_REG_RTCSCA 0x60 /* Alarm Second */
-#define PCF50633_REG_RTCMNA 0x61 /* Alarm Minute */
-#define PCF50633_REG_RTCHRA 0x62 /* Alarm Hour */
-#define PCF50633_REG_RTCWDA 0x63 /* Alarm Weekday */
-#define PCF50633_REG_RTCDTA 0x64 /* Alarm Day */
-#define PCF50633_REG_RTCMTA 0x65 /* Alarm Month */
-#define PCF50633_REG_RTCYRA 0x66 /* Alarm Year */
-
-enum pcf50633_time_indexes {
- PCF50633_TI_SEC,
- PCF50633_TI_MIN,
- PCF50633_TI_HOUR,
- PCF50633_TI_WKDAY,
- PCF50633_TI_DAY,
- PCF50633_TI_MONTH,
- PCF50633_TI_YEAR,
- PCF50633_TI_EXTENT /* always last */
-};
-
-struct pcf50633_time {
- u_int8_t time[PCF50633_TI_EXTENT];
-};
-
-struct pcf50633_rtc {
- int alarm_enabled;
- int alarm_pending;
-
- struct pcf50633 *pcf;
- struct rtc_device *rtc_dev;
-};
-
-static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50633_time *pcf)
-{
- rtc->tm_sec = bcd2bin(pcf->time[PCF50633_TI_SEC]);
- rtc->tm_min = bcd2bin(pcf->time[PCF50633_TI_MIN]);
- rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]);
- rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]);
- rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]);
- rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]) - 1;
- rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100;
-}
-
-static void rtc2pcf_time(struct pcf50633_time *pcf, struct rtc_time *rtc)
-{
- pcf->time[PCF50633_TI_SEC] = bin2bcd(rtc->tm_sec);
- pcf->time[PCF50633_TI_MIN] = bin2bcd(rtc->tm_min);
- pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour);
- pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday);
- pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday);
- pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon + 1);
- pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100);
-}
-
-static int
-pcf50633_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
-{
- struct pcf50633_rtc *rtc = dev_get_drvdata(dev);
- int err;
-
- if (enabled)
- err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
- else
- err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
-
- if (err < 0)
- return err;
-
- rtc->alarm_enabled = enabled;
-
- return 0;
-}
-
-static int pcf50633_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
- struct pcf50633_rtc *rtc;
- struct pcf50633_time pcf_tm;
- int ret;
-
- rtc = dev_get_drvdata(dev);
-
- ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSC,
- PCF50633_TI_EXTENT,
- &pcf_tm.time[0]);
- if (ret != PCF50633_TI_EXTENT) {
- dev_err(dev, "Failed to read time\n");
- return -EIO;
- }
-
- dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
- pcf_tm.time[PCF50633_TI_DAY],
- pcf_tm.time[PCF50633_TI_MONTH],
- pcf_tm.time[PCF50633_TI_YEAR],
- pcf_tm.time[PCF50633_TI_HOUR],
- pcf_tm.time[PCF50633_TI_MIN],
- pcf_tm.time[PCF50633_TI_SEC]);
-
- pcf2rtc_time(tm, &pcf_tm);
-
- dev_dbg(dev, "RTC_TIME: %ptRr\n", tm);
-
- return 0;
-}
-
-static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
- struct pcf50633_rtc *rtc;
- struct pcf50633_time pcf_tm;
- int alarm_masked, ret = 0;
-
- rtc = dev_get_drvdata(dev);
-
- dev_dbg(dev, "RTC_TIME: %ptRr\n", tm);
-
- rtc2pcf_time(&pcf_tm, tm);
-
- dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
- pcf_tm.time[PCF50633_TI_DAY],
- pcf_tm.time[PCF50633_TI_MONTH],
- pcf_tm.time[PCF50633_TI_YEAR],
- pcf_tm.time[PCF50633_TI_HOUR],
- pcf_tm.time[PCF50633_TI_MIN],
- pcf_tm.time[PCF50633_TI_SEC]);
-
-
- alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM);
-
- if (!alarm_masked)
- pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
-
- /* Returns 0 on success */
- ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSC,
- PCF50633_TI_EXTENT,
- &pcf_tm.time[0]);
-
- if (!alarm_masked)
- pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
-
- return ret;
-}
-
-static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
- struct pcf50633_rtc *rtc;
- struct pcf50633_time pcf_tm;
- int ret = 0;
-
- rtc = dev_get_drvdata(dev);
-
- alrm->enabled = rtc->alarm_enabled;
- alrm->pending = rtc->alarm_pending;
-
- ret = pcf50633_read_block(rtc->pcf, PCF50633_REG_RTCSCA,
- PCF50633_TI_EXTENT, &pcf_tm.time[0]);
- if (ret != PCF50633_TI_EXTENT) {
- dev_err(dev, "Failed to read time\n");
- return -EIO;
- }
-
- pcf2rtc_time(&alrm->time, &pcf_tm);
-
- return rtc_valid_tm(&alrm->time);
-}
-
-static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
- struct pcf50633_rtc *rtc;
- struct pcf50633_time pcf_tm;
- int alarm_masked, ret = 0;
-
- rtc = dev_get_drvdata(dev);
-
- rtc2pcf_time(&pcf_tm, &alrm->time);
-
- /* do like mktime does and ignore tm_wday */
- pcf_tm.time[PCF50633_TI_WKDAY] = 7;
-
- alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM);
-
- /* disable alarm interrupt */
- if (!alarm_masked)
- pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
-
- /* Returns 0 on success */
- ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA,
- PCF50633_TI_EXTENT, &pcf_tm.time[0]);
- if (!alrm->enabled)
- rtc->alarm_pending = 0;
-
- if (!alarm_masked || alrm->enabled)
- pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
- rtc->alarm_enabled = alrm->enabled;
-
- return ret;
-}
-
-static const struct rtc_class_ops pcf50633_rtc_ops = {
- .read_time = pcf50633_rtc_read_time,
- .set_time = pcf50633_rtc_set_time,
- .read_alarm = pcf50633_rtc_read_alarm,
- .set_alarm = pcf50633_rtc_set_alarm,
- .alarm_irq_enable = pcf50633_rtc_alarm_irq_enable,
-};
-
-static void pcf50633_rtc_irq(int irq, void *data)
-{
- struct pcf50633_rtc *rtc = data;
-
- rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
- rtc->alarm_pending = 1;
-}
-
-static int pcf50633_rtc_probe(struct platform_device *pdev)
-{
- struct pcf50633_rtc *rtc;
-
- rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
- if (!rtc)
- return -ENOMEM;
-
- rtc->pcf = dev_to_pcf50633(pdev->dev.parent);
- platform_set_drvdata(pdev, rtc);
- rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "pcf50633-rtc",
- &pcf50633_rtc_ops, THIS_MODULE);
-
- if (IS_ERR(rtc->rtc_dev))
- return PTR_ERR(rtc->rtc_dev);
-
- pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
- pcf50633_rtc_irq, rtc);
- return 0;
-}
-
-static void pcf50633_rtc_remove(struct platform_device *pdev)
-{
- struct pcf50633_rtc *rtc;
-
- rtc = platform_get_drvdata(pdev);
- pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_ALARM);
-}
-
-static struct platform_driver pcf50633_rtc_driver = {
- .driver = {
- .name = "pcf50633-rtc",
- },
- .probe = pcf50633_rtc_probe,
- .remove = pcf50633_rtc_remove,
-};
-
-module_platform_driver(pcf50633_rtc_driver);
-
-MODULE_DESCRIPTION("PCF50633 RTC driver");
-MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
-MODULE_LICENSE("GPL");
-
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/9] mfd: pcF50633-gpio: Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
2025-03-11 1:49 ` [PATCH v2 1/9] mfd: pcf50633-adc: Remove linux
2025-03-11 1:49 ` [PATCH v2 2/9] rtc: pcf50633: Remove linux
@ 2025-03-11 1:49 ` linux
2025-03-11 1:49 ` [PATCH v2 4/9] Input: pcf50633-input - Remove linux
` (7 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
arch/mips/configs/ip27_defconfig | 1 -
drivers/mfd/Kconfig | 7 ---
drivers/mfd/Makefile | 1 -
drivers/mfd/pcf50633-gpio.c | 92 -------------------------------
include/linux/mfd/pcf50633/gpio.h | 48 ----------------
5 files changed, 149 deletions(-)
delete mode 100644 drivers/mfd/pcf50633-gpio.c
delete mode 100644 include/linux/mfd/pcf50633/gpio.h
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 66085bb71bc4..0a9ec09aff65 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -256,7 +256,6 @@ CONFIG_I2C_STUB=m
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
CONFIG_MFD_PCF50633=m
-CONFIG_PCF50633_GPIO=m
# CONFIG_VGA_ARB is not set
CONFIG_LEDS_LP3944=m
CONFIG_LEDS_PCA955X=m
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 051272126fe1..766453ef6c2d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1129,13 +1129,6 @@ config MFD_PCF50633
facilities, and registers devices for the various functions
so that function-specific drivers can bind to them.
-config PCF50633_GPIO
- tristate "NXP PCF50633 GPIO"
- depends on MFD_PCF50633
- help
- Say yes here if you want to include support GPIO for pins on
- the PCF50633 chip.
-
config MFD_PM8XXX
tristate "Qualcomm PM8xxx PMIC chips driver"
depends on ARM || HEXAGON || COMPILE_TEST
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index e085da3f13c3..d769e40251c8 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -185,7 +185,6 @@ obj-$(CONFIG_MFD_MT6397) += mt6397.o
pcf50633-objs := pcf50633-core.o pcf50633-irq.o
obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
-obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o
obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o
obj-$(CONFIG_ABX500_CORE) += abx500-core.o
obj-$(CONFIG_MFD_DB8500_PRCMU) += db8500-prcmu.o
diff --git a/drivers/mfd/pcf50633-gpio.c b/drivers/mfd/pcf50633-gpio.c
deleted file mode 100644
index 3e368219479a..000000000000
--- a/drivers/mfd/pcf50633-gpio.c
+++ /dev/null
@@ -1,92 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 GPIO Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/gpio.h>
-#include <linux/mfd/pcf50633/pmic.h>
-
-static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = {
- [PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT,
- [PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT,
- [PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT,
- [PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT,
- [PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT,
- [PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT,
- [PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT,
- [PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT,
- [PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT,
- [PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT,
- [PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT,
-};
-
-int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val)
-{
- u8 reg;
-
- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
-
- return pcf50633_reg_set_bit_mask(pcf, reg, 0x07, val);
-}
-EXPORT_SYMBOL_GPL(pcf50633_gpio_set);
-
-u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio)
-{
- u8 reg, val;
-
- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
- val = pcf50633_reg_read(pcf, reg) & 0x07;
-
- return val;
-}
-EXPORT_SYMBOL_GPL(pcf50633_gpio_get);
-
-int pcf50633_gpio_invert_set(struct pcf50633 *pcf, int gpio, int invert)
-{
- u8 val, reg;
-
- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
- val = !!invert << 3;
-
- return pcf50633_reg_set_bit_mask(pcf, reg, 1 << 3, val);
-}
-EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_set);
-
-int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio)
-{
- u8 reg, val;
-
- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
- val = pcf50633_reg_read(pcf, reg);
-
- return val & (1 << 3);
-}
-EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_get);
-
-int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
- int gpio, int regulator, int on)
-{
- u8 reg, val, mask;
-
- /* the *ENA register is always one after the *OUT register */
- reg = pcf50633_regulator_registers[regulator] + 1;
-
- val = !!on << (gpio - PCF50633_GPIO1);
- mask = 1 << (gpio - PCF50633_GPIO1);
-
- return pcf50633_reg_set_bit_mask(pcf, reg, mask, val);
-}
-EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set);
-
-MODULE_DESCRIPTION("NXP PCF50633 GPIO Driver");
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/pcf50633/gpio.h b/include/linux/mfd/pcf50633/gpio.h
deleted file mode 100644
index f589e35795f1..000000000000
--- a/include/linux/mfd/pcf50633/gpio.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * gpio.h -- GPIO driver for NXP PCF50633
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * All rights reserved.
- */
-
-#ifndef __LINUX_MFD_PCF50633_GPIO_H
-#define __LINUX_MFD_PCF50633_GPIO_H
-
-#include <linux/mfd/pcf50633/core.h>
-
-#define PCF50633_GPIO1 1
-#define PCF50633_GPIO2 2
-#define PCF50633_GPIO3 3
-#define PCF50633_GPO 4
-
-#define PCF50633_REG_GPIO1CFG 0x14
-#define PCF50633_REG_GPIO2CFG 0x15
-#define PCF50633_REG_GPIO3CFG 0x16
-#define PCF50633_REG_GPOCFG 0x17
-
-#define PCF50633_GPOCFG_GPOSEL_MASK 0x07
-
-enum pcf50633_reg_gpocfg {
- PCF50633_GPOCFG_GPOSEL_0 = 0x00,
- PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01,
- PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02,
- PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03,
- PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04,
- PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05,
- PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06,
- PCF50633_GPOCFG_GPOSEL_1 = 0x07,
- PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08,
-};
-
-int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val);
-u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio);
-
-int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert);
-int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio);
-
-int pcf50633_gpio_power_supply_set(struct pcf50633 *,
- int gpio, int regulator, int on);
-#endif /* __LINUX_MFD_PCF50633_GPIO_H */
-
-
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 4/9] Input: pcf50633-input - Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (2 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 3/9] mfd: pcF50633-gpio: Remove linux
@ 2025-03-11 1:49 ` linux
2025-04-01 11:31 ` Dr. David Alan Gilbert
2025-03-11 1:49 ` [PATCH v2 5/9] regulator: pcf50633-regulator: Remove linux
` (6 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/input/misc/Kconfig | 7 --
drivers/input/misc/Makefile | 1 -
drivers/input/misc/pcf50633-input.c | 113 ----------------------------
3 files changed, 121 deletions(-)
delete mode 100644 drivers/input/misc/pcf50633-input.c
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 13d135257e06..62819144bd8c 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -584,13 +584,6 @@ config INPUT_PALMAS_PWRBUTTON
To compile this driver as a module, choose M here. The module will
be called palmas_pwrbutton.
-config INPUT_PCF50633_PMU
- tristate "PCF50633 PMU events"
- depends on MFD_PCF50633
- help
- Say Y to include support for delivering PMU events via input
- layer on NXP PCF50633.
-
config INPUT_PCF8574
tristate "PCF8574 Keypad input device"
depends on I2C
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 6d91804d0a6f..d468c8140b93 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -59,7 +59,6 @@ obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o
obj-$(CONFIG_INPUT_MMA8450) += mma8450.o
obj-$(CONFIG_INPUT_PALMAS_PWRBUTTON) += palmas-pwrbutton.o
obj-$(CONFIG_INPUT_PCAP) += pcap_keys.o
-obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o
obj-$(CONFIG_INPUT_PCF8574) += pcf8574_keypad.o
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_PM8941_PWRKEY) += pm8941-pwrkey.o
diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
deleted file mode 100644
index 6d046e236ba6..000000000000
--- a/drivers/input/misc/pcf50633-input.c
+++ /dev/null
@@ -1,113 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 Input Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/input.h>
-#include <linux/slab.h>
-
-#include <linux/mfd/pcf50633/core.h>
-
-#define PCF50633_OOCSTAT_ONKEY 0x01
-#define PCF50633_REG_OOCSTAT 0x12
-#define PCF50633_REG_OOCMODE 0x10
-
-struct pcf50633_input {
- struct pcf50633 *pcf;
- struct input_dev *input_dev;
-};
-
-static void
-pcf50633_input_irq(int irq, void *data)
-{
- struct pcf50633_input *input;
- int onkey_released;
-
- input = data;
-
- /* We report only one event depending on the key press status */
- onkey_released = pcf50633_reg_read(input->pcf, PCF50633_REG_OOCSTAT)
- & PCF50633_OOCSTAT_ONKEY;
-
- if (irq == PCF50633_IRQ_ONKEYF && !onkey_released)
- input_report_key(input->input_dev, KEY_POWER, 1);
- else if (irq == PCF50633_IRQ_ONKEYR && onkey_released)
- input_report_key(input->input_dev, KEY_POWER, 0);
-
- input_sync(input->input_dev);
-}
-
-static int pcf50633_input_probe(struct platform_device *pdev)
-{
- struct pcf50633_input *input;
- struct input_dev *input_dev;
- int ret;
-
-
- input = kzalloc(sizeof(*input), GFP_KERNEL);
- if (!input)
- return -ENOMEM;
-
- input_dev = input_allocate_device();
- if (!input_dev) {
- kfree(input);
- return -ENOMEM;
- }
-
- platform_set_drvdata(pdev, input);
- input->pcf = dev_to_pcf50633(pdev->dev.parent);
- input->input_dev = input_dev;
-
- input_dev->name = "PCF50633 PMU events";
- input_dev->id.bustype = BUS_I2C;
- input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR);
- set_bit(KEY_POWER, input_dev->keybit);
-
- ret = input_register_device(input_dev);
- if (ret) {
- input_free_device(input_dev);
- kfree(input);
- return ret;
- }
- pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYR,
- pcf50633_input_irq, input);
- pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYF,
- pcf50633_input_irq, input);
-
- return 0;
-}
-
-static void pcf50633_input_remove(struct platform_device *pdev)
-{
- struct pcf50633_input *input = platform_get_drvdata(pdev);
-
- pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYR);
- pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYF);
-
- input_unregister_device(input->input_dev);
- kfree(input);
-}
-
-static struct platform_driver pcf50633_input_driver = {
- .driver = {
- .name = "pcf50633-input",
- },
- .probe = pcf50633_input_probe,
- .remove = pcf50633_input_remove,
-};
-module_platform_driver(pcf50633_input_driver);
-
-MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
-MODULE_DESCRIPTION("PCF50633 input driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pcf50633-input");
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 5/9] regulator: pcf50633-regulator: Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (3 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 4/9] Input: pcf50633-input - Remove linux
@ 2025-03-11 1:49 ` linux
2025-03-11 1:49 ` [PATCH v2 6/9] power: supply: pcf50633: Remove charger linux
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/regulator/Kconfig | 7 --
drivers/regulator/Makefile | 1 -
drivers/regulator/pcf50633-regulator.c | 124 -------------------------
3 files changed, 132 deletions(-)
delete mode 100644 drivers/regulator/pcf50633-regulator.c
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 39297f7d8177..1236b3a1f93f 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -988,13 +988,6 @@ config REGULATOR_PCAP
This driver provides support for the voltage regulators of the
PCAP2 PMIC.
-config REGULATOR_PCF50633
- tristate "NXP PCF50633 regulator driver"
- depends on MFD_PCF50633
- help
- Say Y here to support the voltage regulators and converters
- on PCF50633
-
config REGULATOR_PF8X00
tristate "NXP PF8100/PF8121A/PF8200 regulator driver"
depends on I2C && OF
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 3d5a803dce8a..8dca3567437f 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -132,7 +132,6 @@ obj-$(CONFIG_REGULATOR_PWM) += pwm-regulator.o
obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o
obj-$(CONFIG_REGULATOR_PBIAS) += pbias-regulator.o
obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
-obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
obj-$(CONFIG_REGULATOR_RAA215300) += raa215300.o
obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY) += rpi-panel-attiny-regulator.o
obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o
diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c
deleted file mode 100644
index 9f08a62c800e..000000000000
--- a/drivers/regulator/pcf50633-regulator.c
+++ /dev/null
@@ -1,124 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 PMIC Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte and Andy Green and Werner Almesberger
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/err.h>
-#include <linux/platform_device.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/pmic.h>
-
-#define PCF50633_REGULATOR(_name, _id, _min_uV, _uV_step, _min_sel, _n) \
- { \
- .name = _name, \
- .id = PCF50633_REGULATOR_##_id, \
- .ops = &pcf50633_regulator_ops, \
- .n_voltages = _n, \
- .min_uV = _min_uV, \
- .uV_step = _uV_step, \
- .linear_min_sel = _min_sel, \
- .type = REGULATOR_VOLTAGE, \
- .owner = THIS_MODULE, \
- .vsel_reg = PCF50633_REG_##_id##OUT, \
- .vsel_mask = 0xff, \
- .enable_reg = PCF50633_REG_##_id##OUT + 1, \
- .enable_mask = PCF50633_REGULATOR_ON, \
- }
-
-static const struct regulator_ops pcf50633_regulator_ops = {
- .set_voltage_sel = regulator_set_voltage_sel_regmap,
- .get_voltage_sel = regulator_get_voltage_sel_regmap,
- .list_voltage = regulator_list_voltage_linear,
- .map_voltage = regulator_map_voltage_linear,
- .enable = regulator_enable_regmap,
- .disable = regulator_disable_regmap,
- .is_enabled = regulator_is_enabled_regmap,
-};
-
-static const struct regulator_desc regulators[] = {
- [PCF50633_REGULATOR_AUTO] =
- PCF50633_REGULATOR("auto", AUTO, 1800000, 25000, 0x2f, 128),
- [PCF50633_REGULATOR_DOWN1] =
- PCF50633_REGULATOR("down1", DOWN1, 625000, 25000, 0, 96),
- [PCF50633_REGULATOR_DOWN2] =
- PCF50633_REGULATOR("down2", DOWN2, 625000, 25000, 0, 96),
- [PCF50633_REGULATOR_LDO1] =
- PCF50633_REGULATOR("ldo1", LDO1, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_LDO2] =
- PCF50633_REGULATOR("ldo2", LDO2, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_LDO3] =
- PCF50633_REGULATOR("ldo3", LDO3, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_LDO4] =
- PCF50633_REGULATOR("ldo4", LDO4, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_LDO5] =
- PCF50633_REGULATOR("ldo5", LDO5, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_LDO6] =
- PCF50633_REGULATOR("ldo6", LDO6, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_HCLDO] =
- PCF50633_REGULATOR("hcldo", HCLDO, 900000, 100000, 0, 28),
- [PCF50633_REGULATOR_MEMLDO] =
- PCF50633_REGULATOR("memldo", MEMLDO, 900000, 100000, 0, 28),
-};
-
-static int pcf50633_regulator_probe(struct platform_device *pdev)
-{
- struct regulator_dev *rdev;
- struct pcf50633 *pcf;
- struct regulator_config config = { };
-
- /* Already set by core driver */
- pcf = dev_to_pcf50633(pdev->dev.parent);
-
- config.dev = &pdev->dev;
- config.init_data = dev_get_platdata(&pdev->dev);
- config.driver_data = pcf;
- config.regmap = pcf->regmap;
-
- rdev = devm_regulator_register(&pdev->dev, ®ulators[pdev->id],
- &config);
- if (IS_ERR(rdev))
- return PTR_ERR(rdev);
-
- platform_set_drvdata(pdev, rdev);
-
- if (pcf->pdata->regulator_registered)
- pcf->pdata->regulator_registered(pcf, pdev->id);
-
- return 0;
-}
-
-static struct platform_driver pcf50633_regulator_driver = {
- .driver = {
- .name = "pcf50633-regulator",
- .probe_type = PROBE_PREFER_ASYNCHRONOUS,
- },
- .probe = pcf50633_regulator_probe,
-};
-
-static int __init pcf50633_regulator_init(void)
-{
- return platform_driver_register(&pcf50633_regulator_driver);
-}
-subsys_initcall(pcf50633_regulator_init);
-
-static void __exit pcf50633_regulator_exit(void)
-{
- platform_driver_unregister(&pcf50633_regulator_driver);
-}
-module_exit(pcf50633_regulator_exit);
-
-MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
-MODULE_DESCRIPTION("PCF50633 regulator driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pcf50633-regulator");
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 6/9] power: supply: pcf50633: Remove charger
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (4 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 5/9] regulator: pcf50633-regulator: Remove linux
@ 2025-03-11 1:49 ` linux
2025-03-12 7:00 ` Sebastian Reichel
2025-03-11 1:49 ` [PATCH v2 7/9] backlight: pcf50633-backlight: Remove linux
` (4 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/power/supply/Kconfig | 6 -
drivers/power/supply/Makefile | 1 -
drivers/power/supply/pcf50633-charger.c | 466 ------------------------
3 files changed, 473 deletions(-)
delete mode 100644 drivers/power/supply/pcf50633-charger.c
diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index 7b18358f194a..aa569badaf73 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -449,12 +449,6 @@ config CHARGER_88PM860X
help
Say Y here to enable charger for Marvell 88PM860x chip.
-config CHARGER_PCF50633
- tristate "NXP PCF50633 MBC"
- depends on MFD_PCF50633
- help
- Say Y to include support for NXP PCF50633 Main Battery Charger.
-
config BATTERY_RX51
tristate "Nokia RX-51 (N900) battery driver"
depends on TWL4030_MADC
diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile
index b55cc48a4c86..eedb00e377cb 100644
--- a/drivers/power/supply/Makefile
+++ b/drivers/power/supply/Makefile
@@ -62,7 +62,6 @@ obj-$(CONFIG_CHARGER_RT9467) += rt9467-charger.o
obj-$(CONFIG_CHARGER_RT9471) += rt9471.o
obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o
obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o
-obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o ab8500_chargalg.o
obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o
diff --git a/drivers/power/supply/pcf50633-charger.c b/drivers/power/supply/pcf50633-charger.c
deleted file mode 100644
index 0136bc87b105..000000000000
--- a/drivers/power/supply/pcf50633-charger.c
+++ /dev/null
@@ -1,466 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 Main Battery Charger Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/sysfs.h>
-#include <linux/platform_device.h>
-#include <linux/power_supply.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/mbc.h>
-
-struct pcf50633_mbc {
- struct pcf50633 *pcf;
-
- int adapter_online;
- int usb_online;
-
- struct power_supply *usb;
- struct power_supply *adapter;
- struct power_supply *ac;
-};
-
-int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
-{
- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
- int ret = 0;
- u8 bits;
- u8 mbcs2, chgmod;
- unsigned int mbcc5;
-
- if (ma >= 1000) {
- bits = PCF50633_MBCC7_USB_1000mA;
- ma = 1000;
- } else if (ma >= 500) {
- bits = PCF50633_MBCC7_USB_500mA;
- ma = 500;
- } else if (ma >= 100) {
- bits = PCF50633_MBCC7_USB_100mA;
- ma = 100;
- } else {
- bits = PCF50633_MBCC7_USB_SUSPEND;
- ma = 0;
- }
-
- ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC7,
- PCF50633_MBCC7_USB_MASK, bits);
- if (ret)
- dev_err(pcf->dev, "error setting usb curlim to %d mA\n", ma);
- else
- dev_info(pcf->dev, "usb curlim to %d mA\n", ma);
-
- /*
- * We limit the charging current to be the USB current limit.
- * The reason is that on pcf50633, when it enters PMU Standby mode,
- * which it does when the device goes "off", the USB current limit
- * reverts to the variant default. In at least one common case, that
- * default is 500mA. By setting the charging current to be the same
- * as the USB limit we set here before PMU standby, we enforce it only
- * using the correct amount of current even when the USB current limit
- * gets reset to the wrong thing
- */
-
- if (mbc->pcf->pdata->charger_reference_current_ma) {
- mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma;
- if (mbcc5 > 255)
- mbcc5 = 255;
- pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5);
- }
-
- mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2);
- chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK);
-
- /* If chgmod == BATFULL, setting chgena has no effect.
- * Datasheet says we need to set resume instead but when autoresume is
- * used resume doesn't work. Clear and set chgena instead.
- */
- if (chgmod != PCF50633_MBCS2_MBC_BAT_FULL)
- pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
- PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
- else {
- pcf50633_reg_clear_bits(pcf, PCF50633_REG_MBCC1,
- PCF50633_MBCC1_CHGENA);
- pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
- PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
- }
-
- power_supply_changed(mbc->usb);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(pcf50633_mbc_usb_curlim_set);
-
-int pcf50633_mbc_get_status(struct pcf50633 *pcf)
-{
- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
- int status = 0;
- u8 chgmod;
-
- if (!mbc)
- return 0;
-
- chgmod = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2)
- & PCF50633_MBCS2_MBC_MASK;
-
- if (mbc->usb_online)
- status |= PCF50633_MBC_USB_ONLINE;
- if (chgmod == PCF50633_MBCS2_MBC_USB_PRE ||
- chgmod == PCF50633_MBCS2_MBC_USB_PRE_WAIT ||
- chgmod == PCF50633_MBCS2_MBC_USB_FAST ||
- chgmod == PCF50633_MBCS2_MBC_USB_FAST_WAIT)
- status |= PCF50633_MBC_USB_ACTIVE;
- if (mbc->adapter_online)
- status |= PCF50633_MBC_ADAPTER_ONLINE;
- if (chgmod == PCF50633_MBCS2_MBC_ADP_PRE ||
- chgmod == PCF50633_MBCS2_MBC_ADP_PRE_WAIT ||
- chgmod == PCF50633_MBCS2_MBC_ADP_FAST ||
- chgmod == PCF50633_MBCS2_MBC_ADP_FAST_WAIT)
- status |= PCF50633_MBC_ADAPTER_ACTIVE;
-
- return status;
-}
-EXPORT_SYMBOL_GPL(pcf50633_mbc_get_status);
-
-int pcf50633_mbc_get_usb_online_status(struct pcf50633 *pcf)
-{
- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
-
- if (!mbc)
- return 0;
-
- return mbc->usb_online;
-}
-EXPORT_SYMBOL_GPL(pcf50633_mbc_get_usb_online_status);
-
-static ssize_t
-show_chgmode(struct device *dev, struct device_attribute *attr, char *buf)
-{
- struct pcf50633_mbc *mbc = dev_get_drvdata(dev);
-
- u8 mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2);
- u8 chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK);
-
- return sysfs_emit(buf, "%d\n", chgmod);
-}
-static DEVICE_ATTR(chgmode, S_IRUGO, show_chgmode, NULL);
-
-static ssize_t
-show_usblim(struct device *dev, struct device_attribute *attr, char *buf)
-{
- struct pcf50633_mbc *mbc = dev_get_drvdata(dev);
- u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) &
- PCF50633_MBCC7_USB_MASK;
- unsigned int ma;
-
- if (usblim == PCF50633_MBCC7_USB_1000mA)
- ma = 1000;
- else if (usblim == PCF50633_MBCC7_USB_500mA)
- ma = 500;
- else if (usblim == PCF50633_MBCC7_USB_100mA)
- ma = 100;
- else
- ma = 0;
-
- return sysfs_emit(buf, "%u\n", ma);
-}
-
-static ssize_t set_usblim(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
-{
- struct pcf50633_mbc *mbc = dev_get_drvdata(dev);
- unsigned long ma;
- int ret;
-
- ret = kstrtoul(buf, 10, &ma);
- if (ret)
- return ret;
-
- pcf50633_mbc_usb_curlim_set(mbc->pcf, ma);
-
- return count;
-}
-
-static DEVICE_ATTR(usb_curlim, S_IRUGO | S_IWUSR, show_usblim, set_usblim);
-
-static ssize_t
-show_chglim(struct device *dev, struct device_attribute *attr, char *buf)
-{
- struct pcf50633_mbc *mbc = dev_get_drvdata(dev);
- u8 mbcc5 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC5);
- unsigned int ma;
-
- if (!mbc->pcf->pdata->charger_reference_current_ma)
- return -ENODEV;
-
- ma = (mbc->pcf->pdata->charger_reference_current_ma * mbcc5) >> 8;
-
- return sysfs_emit(buf, "%u\n", ma);
-}
-
-static ssize_t set_chglim(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
-{
- struct pcf50633_mbc *mbc = dev_get_drvdata(dev);
- unsigned long ma;
- unsigned int mbcc5;
- int ret;
-
- if (!mbc->pcf->pdata->charger_reference_current_ma)
- return -ENODEV;
-
- ret = kstrtoul(buf, 10, &ma);
- if (ret)
- return ret;
-
- mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma;
- if (mbcc5 > 255)
- mbcc5 = 255;
- pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5);
-
- return count;
-}
-
-/*
- * This attribute allows to change MBC charging limit on the fly
- * independently of usb current limit. It also gets set automatically every
- * time usb current limit is changed.
- */
-static DEVICE_ATTR(chg_curlim, S_IRUGO | S_IWUSR, show_chglim, set_chglim);
-
-static struct attribute *pcf50633_mbc_sysfs_attrs[] = {
- &dev_attr_chgmode.attr,
- &dev_attr_usb_curlim.attr,
- &dev_attr_chg_curlim.attr,
- NULL,
-};
-
-ATTRIBUTE_GROUPS(pcf50633_mbc_sysfs);
-
-static void
-pcf50633_mbc_irq_handler(int irq, void *data)
-{
- struct pcf50633_mbc *mbc = data;
-
- /* USB */
- if (irq == PCF50633_IRQ_USBINS) {
- mbc->usb_online = 1;
- } else if (irq == PCF50633_IRQ_USBREM) {
- mbc->usb_online = 0;
- pcf50633_mbc_usb_curlim_set(mbc->pcf, 0);
- }
-
- /* Adapter */
- if (irq == PCF50633_IRQ_ADPINS)
- mbc->adapter_online = 1;
- else if (irq == PCF50633_IRQ_ADPREM)
- mbc->adapter_online = 0;
-
- power_supply_changed(mbc->ac);
- power_supply_changed(mbc->usb);
- power_supply_changed(mbc->adapter);
-
- if (mbc->pcf->pdata->mbc_event_callback)
- mbc->pcf->pdata->mbc_event_callback(mbc->pcf, irq);
-}
-
-static int adapter_get_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct pcf50633_mbc *mbc = power_supply_get_drvdata(psy);
- int ret = 0;
-
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- val->intval = mbc->adapter_online;
- break;
- default:
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
-static int usb_get_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct pcf50633_mbc *mbc = power_supply_get_drvdata(psy);
- int ret = 0;
- u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) &
- PCF50633_MBCC7_USB_MASK;
-
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- val->intval = mbc->usb_online &&
- (usblim <= PCF50633_MBCC7_USB_500mA);
- break;
- default:
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
-static int ac_get_property(struct power_supply *psy,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct pcf50633_mbc *mbc = power_supply_get_drvdata(psy);
- int ret = 0;
- u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) &
- PCF50633_MBCC7_USB_MASK;
-
- switch (psp) {
- case POWER_SUPPLY_PROP_ONLINE:
- val->intval = mbc->usb_online &&
- (usblim == PCF50633_MBCC7_USB_1000mA);
- break;
- default:
- ret = -EINVAL;
- break;
- }
- return ret;
-}
-
-static enum power_supply_property power_props[] = {
- POWER_SUPPLY_PROP_ONLINE,
-};
-
-static const u8 mbc_irq_handlers[] = {
- PCF50633_IRQ_ADPINS,
- PCF50633_IRQ_ADPREM,
- PCF50633_IRQ_USBINS,
- PCF50633_IRQ_USBREM,
- PCF50633_IRQ_BATFULL,
- PCF50633_IRQ_CHGHALT,
- PCF50633_IRQ_THLIMON,
- PCF50633_IRQ_THLIMOFF,
- PCF50633_IRQ_USBLIMON,
- PCF50633_IRQ_USBLIMOFF,
- PCF50633_IRQ_LOWSYS,
- PCF50633_IRQ_LOWBAT,
-};
-
-static const struct power_supply_desc pcf50633_mbc_adapter_desc = {
- .name = "adapter",
- .type = POWER_SUPPLY_TYPE_MAINS,
- .properties = power_props,
- .num_properties = ARRAY_SIZE(power_props),
- .get_property = &adapter_get_property,
-};
-
-static const struct power_supply_desc pcf50633_mbc_usb_desc = {
- .name = "usb",
- .type = POWER_SUPPLY_TYPE_USB,
- .properties = power_props,
- .num_properties = ARRAY_SIZE(power_props),
- .get_property = usb_get_property,
-};
-
-static const struct power_supply_desc pcf50633_mbc_ac_desc = {
- .name = "ac",
- .type = POWER_SUPPLY_TYPE_MAINS,
- .properties = power_props,
- .num_properties = ARRAY_SIZE(power_props),
- .get_property = ac_get_property,
-};
-
-static int pcf50633_mbc_probe(struct platform_device *pdev)
-{
- struct power_supply_config psy_cfg = {};
- struct power_supply_config usb_psy_cfg;
- struct pcf50633_mbc *mbc;
- int i;
- u8 mbcs1;
-
- mbc = devm_kzalloc(&pdev->dev, sizeof(*mbc), GFP_KERNEL);
- if (!mbc)
- return -ENOMEM;
-
- platform_set_drvdata(pdev, mbc);
- mbc->pcf = dev_to_pcf50633(pdev->dev.parent);
-
- /* Set up IRQ handlers */
- for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
- pcf50633_register_irq(mbc->pcf, mbc_irq_handlers[i],
- pcf50633_mbc_irq_handler, mbc);
-
- psy_cfg.supplied_to = mbc->pcf->pdata->batteries;
- psy_cfg.num_supplicants = mbc->pcf->pdata->num_batteries;
- psy_cfg.drv_data = mbc;
-
- /* Create power supplies */
- mbc->adapter = devm_power_supply_register(&pdev->dev,
- &pcf50633_mbc_adapter_desc,
- &psy_cfg);
- if (IS_ERR(mbc->adapter)) {
- dev_err(mbc->pcf->dev, "failed to register adapter\n");
- return PTR_ERR(mbc->adapter);
- }
-
- usb_psy_cfg = psy_cfg;
- usb_psy_cfg.attr_grp = pcf50633_mbc_sysfs_groups;
-
- mbc->usb = devm_power_supply_register(&pdev->dev,
- &pcf50633_mbc_usb_desc,
- &usb_psy_cfg);
- if (IS_ERR(mbc->usb)) {
- dev_err(mbc->pcf->dev, "failed to register usb\n");
- return PTR_ERR(mbc->usb);
- }
-
- mbc->ac = devm_power_supply_register(&pdev->dev,
- &pcf50633_mbc_ac_desc,
- &psy_cfg);
- if (IS_ERR(mbc->ac)) {
- dev_err(mbc->pcf->dev, "failed to register ac\n");
- return PTR_ERR(mbc->ac);
- }
-
- mbcs1 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS1);
- if (mbcs1 & PCF50633_MBCS1_USBPRES)
- pcf50633_mbc_irq_handler(PCF50633_IRQ_USBINS, mbc);
- if (mbcs1 & PCF50633_MBCS1_ADAPTPRES)
- pcf50633_mbc_irq_handler(PCF50633_IRQ_ADPINS, mbc);
-
- return 0;
-}
-
-static void pcf50633_mbc_remove(struct platform_device *pdev)
-{
- struct pcf50633_mbc *mbc = platform_get_drvdata(pdev);
- int i;
-
- /* Remove IRQ handlers */
- for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
- pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
-}
-
-static struct platform_driver pcf50633_mbc_driver = {
- .driver = {
- .name = "pcf50633-mbc",
- },
- .probe = pcf50633_mbc_probe,
- .remove = pcf50633_mbc_remove,
-};
-
-module_platform_driver(pcf50633_mbc_driver);
-
-MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
-MODULE_DESCRIPTION("PCF50633 mbc driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pcf50633-mbc");
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 7/9] backlight: pcf50633-backlight: Remove
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (5 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 6/9] power: supply: pcf50633: Remove charger linux
@ 2025-03-11 1:49 ` linux
2025-03-14 11:36 ` (subset) " Lee Jones
2025-03-11 1:49 ` [PATCH v2 8/9] mfd: pcf50633: Remove irq code linux
` (3 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/video/backlight/Kconfig | 7 -
drivers/video/backlight/Makefile | 1 -
drivers/video/backlight/pcf50633-backlight.c | 154 -------------------
include/linux/mfd/pcf50633/backlight.h | 42 -----
include/linux/mfd/pcf50633/core.h | 3 -
5 files changed, 207 deletions(-)
delete mode 100644 drivers/video/backlight/pcf50633-backlight.c
delete mode 100644 include/linux/mfd/pcf50633/backlight.h
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 3614a5d29c71..ef4ac1ac7520 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -359,13 +359,6 @@ config BACKLIGHT_88PM860X
help
Say Y to enable the backlight driver for Marvell 88PM8606.
-config BACKLIGHT_PCF50633
- tristate "Backlight driver for NXP PCF50633 MFD"
- depends on MFD_PCF50633
- help
- If you have a backlight driven by a NXP PCF50633 MFD, say Y here to
- enable its driver.
-
config BACKLIGHT_AAT2870
tristate "AnalogicTech AAT2870 Backlight"
depends on MFD_AAT2870_CORE
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 8fc98f760a8a..21bf62bcaccf 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_BACKLIGHT_MP3309C) += mp3309c.o
obj-$(CONFIG_BACKLIGHT_MT6370) += mt6370-backlight.o
obj-$(CONFIG_BACKLIGHT_OMAP1) += omap1_bl.o
obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o
-obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o
obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o
obj-$(CONFIG_BACKLIGHT_RT4831) += rt4831-backlight.o
diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c
deleted file mode 100644
index 157be2f366df..000000000000
--- a/drivers/video/backlight/pcf50633-backlight.c
+++ /dev/null
@@ -1,154 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
- * PCF50633 backlight device driver
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-
-#include <linux/backlight.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/backlight.h>
-
-struct pcf50633_bl {
- struct pcf50633 *pcf;
- struct backlight_device *bl;
-
- unsigned int brightness;
- unsigned int brightness_limit;
-};
-
-/*
- * pcf50633_bl_set_brightness_limit
- *
- * Update the brightness limit for the pc50633 backlight. The actual brightness
- * will not go above the limit. This is useful to limit power drain for example
- * on low battery.
- *
- * @dev: Pointer to a pcf50633 device
- * @limit: The brightness limit. Valid values are 0-63
- */
-int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit)
-{
- struct pcf50633_bl *pcf_bl = platform_get_drvdata(pcf->bl_pdev);
-
- if (!pcf_bl)
- return -ENODEV;
-
- pcf_bl->brightness_limit = limit & 0x3f;
- backlight_update_status(pcf_bl->bl);
-
- return 0;
-}
-
-static int pcf50633_bl_update_status(struct backlight_device *bl)
-{
- struct pcf50633_bl *pcf_bl = bl_get_data(bl);
- unsigned int new_brightness;
-
-
- if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK) ||
- bl->props.power != BACKLIGHT_POWER_ON)
- new_brightness = 0;
- else if (bl->props.brightness < pcf_bl->brightness_limit)
- new_brightness = bl->props.brightness;
- else
- new_brightness = pcf_bl->brightness_limit;
-
-
- if (pcf_bl->brightness == new_brightness)
- return 0;
-
- if (new_brightness) {
- pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDOUT,
- new_brightness);
- if (!pcf_bl->brightness)
- pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDENA, 1);
- } else {
- pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDENA, 0);
- }
-
- pcf_bl->brightness = new_brightness;
-
- return 0;
-}
-
-static int pcf50633_bl_get_brightness(struct backlight_device *bl)
-{
- struct pcf50633_bl *pcf_bl = bl_get_data(bl);
-
- return pcf_bl->brightness;
-}
-
-static const struct backlight_ops pcf50633_bl_ops = {
- .get_brightness = pcf50633_bl_get_brightness,
- .update_status = pcf50633_bl_update_status,
- .options = BL_CORE_SUSPENDRESUME,
-};
-
-static int pcf50633_bl_probe(struct platform_device *pdev)
-{
- struct pcf50633_bl *pcf_bl;
- struct device *parent = pdev->dev.parent;
- struct pcf50633_platform_data *pcf50633_data = dev_get_platdata(parent);
- struct pcf50633_bl_platform_data *pdata = pcf50633_data->backlight_data;
- struct backlight_properties bl_props;
-
- pcf_bl = devm_kzalloc(&pdev->dev, sizeof(*pcf_bl), GFP_KERNEL);
- if (!pcf_bl)
- return -ENOMEM;
-
- memset(&bl_props, 0, sizeof(bl_props));
- bl_props.type = BACKLIGHT_RAW;
- bl_props.max_brightness = 0x3f;
- bl_props.power = BACKLIGHT_POWER_ON;
-
- if (pdata) {
- bl_props.brightness = pdata->default_brightness;
- pcf_bl->brightness_limit = pdata->default_brightness_limit;
- } else {
- bl_props.brightness = 0x3f;
- pcf_bl->brightness_limit = 0x3f;
- }
-
- pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent);
-
- pcf_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name,
- &pdev->dev, pcf_bl,
- &pcf50633_bl_ops, &bl_props);
-
- if (IS_ERR(pcf_bl->bl))
- return PTR_ERR(pcf_bl->bl);
-
- platform_set_drvdata(pdev, pcf_bl);
-
- pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
-
- /*
- * Should be different from bl_props.brightness, so we do not exit
- * update_status early the first time it's called
- */
- pcf_bl->brightness = pcf_bl->bl->props.brightness + 1;
-
- backlight_update_status(pcf_bl->bl);
-
- return 0;
-}
-
-static struct platform_driver pcf50633_bl_driver = {
- .probe = pcf50633_bl_probe,
- .driver = {
- .name = "pcf50633-backlight",
- },
-};
-
-module_platform_driver(pcf50633_bl_driver);
-
-MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-MODULE_DESCRIPTION("PCF50633 backlight driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:pcf50633-backlight");
diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h
deleted file mode 100644
index fd4a4f8d6c13..000000000000
--- a/include/linux/mfd/pcf50633/backlight.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
- * PCF50633 backlight device driver
- */
-
-#ifndef __LINUX_MFD_PCF50633_BACKLIGHT
-#define __LINUX_MFD_PCF50633_BACKLIGHT
-
-/*
-* @default_brightness: Backlight brightness is initialized to this value
-*
-* Brightness to be used after the driver has been probed.
-* Valid range 0-63.
-*
-* @default_brightness_limit: The actual brightness is limited by this value
-*
-* Brightness limit to be used after the driver has been probed. This is useful
-* when it is not known how much power is available for the backlight during
-* probe.
-* Valid range 0-63. Can be changed later with pcf50633_bl_set_brightness_limit.
-*
-* @ramp_time: Display ramp time when changing brightness
-*
-* When changing the backlights brightness the change is not instant, instead
-* it fades smooth from one state to another. This value specifies how long
-* the fade should take. The lower the value the higher the fade time.
-* Valid range 0-255
-*/
-struct pcf50633_bl_platform_data {
- unsigned int default_brightness;
- unsigned int default_brightness_limit;
- uint8_t ramp_time;
-};
-
-
-struct pcf50633;
-
-int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit);
-
-#endif
-
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 539f27f8bd89..42d2b0e4884e 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -15,7 +15,6 @@
#include <linux/regulator/machine.h>
#include <linux/pm.h>
#include <linux/power_supply.h>
-#include <linux/mfd/pcf50633/backlight.h>
struct pcf50633;
struct regmap;
@@ -42,8 +41,6 @@ struct pcf50633_platform_data {
void (*force_shutdown)(struct pcf50633 *);
u8 resumers[5];
-
- struct pcf50633_bl_platform_data *backlight_data;
};
struct pcf50633_irq {
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 8/9] mfd: pcf50633: Remove irq code
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (6 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 7/9] backlight: pcf50633-backlight: Remove linux
@ 2025-03-11 1:49 ` linux
2025-03-11 1:49 ` [PATCH v2 9/9] mfd: pcf50633: Remove remains linux
` (2 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
As part of the pcf50633 removal, take out it's irq code
(which includes one bit still called from the core, but it'll
go soon).
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/mfd/Makefile | 2 +-
drivers/mfd/pcf50633-core.c | 5 +-
drivers/mfd/pcf50633-irq.c | 312 ------------------------------------
3 files changed, 2 insertions(+), 317 deletions(-)
delete mode 100644 drivers/mfd/pcf50633-irq.c
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index d769e40251c8..f1c7a15c8f7b 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -183,7 +183,7 @@ obj-$(CONFIG_MFD_MT6370) += mt6370.o
mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o
obj-$(CONFIG_MFD_MT6397) += mt6397.o
-pcf50633-objs := pcf50633-core.o pcf50633-irq.o
+pcf50633-objs := pcf50633-core.o
obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o
obj-$(CONFIG_ABX500_CORE) += abx500-core.o
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 014a68711b18..5605f176061a 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -204,8 +204,6 @@ static int pcf50633_probe(struct i2c_client *client)
dev_info(pcf->dev, "Probed device version %d variant %d\n",
version, variant);
- pcf50633_irq_init(pcf, client->irq);
-
/* Create sub devices */
pcf50633_client_dev_register(pcf, "pcf50633-input", &pcf->input_pdev);
pcf50633_client_dev_register(pcf, "pcf50633-rtc", &pcf->rtc_pdev);
@@ -258,7 +256,6 @@ static void pcf50633_remove(struct i2c_client *client)
int i;
sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
- pcf50633_irq_free(pcf);
platform_device_unregister(pcf->input_pdev);
platform_device_unregister(pcf->rtc_pdev);
@@ -279,7 +276,7 @@ MODULE_DEVICE_TABLE(i2c, pcf50633_id_table);
static struct i2c_driver pcf50633_driver = {
.driver = {
.name = "pcf50633",
- .pm = pm_sleep_ptr(&pcf50633_pm),
+ /* going.... .pm = pm_sleep_ptr(&pcf50633_pm), */
},
.id_table = pcf50633_id_table,
.probe = pcf50633_probe,
diff --git a/drivers/mfd/pcf50633-irq.c b/drivers/mfd/pcf50633-irq.c
deleted file mode 100644
index e85af7f1cb0b..000000000000
--- a/drivers/mfd/pcf50633-irq.c
+++ /dev/null
@@ -1,312 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 Power Management Unit (PMU) driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Harald Welte <laforge@openmoko.org>
- * Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- */
-
-#include <linux/i2c.h>
-#include <linux/interrupt.h>
-#include <linux/kernel.h>
-#include <linux/mutex.h>
-#include <linux/export.h>
-#include <linux/slab.h>
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/mfd/pcf50633/mbc.h>
-
-int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
- void (*handler) (int, void *), void *data)
-{
- if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler)
- return -EINVAL;
-
- if (WARN_ON(pcf->irq_handler[irq].handler))
- return -EBUSY;
-
- mutex_lock(&pcf->lock);
- pcf->irq_handler[irq].handler = handler;
- pcf->irq_handler[irq].data = data;
- mutex_unlock(&pcf->lock);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(pcf50633_register_irq);
-
-int pcf50633_free_irq(struct pcf50633 *pcf, int irq)
-{
- if (irq < 0 || irq >= PCF50633_NUM_IRQ)
- return -EINVAL;
-
- mutex_lock(&pcf->lock);
- pcf->irq_handler[irq].handler = NULL;
- mutex_unlock(&pcf->lock);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(pcf50633_free_irq);
-
-static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask)
-{
- u8 reg, bit;
- int idx;
-
- idx = irq >> 3;
- reg = PCF50633_REG_INT1M + idx;
- bit = 1 << (irq & 0x07);
-
- pcf50633_reg_set_bit_mask(pcf, reg, bit, mask ? bit : 0);
-
- mutex_lock(&pcf->lock);
-
- if (mask)
- pcf->mask_regs[idx] |= bit;
- else
- pcf->mask_regs[idx] &= ~bit;
-
- mutex_unlock(&pcf->lock);
-
- return 0;
-}
-
-int pcf50633_irq_mask(struct pcf50633 *pcf, int irq)
-{
- dev_dbg(pcf->dev, "Masking IRQ %d\n", irq);
-
- return __pcf50633_irq_mask_set(pcf, irq, 1);
-}
-EXPORT_SYMBOL_GPL(pcf50633_irq_mask);
-
-int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq)
-{
- dev_dbg(pcf->dev, "Unmasking IRQ %d\n", irq);
-
- return __pcf50633_irq_mask_set(pcf, irq, 0);
-}
-EXPORT_SYMBOL_GPL(pcf50633_irq_unmask);
-
-int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq)
-{
- u8 reg, bits;
-
- reg = irq >> 3;
- bits = 1 << (irq & 0x07);
-
- return pcf->mask_regs[reg] & bits;
-}
-EXPORT_SYMBOL_GPL(pcf50633_irq_mask_get);
-
-static void pcf50633_irq_call_handler(struct pcf50633 *pcf, int irq)
-{
- if (pcf->irq_handler[irq].handler)
- pcf->irq_handler[irq].handler(irq, pcf->irq_handler[irq].data);
-}
-
-/* Maximum amount of time ONKEY is held before emergency action is taken */
-#define PCF50633_ONKEY1S_TIMEOUT 8
-
-static irqreturn_t pcf50633_irq(int irq, void *data)
-{
- struct pcf50633 *pcf = data;
- int ret, i, j;
- u8 pcf_int[5], chgstat;
-
- /* Read the 5 INT regs in one transaction */
- ret = pcf50633_read_block(pcf, PCF50633_REG_INT1,
- ARRAY_SIZE(pcf_int), pcf_int);
- if (ret != ARRAY_SIZE(pcf_int)) {
- dev_err(pcf->dev, "Error reading INT registers\n");
-
- /*
- * If this doesn't ACK the interrupt to the chip, we'll be
- * called once again as we're level triggered.
- */
- goto out;
- }
-
- /* defeat 8s death from lowsys on A5 */
- pcf50633_reg_write(pcf, PCF50633_REG_OOCSHDWN, 0x04);
-
- /* We immediately read the usb and adapter status. We thus make sure
- * only of USBINS/USBREM IRQ handlers are called */
- if (pcf_int[0] & (PCF50633_INT1_USBINS | PCF50633_INT1_USBREM)) {
- chgstat = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2);
- if (chgstat & (0x3 << 4))
- pcf_int[0] &= ~PCF50633_INT1_USBREM;
- else
- pcf_int[0] &= ~PCF50633_INT1_USBINS;
- }
-
- /* Make sure only one of ADPINS or ADPREM is set */
- if (pcf_int[0] & (PCF50633_INT1_ADPINS | PCF50633_INT1_ADPREM)) {
- chgstat = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2);
- if (chgstat & (0x3 << 4))
- pcf_int[0] &= ~PCF50633_INT1_ADPREM;
- else
- pcf_int[0] &= ~PCF50633_INT1_ADPINS;
- }
-
- dev_dbg(pcf->dev, "INT1=0x%02x INT2=0x%02x INT3=0x%02x "
- "INT4=0x%02x INT5=0x%02x\n", pcf_int[0],
- pcf_int[1], pcf_int[2], pcf_int[3], pcf_int[4]);
-
- /* Some revisions of the chip don't have a 8s standby mode on
- * ONKEY1S press. We try to manually do it in such cases. */
- if ((pcf_int[0] & PCF50633_INT1_SECOND) && pcf->onkey1s_held) {
- dev_info(pcf->dev, "ONKEY1S held for %d secs\n",
- pcf->onkey1s_held);
- if (pcf->onkey1s_held++ == PCF50633_ONKEY1S_TIMEOUT)
- if (pcf->pdata->force_shutdown)
- pcf->pdata->force_shutdown(pcf);
- }
-
- if (pcf_int[2] & PCF50633_INT3_ONKEY1S) {
- dev_info(pcf->dev, "ONKEY1S held\n");
- pcf->onkey1s_held = 1 ;
-
- /* Unmask IRQ_SECOND */
- pcf50633_reg_clear_bits(pcf, PCF50633_REG_INT1M,
- PCF50633_INT1_SECOND);
-
- /* Unmask IRQ_ONKEYR */
- pcf50633_reg_clear_bits(pcf, PCF50633_REG_INT2M,
- PCF50633_INT2_ONKEYR);
- }
-
- if ((pcf_int[1] & PCF50633_INT2_ONKEYR) && pcf->onkey1s_held) {
- pcf->onkey1s_held = 0;
-
- /* Mask SECOND and ONKEYR interrupts */
- if (pcf->mask_regs[0] & PCF50633_INT1_SECOND)
- pcf50633_reg_set_bit_mask(pcf,
- PCF50633_REG_INT1M,
- PCF50633_INT1_SECOND,
- PCF50633_INT1_SECOND);
-
- if (pcf->mask_regs[1] & PCF50633_INT2_ONKEYR)
- pcf50633_reg_set_bit_mask(pcf,
- PCF50633_REG_INT2M,
- PCF50633_INT2_ONKEYR,
- PCF50633_INT2_ONKEYR);
- }
-
- /* Have we just resumed ? */
- if (pcf->is_suspended) {
- pcf->is_suspended = 0;
-
- /* Set the resume reason filtering out non resumers */
- for (i = 0; i < ARRAY_SIZE(pcf_int); i++)
- pcf->resume_reason[i] = pcf_int[i] &
- pcf->pdata->resumers[i];
-
- /* Make sure we don't pass on any ONKEY events to
- * userspace now */
- pcf_int[1] &= ~(PCF50633_INT2_ONKEYR | PCF50633_INT2_ONKEYF);
- }
-
- for (i = 0; i < ARRAY_SIZE(pcf_int); i++) {
- /* Unset masked interrupts */
- pcf_int[i] &= ~pcf->mask_regs[i];
-
- for (j = 0; j < 8 ; j++)
- if (pcf_int[i] & (1 << j))
- pcf50633_irq_call_handler(pcf, (i * 8) + j);
- }
-
-out:
- return IRQ_HANDLED;
-}
-
-static int pcf50633_suspend(struct device *dev)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct pcf50633 *pcf = i2c_get_clientdata(client);
- int ret;
- int i;
- u8 res[5];
-
-
- /* Make sure our interrupt handlers are not called
- * henceforth */
- disable_irq(pcf->irq);
-
- /* Save the masks */
- ret = pcf50633_read_block(pcf, PCF50633_REG_INT1M,
- ARRAY_SIZE(pcf->suspend_irq_masks),
- pcf->suspend_irq_masks);
- if (ret < 0) {
- dev_err(pcf->dev, "error saving irq masks\n");
- goto out;
- }
-
- /* Write wakeup irq masks */
- for (i = 0; i < ARRAY_SIZE(res); i++)
- res[i] = ~pcf->pdata->resumers[i];
-
- ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M,
- ARRAY_SIZE(res), &res[0]);
- if (ret < 0) {
- dev_err(pcf->dev, "error writing wakeup irq masks\n");
- goto out;
- }
-
- pcf->is_suspended = 1;
-
-out:
- return ret;
-}
-
-static int pcf50633_resume(struct device *dev)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct pcf50633 *pcf = i2c_get_clientdata(client);
- int ret;
-
- /* Write the saved mask registers */
- ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M,
- ARRAY_SIZE(pcf->suspend_irq_masks),
- pcf->suspend_irq_masks);
- if (ret < 0)
- dev_err(pcf->dev, "Error restoring saved suspend masks\n");
-
- enable_irq(pcf->irq);
-
- return ret;
-}
-
-EXPORT_GPL_SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
-
-int pcf50633_irq_init(struct pcf50633 *pcf, int irq)
-{
- int ret;
-
- pcf->irq = irq;
-
- /* Enable all interrupts except RTC SECOND */
- pcf->mask_regs[0] = 0x80;
- pcf50633_reg_write(pcf, PCF50633_REG_INT1M, pcf->mask_regs[0]);
- pcf50633_reg_write(pcf, PCF50633_REG_INT2M, 0x00);
- pcf50633_reg_write(pcf, PCF50633_REG_INT3M, 0x00);
- pcf50633_reg_write(pcf, PCF50633_REG_INT4M, 0x00);
- pcf50633_reg_write(pcf, PCF50633_REG_INT5M, 0x00);
-
- ret = request_threaded_irq(irq, NULL, pcf50633_irq,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- "pcf50633", pcf);
-
- if (ret)
- dev_err(pcf->dev, "Failed to request IRQ %d\n", ret);
-
- if (enable_irq_wake(irq) < 0)
- dev_err(pcf->dev, "IRQ %u cannot be enabled as wake-up source"
- "in this hardware revision", irq);
-
- return ret;
-}
-
-void pcf50633_irq_free(struct pcf50633 *pcf)
-{
- free_irq(pcf->irq, pcf);
-}
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 9/9] mfd: pcf50633: Remove remains
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (7 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 8/9] mfd: pcf50633: Remove irq code linux
@ 2025-03-11 1:49 ` linux
2025-03-11 20:12 ` (subset) [PATCH v2 0/9] Remove pcf50633 Mark Brown
2025-03-14 11:43 ` Lee Jones
10 siblings, 0 replies; 16+ messages in thread
From: linux @ 2025-03-11 1:49 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Remove the remaining parts of the 50633, the core, headers and glue.
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
arch/mips/configs/ip27_defconfig | 1 -
drivers/mfd/Kconfig | 10 -
drivers/mfd/Makefile | 2 -
drivers/mfd/pcf50633-core.c | 301 ------------------------------
include/linux/mfd/pcf50633/core.h | 229 -----------------------
include/linux/mfd/pcf50633/mbc.h | 130 -------------
include/linux/mfd/pcf50633/pmic.h | 68 -------
7 files changed, 741 deletions(-)
delete mode 100644 drivers/mfd/pcf50633-core.c
delete mode 100644 include/linux/mfd/pcf50633/core.h
delete mode 100644 include/linux/mfd/pcf50633/mbc.h
delete mode 100644 include/linux/mfd/pcf50633/pmic.h
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 0a9ec09aff65..c13c2f3cff9a 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -255,7 +255,6 @@ CONFIG_I2C_TAOS_EVM=m
CONFIG_I2C_STUB=m
# CONFIG_HWMON is not set
CONFIG_THERMAL=y
-CONFIG_MFD_PCF50633=m
# CONFIG_VGA_ARB is not set
CONFIG_LEDS_LP3944=m
CONFIG_LEDS_PCA955X=m
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 766453ef6c2d..1eeb62dac8d3 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1119,16 +1119,6 @@ config MFD_RETU
Retu and Tahvo are a multi-function devices found on Nokia
Internet Tablets (770, N800 and N810).
-config MFD_PCF50633
- tristate "NXP PCF50633"
- depends on I2C
- select REGMAP_I2C
- help
- Say yes here if you have NXP PCF50633 chip on your board.
- This core driver provides register access and IRQ handling
- facilities, and registers devices for the various functions
- so that function-specific drivers can bind to them.
-
config MFD_PM8XXX
tristate "Qualcomm PM8xxx PMIC chips driver"
depends on ARM || HEXAGON || COMPILE_TEST
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f1c7a15c8f7b..941e4ba58b24 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -183,8 +183,6 @@ obj-$(CONFIG_MFD_MT6370) += mt6370.o
mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o
obj-$(CONFIG_MFD_MT6397) += mt6397.o
-pcf50633-objs := pcf50633-core.o
-obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o
obj-$(CONFIG_ABX500_CORE) += abx500-core.o
obj-$(CONFIG_MFD_DB8500_PRCMU) += db8500-prcmu.o
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
deleted file mode 100644
index 5605f176061a..000000000000
--- a/drivers/mfd/pcf50633-core.c
+++ /dev/null
@@ -1,301 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/* NXP PCF50633 Power Management Unit (PMU) driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Harald Welte <laforge@openmoko.org>
- * Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- */
-
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/sysfs.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-#include <linux/platform_device.h>
-#include <linux/i2c.h>
-#include <linux/pm.h>
-#include <linux/slab.h>
-#include <linux/regmap.h>
-#include <linux/err.h>
-
-#include <linux/mfd/pcf50633/core.h>
-
-/* Read a block of up to 32 regs */
-int pcf50633_read_block(struct pcf50633 *pcf, u8 reg,
- int nr_regs, u8 *data)
-{
- int ret;
-
- ret = regmap_raw_read(pcf->regmap, reg, data, nr_regs);
- if (ret != 0)
- return ret;
-
- return nr_regs;
-}
-EXPORT_SYMBOL_GPL(pcf50633_read_block);
-
-/* Write a block of up to 32 regs */
-int pcf50633_write_block(struct pcf50633 *pcf , u8 reg,
- int nr_regs, u8 *data)
-{
- return regmap_raw_write(pcf->regmap, reg, data, nr_regs);
-}
-EXPORT_SYMBOL_GPL(pcf50633_write_block);
-
-u8 pcf50633_reg_read(struct pcf50633 *pcf, u8 reg)
-{
- unsigned int val;
- int ret;
-
- ret = regmap_read(pcf->regmap, reg, &val);
- if (ret < 0)
- return -1;
-
- return val;
-}
-EXPORT_SYMBOL_GPL(pcf50633_reg_read);
-
-int pcf50633_reg_write(struct pcf50633 *pcf, u8 reg, u8 val)
-{
- return regmap_write(pcf->regmap, reg, val);
-}
-EXPORT_SYMBOL_GPL(pcf50633_reg_write);
-
-int pcf50633_reg_set_bit_mask(struct pcf50633 *pcf, u8 reg, u8 mask, u8 val)
-{
- return regmap_update_bits(pcf->regmap, reg, mask, val);
-}
-EXPORT_SYMBOL_GPL(pcf50633_reg_set_bit_mask);
-
-int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val)
-{
- return regmap_update_bits(pcf->regmap, reg, val, 0);
-}
-EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits);
-
-/* sysfs attributes */
-static ssize_t dump_regs_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct pcf50633 *pcf = dev_get_drvdata(dev);
- u8 dump[16];
- int n, n1, idx = 0;
- char *buf1 = buf;
- static u8 address_no_read[] = { /* must be ascending */
- PCF50633_REG_INT1,
- PCF50633_REG_INT2,
- PCF50633_REG_INT3,
- PCF50633_REG_INT4,
- PCF50633_REG_INT5,
- 0 /* terminator */
- };
-
- for (n = 0; n < 256; n += sizeof(dump)) {
- for (n1 = 0; n1 < sizeof(dump); n1++)
- if (n == address_no_read[idx]) {
- idx++;
- dump[n1] = 0x00;
- } else
- dump[n1] = pcf50633_reg_read(pcf, n + n1);
-
- buf1 += sprintf(buf1, "%*ph\n", (int)sizeof(dump), dump);
- }
-
- return buf1 - buf;
-}
-static DEVICE_ATTR_ADMIN_RO(dump_regs);
-
-static ssize_t resume_reason_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct pcf50633 *pcf = dev_get_drvdata(dev);
- int n;
-
- n = sprintf(buf, "%02x%02x%02x%02x%02x\n",
- pcf->resume_reason[0],
- pcf->resume_reason[1],
- pcf->resume_reason[2],
- pcf->resume_reason[3],
- pcf->resume_reason[4]);
-
- return n;
-}
-static DEVICE_ATTR_ADMIN_RO(resume_reason);
-
-static struct attribute *pcf_sysfs_entries[] = {
- &dev_attr_dump_regs.attr,
- &dev_attr_resume_reason.attr,
- NULL,
-};
-
-static struct attribute_group pcf_attr_group = {
- .name = NULL, /* put in device directory */
- .attrs = pcf_sysfs_entries,
-};
-
-static void
-pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
- struct platform_device **pdev)
-{
- int ret;
-
- *pdev = platform_device_alloc(name, -1);
- if (!*pdev) {
- dev_err(pcf->dev, "Failed to allocate %s\n", name);
- return;
- }
-
- (*pdev)->dev.parent = pcf->dev;
-
- ret = platform_device_add(*pdev);
- if (ret) {
- dev_err(pcf->dev, "Failed to register %s: %d\n", name, ret);
- platform_device_put(*pdev);
- *pdev = NULL;
- }
-}
-
-static const struct regmap_config pcf50633_regmap_config = {
- .reg_bits = 8,
- .val_bits = 8,
-};
-
-static int pcf50633_probe(struct i2c_client *client)
-{
- struct pcf50633 *pcf;
- struct platform_device *pdev;
- struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev);
- int i, j, ret;
- int version, variant;
-
- if (!client->irq) {
- dev_err(&client->dev, "Missing IRQ\n");
- return -ENOENT;
- }
-
- pcf = devm_kzalloc(&client->dev, sizeof(*pcf), GFP_KERNEL);
- if (!pcf)
- return -ENOMEM;
-
- i2c_set_clientdata(client, pcf);
- pcf->dev = &client->dev;
- pcf->pdata = pdata;
-
- mutex_init(&pcf->lock);
-
- pcf->regmap = devm_regmap_init_i2c(client, &pcf50633_regmap_config);
- if (IS_ERR(pcf->regmap)) {
- ret = PTR_ERR(pcf->regmap);
- dev_err(pcf->dev, "Failed to allocate register map: %d\n", ret);
- return ret;
- }
-
- version = pcf50633_reg_read(pcf, 0);
- variant = pcf50633_reg_read(pcf, 1);
- if (version < 0 || variant < 0) {
- dev_err(pcf->dev, "Unable to probe pcf50633\n");
- ret = -ENODEV;
- return ret;
- }
-
- dev_info(pcf->dev, "Probed device version %d variant %d\n",
- version, variant);
-
- /* Create sub devices */
- pcf50633_client_dev_register(pcf, "pcf50633-input", &pcf->input_pdev);
- pcf50633_client_dev_register(pcf, "pcf50633-rtc", &pcf->rtc_pdev);
- pcf50633_client_dev_register(pcf, "pcf50633-mbc", &pcf->mbc_pdev);
- pcf50633_client_dev_register(pcf, "pcf50633-adc", &pcf->adc_pdev);
- pcf50633_client_dev_register(pcf, "pcf50633-backlight", &pcf->bl_pdev);
-
-
- for (i = 0; i < PCF50633_NUM_REGULATORS; i++) {
- pdev = platform_device_alloc("pcf50633-regulator", i);
- if (!pdev) {
- ret = -ENOMEM;
- goto err2;
- }
-
- pdev->dev.parent = pcf->dev;
- ret = platform_device_add_data(pdev, &pdata->reg_init_data[i],
- sizeof(pdata->reg_init_data[i]));
- if (ret)
- goto err;
-
- ret = platform_device_add(pdev);
- if (ret)
- goto err;
-
- pcf->regulator_pdev[i] = pdev;
- }
-
- ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group);
- if (ret)
- dev_warn(pcf->dev, "error creating sysfs entries\n");
-
- if (pdata->probe_done)
- pdata->probe_done(pcf);
-
- return 0;
-
-err:
- platform_device_put(pdev);
-err2:
- for (j = 0; j < i; j++)
- platform_device_put(pcf->regulator_pdev[j]);
-
- return ret;
-}
-
-static void pcf50633_remove(struct i2c_client *client)
-{
- struct pcf50633 *pcf = i2c_get_clientdata(client);
- int i;
-
- sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
-
- platform_device_unregister(pcf->input_pdev);
- platform_device_unregister(pcf->rtc_pdev);
- platform_device_unregister(pcf->mbc_pdev);
- platform_device_unregister(pcf->adc_pdev);
- platform_device_unregister(pcf->bl_pdev);
-
- for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
- platform_device_unregister(pcf->regulator_pdev[i]);
-}
-
-static const struct i2c_device_id pcf50633_id_table[] = {
- {"pcf50633", 0x73},
- {/* end of list */}
-};
-MODULE_DEVICE_TABLE(i2c, pcf50633_id_table);
-
-static struct i2c_driver pcf50633_driver = {
- .driver = {
- .name = "pcf50633",
- /* going.... .pm = pm_sleep_ptr(&pcf50633_pm), */
- },
- .id_table = pcf50633_id_table,
- .probe = pcf50633_probe,
- .remove = pcf50633_remove,
-};
-
-static int __init pcf50633_init(void)
-{
- return i2c_add_driver(&pcf50633_driver);
-}
-
-static void __exit pcf50633_exit(void)
-{
- i2c_del_driver(&pcf50633_driver);
-}
-
-MODULE_DESCRIPTION("I2C chip driver for NXP PCF50633 PMU");
-MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
-MODULE_LICENSE("GPL");
-
-subsys_initcall(pcf50633_init);
-module_exit(pcf50633_exit);
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
deleted file mode 100644
index 42d2b0e4884e..000000000000
--- a/include/linux/mfd/pcf50633/core.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * core.h -- Core driver for NXP PCF50633
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * All rights reserved.
- */
-
-#ifndef __LINUX_MFD_PCF50633_CORE_H
-#define __LINUX_MFD_PCF50633_CORE_H
-
-#include <linux/i2c.h>
-#include <linux/workqueue.h>
-#include <linux/regulator/driver.h>
-#include <linux/regulator/machine.h>
-#include <linux/pm.h>
-#include <linux/power_supply.h>
-
-struct pcf50633;
-struct regmap;
-
-#define PCF50633_NUM_REGULATORS 11
-
-struct pcf50633_platform_data {
- struct regulator_init_data reg_init_data[PCF50633_NUM_REGULATORS];
-
- char **batteries;
- int num_batteries;
-
- /*
- * Should be set accordingly to the reference resistor used, see
- * I_{ch(ref)} charger reference current in the pcf50633 User
- * Manual.
- */
- int charger_reference_current_ma;
-
- /* Callbacks */
- void (*probe_done)(struct pcf50633 *);
- void (*mbc_event_callback)(struct pcf50633 *, int);
- void (*regulator_registered)(struct pcf50633 *, int);
- void (*force_shutdown)(struct pcf50633 *);
-
- u8 resumers[5];
-};
-
-struct pcf50633_irq {
- void (*handler) (int, void *);
- void *data;
-};
-
-int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
- void (*handler) (int, void *), void *data);
-int pcf50633_free_irq(struct pcf50633 *pcf, int irq);
-
-int pcf50633_irq_mask(struct pcf50633 *pcf, int irq);
-int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq);
-int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq);
-
-int pcf50633_read_block(struct pcf50633 *, u8 reg,
- int nr_regs, u8 *data);
-int pcf50633_write_block(struct pcf50633 *pcf, u8 reg,
- int nr_regs, u8 *data);
-u8 pcf50633_reg_read(struct pcf50633 *, u8 reg);
-int pcf50633_reg_write(struct pcf50633 *pcf, u8 reg, u8 val);
-
-int pcf50633_reg_set_bit_mask(struct pcf50633 *pcf, u8 reg, u8 mask, u8 val);
-int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 bits);
-
-/* Interrupt registers */
-
-#define PCF50633_REG_INT1 0x02
-#define PCF50633_REG_INT2 0x03
-#define PCF50633_REG_INT3 0x04
-#define PCF50633_REG_INT4 0x05
-#define PCF50633_REG_INT5 0x06
-
-#define PCF50633_REG_INT1M 0x07
-#define PCF50633_REG_INT2M 0x08
-#define PCF50633_REG_INT3M 0x09
-#define PCF50633_REG_INT4M 0x0a
-#define PCF50633_REG_INT5M 0x0b
-
-enum {
- /* Chip IRQs */
- PCF50633_IRQ_ADPINS,
- PCF50633_IRQ_ADPREM,
- PCF50633_IRQ_USBINS,
- PCF50633_IRQ_USBREM,
- PCF50633_IRQ_RESERVED1,
- PCF50633_IRQ_RESERVED2,
- PCF50633_IRQ_ALARM,
- PCF50633_IRQ_SECOND,
- PCF50633_IRQ_ONKEYR,
- PCF50633_IRQ_ONKEYF,
- PCF50633_IRQ_EXTON1R,
- PCF50633_IRQ_EXTON1F,
- PCF50633_IRQ_EXTON2R,
- PCF50633_IRQ_EXTON2F,
- PCF50633_IRQ_EXTON3R,
- PCF50633_IRQ_EXTON3F,
- PCF50633_IRQ_BATFULL,
- PCF50633_IRQ_CHGHALT,
- PCF50633_IRQ_THLIMON,
- PCF50633_IRQ_THLIMOFF,
- PCF50633_IRQ_USBLIMON,
- PCF50633_IRQ_USBLIMOFF,
- PCF50633_IRQ_ADCRDY,
- PCF50633_IRQ_ONKEY1S,
- PCF50633_IRQ_LOWSYS,
- PCF50633_IRQ_LOWBAT,
- PCF50633_IRQ_HIGHTMP,
- PCF50633_IRQ_AUTOPWRFAIL,
- PCF50633_IRQ_DWN1PWRFAIL,
- PCF50633_IRQ_DWN2PWRFAIL,
- PCF50633_IRQ_LEDPWRFAIL,
- PCF50633_IRQ_LEDOVP,
- PCF50633_IRQ_LDO1PWRFAIL,
- PCF50633_IRQ_LDO2PWRFAIL,
- PCF50633_IRQ_LDO3PWRFAIL,
- PCF50633_IRQ_LDO4PWRFAIL,
- PCF50633_IRQ_LDO5PWRFAIL,
- PCF50633_IRQ_LDO6PWRFAIL,
- PCF50633_IRQ_HCLDOPWRFAIL,
- PCF50633_IRQ_HCLDOOVL,
-
- /* Always last */
- PCF50633_NUM_IRQ,
-};
-
-struct pcf50633 {
- struct device *dev;
- struct regmap *regmap;
-
- struct pcf50633_platform_data *pdata;
- int irq;
- struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ];
- struct work_struct irq_work;
- struct workqueue_struct *work_queue;
- struct mutex lock;
-
- u8 mask_regs[5];
-
- u8 suspend_irq_masks[5];
- u8 resume_reason[5];
- int is_suspended;
-
- int onkey1s_held;
-
- struct platform_device *rtc_pdev;
- struct platform_device *mbc_pdev;
- struct platform_device *adc_pdev;
- struct platform_device *input_pdev;
- struct platform_device *bl_pdev;
- struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS];
-};
-
-enum pcf50633_reg_int1 {
- PCF50633_INT1_ADPINS = 0x01, /* Adapter inserted */
- PCF50633_INT1_ADPREM = 0x02, /* Adapter removed */
- PCF50633_INT1_USBINS = 0x04, /* USB inserted */
- PCF50633_INT1_USBREM = 0x08, /* USB removed */
- /* reserved */
- PCF50633_INT1_ALARM = 0x40, /* RTC alarm time is reached */
- PCF50633_INT1_SECOND = 0x80, /* RTC periodic second interrupt */
-};
-
-enum pcf50633_reg_int2 {
- PCF50633_INT2_ONKEYR = 0x01, /* ONKEY rising edge */
- PCF50633_INT2_ONKEYF = 0x02, /* ONKEY falling edge */
- PCF50633_INT2_EXTON1R = 0x04, /* EXTON1 rising edge */
- PCF50633_INT2_EXTON1F = 0x08, /* EXTON1 falling edge */
- PCF50633_INT2_EXTON2R = 0x10, /* EXTON2 rising edge */
- PCF50633_INT2_EXTON2F = 0x20, /* EXTON2 falling edge */
- PCF50633_INT2_EXTON3R = 0x40, /* EXTON3 rising edge */
- PCF50633_INT2_EXTON3F = 0x80, /* EXTON3 falling edge */
-};
-
-enum pcf50633_reg_int3 {
- PCF50633_INT3_BATFULL = 0x01, /* Battery full */
- PCF50633_INT3_CHGHALT = 0x02, /* Charger halt */
- PCF50633_INT3_THLIMON = 0x04,
- PCF50633_INT3_THLIMOFF = 0x08,
- PCF50633_INT3_USBLIMON = 0x10,
- PCF50633_INT3_USBLIMOFF = 0x20,
- PCF50633_INT3_ADCRDY = 0x40, /* ADC result ready */
- PCF50633_INT3_ONKEY1S = 0x80, /* ONKEY pressed 1 second */
-};
-
-enum pcf50633_reg_int4 {
- PCF50633_INT4_LOWSYS = 0x01,
- PCF50633_INT4_LOWBAT = 0x02,
- PCF50633_INT4_HIGHTMP = 0x04,
- PCF50633_INT4_AUTOPWRFAIL = 0x08,
- PCF50633_INT4_DWN1PWRFAIL = 0x10,
- PCF50633_INT4_DWN2PWRFAIL = 0x20,
- PCF50633_INT4_LEDPWRFAIL = 0x40,
- PCF50633_INT4_LEDOVP = 0x80,
-};
-
-enum pcf50633_reg_int5 {
- PCF50633_INT5_LDO1PWRFAIL = 0x01,
- PCF50633_INT5_LDO2PWRFAIL = 0x02,
- PCF50633_INT5_LDO3PWRFAIL = 0x04,
- PCF50633_INT5_LDO4PWRFAIL = 0x08,
- PCF50633_INT5_LDO5PWRFAIL = 0x10,
- PCF50633_INT5_LDO6PWRFAIL = 0x20,
- PCF50633_INT5_HCLDOPWRFAIL = 0x40,
- PCF50633_INT5_HCLDOOVL = 0x80,
-};
-
-/* misc. registers */
-#define PCF50633_REG_OOCSHDWN 0x0c
-
-/* LED registers */
-#define PCF50633_REG_LEDOUT 0x28
-#define PCF50633_REG_LEDENA 0x29
-#define PCF50633_REG_LEDCTL 0x2a
-#define PCF50633_REG_LEDDIM 0x2b
-
-static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
-{
- return dev_get_drvdata(dev);
-}
-
-int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
-void pcf50633_irq_free(struct pcf50633 *pcf);
-extern const struct dev_pm_ops pcf50633_pm;
-
-#endif
diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h
deleted file mode 100644
index fa5cb9256d99..000000000000
--- a/include/linux/mfd/pcf50633/mbc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * mbc.h -- Driver for NXP PCF50633 Main Battery Charger
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * All rights reserved.
- */
-
-#ifndef __LINUX_MFD_PCF50633_MBC_H
-#define __LINUX_MFD_PCF50633_MBC_H
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/platform_device.h>
-
-#define PCF50633_REG_MBCC1 0x43
-#define PCF50633_REG_MBCC2 0x44
-#define PCF50633_REG_MBCC3 0x45
-#define PCF50633_REG_MBCC4 0x46
-#define PCF50633_REG_MBCC5 0x47
-#define PCF50633_REG_MBCC6 0x48
-#define PCF50633_REG_MBCC7 0x49
-#define PCF50633_REG_MBCC8 0x4a
-#define PCF50633_REG_MBCS1 0x4b
-#define PCF50633_REG_MBCS2 0x4c
-#define PCF50633_REG_MBCS3 0x4d
-
-enum pcf50633_reg_mbcc1 {
- PCF50633_MBCC1_CHGENA = 0x01, /* Charger enable */
- PCF50633_MBCC1_AUTOSTOP = 0x02,
- PCF50633_MBCC1_AUTORES = 0x04, /* automatic resume */
- PCF50633_MBCC1_RESUME = 0x08, /* explicit resume cmd */
- PCF50633_MBCC1_RESTART = 0x10, /* restart charging */
- PCF50633_MBCC1_PREWDTIME_60M = 0x20, /* max. precharging time */
- PCF50633_MBCC1_WDTIME_1H = 0x00,
- PCF50633_MBCC1_WDTIME_2H = 0x40,
- PCF50633_MBCC1_WDTIME_4H = 0x80,
- PCF50633_MBCC1_WDTIME_6H = 0xc0,
-};
-#define PCF50633_MBCC1_WDTIME_MASK 0xc0
-
-enum pcf50633_reg_mbcc2 {
- PCF50633_MBCC2_VBATCOND_2V7 = 0x00,
- PCF50633_MBCC2_VBATCOND_2V85 = 0x01,
- PCF50633_MBCC2_VBATCOND_3V0 = 0x02,
- PCF50633_MBCC2_VBATCOND_3V15 = 0x03,
- PCF50633_MBCC2_VMAX_4V = 0x00,
- PCF50633_MBCC2_VMAX_4V20 = 0x28,
- PCF50633_MBCC2_VRESDEBTIME_64S = 0x80, /* debounce time (32/64sec) */
-};
-
-enum pcf50633_reg_mbcc7 {
- PCF50633_MBCC7_USB_100mA = 0x00,
- PCF50633_MBCC7_USB_500mA = 0x01,
- PCF50633_MBCC7_USB_1000mA = 0x02,
- PCF50633_MBCC7_USB_SUSPEND = 0x03,
- PCF50633_MBCC7_BATTEMP_EN = 0x04,
- PCF50633_MBCC7_BATSYSIMAX_1A6 = 0x00,
- PCF50633_MBCC7_BATSYSIMAX_1A8 = 0x40,
- PCF50633_MBCC7_BATSYSIMAX_2A0 = 0x80,
- PCF50633_MBCC7_BATSYSIMAX_2A2 = 0xc0,
-};
-#define PCF50633_MBCC7_USB_MASK 0x03
-
-enum pcf50633_reg_mbcc8 {
- PCF50633_MBCC8_USBENASUS = 0x10,
-};
-
-enum pcf50633_reg_mbcs1 {
- PCF50633_MBCS1_USBPRES = 0x01,
- PCF50633_MBCS1_USBOK = 0x02,
- PCF50633_MBCS1_ADAPTPRES = 0x04,
- PCF50633_MBCS1_ADAPTOK = 0x08,
- PCF50633_MBCS1_TBAT_OK = 0x00,
- PCF50633_MBCS1_TBAT_ABOVE = 0x10,
- PCF50633_MBCS1_TBAT_BELOW = 0x20,
- PCF50633_MBCS1_TBAT_UNDEF = 0x30,
- PCF50633_MBCS1_PREWDTEXP = 0x40,
- PCF50633_MBCS1_WDTEXP = 0x80,
-};
-
-enum pcf50633_reg_mbcs2_mbcmod {
- PCF50633_MBCS2_MBC_PLAY = 0x00,
- PCF50633_MBCS2_MBC_USB_PRE = 0x01,
- PCF50633_MBCS2_MBC_USB_PRE_WAIT = 0x02,
- PCF50633_MBCS2_MBC_USB_FAST = 0x03,
- PCF50633_MBCS2_MBC_USB_FAST_WAIT = 0x04,
- PCF50633_MBCS2_MBC_USB_SUSPEND = 0x05,
- PCF50633_MBCS2_MBC_ADP_PRE = 0x06,
- PCF50633_MBCS2_MBC_ADP_PRE_WAIT = 0x07,
- PCF50633_MBCS2_MBC_ADP_FAST = 0x08,
- PCF50633_MBCS2_MBC_ADP_FAST_WAIT = 0x09,
- PCF50633_MBCS2_MBC_BAT_FULL = 0x0a,
- PCF50633_MBCS2_MBC_HALT = 0x0b,
-};
-#define PCF50633_MBCS2_MBC_MASK 0x0f
-enum pcf50633_reg_mbcs2_chgstat {
- PCF50633_MBCS2_CHGS_NONE = 0x00,
- PCF50633_MBCS2_CHGS_ADAPTER = 0x10,
- PCF50633_MBCS2_CHGS_USB = 0x20,
- PCF50633_MBCS2_CHGS_BOTH = 0x30,
-};
-#define PCF50633_MBCS2_RESSTAT_AUTO 0x40
-
-enum pcf50633_reg_mbcs3 {
- PCF50633_MBCS3_USBLIM_PLAY = 0x01,
- PCF50633_MBCS3_USBLIM_CGH = 0x02,
- PCF50633_MBCS3_TLIM_PLAY = 0x04,
- PCF50633_MBCS3_TLIM_CHG = 0x08,
- PCF50633_MBCS3_ILIM = 0x10, /* 1: Ibat > Icutoff */
- PCF50633_MBCS3_VLIM = 0x20, /* 1: Vbat == Vmax */
- PCF50633_MBCS3_VBATSTAT = 0x40, /* 1: Vbat > Vbatcond */
- PCF50633_MBCS3_VRES = 0x80, /* 1: Vbat > Vth(RES) */
-};
-
-#define PCF50633_MBCC2_VBATCOND_MASK 0x03
-#define PCF50633_MBCC2_VMAX_MASK 0x3c
-
-/* Charger status */
-#define PCF50633_MBC_USB_ONLINE 0x01
-#define PCF50633_MBC_USB_ACTIVE 0x02
-#define PCF50633_MBC_ADAPTER_ONLINE 0x04
-#define PCF50633_MBC_ADAPTER_ACTIVE 0x08
-
-int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma);
-
-int pcf50633_mbc_get_status(struct pcf50633 *);
-int pcf50633_mbc_get_usb_online_status(struct pcf50633 *);
-
-#endif
-
diff --git a/include/linux/mfd/pcf50633/pmic.h b/include/linux/mfd/pcf50633/pmic.h
deleted file mode 100644
index eac0c3d8e984..000000000000
--- a/include/linux/mfd/pcf50633/pmic.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LINUX_MFD_PCF50633_PMIC_H
-#define __LINUX_MFD_PCF50633_PMIC_H
-
-#include <linux/mfd/pcf50633/core.h>
-#include <linux/platform_device.h>
-
-#define PCF50633_REG_AUTOOUT 0x1a
-#define PCF50633_REG_AUTOENA 0x1b
-#define PCF50633_REG_AUTOCTL 0x1c
-#define PCF50633_REG_AUTOMXC 0x1d
-#define PCF50633_REG_DOWN1OUT 0x1e
-#define PCF50633_REG_DOWN1ENA 0x1f
-#define PCF50633_REG_DOWN1CTL 0x20
-#define PCF50633_REG_DOWN1MXC 0x21
-#define PCF50633_REG_DOWN2OUT 0x22
-#define PCF50633_REG_DOWN2ENA 0x23
-#define PCF50633_REG_DOWN2CTL 0x24
-#define PCF50633_REG_DOWN2MXC 0x25
-#define PCF50633_REG_MEMLDOOUT 0x26
-#define PCF50633_REG_MEMLDOENA 0x27
-#define PCF50633_REG_LDO1OUT 0x2d
-#define PCF50633_REG_LDO1ENA 0x2e
-#define PCF50633_REG_LDO2OUT 0x2f
-#define PCF50633_REG_LDO2ENA 0x30
-#define PCF50633_REG_LDO3OUT 0x31
-#define PCF50633_REG_LDO3ENA 0x32
-#define PCF50633_REG_LDO4OUT 0x33
-#define PCF50633_REG_LDO4ENA 0x34
-#define PCF50633_REG_LDO5OUT 0x35
-#define PCF50633_REG_LDO5ENA 0x36
-#define PCF50633_REG_LDO6OUT 0x37
-#define PCF50633_REG_LDO6ENA 0x38
-#define PCF50633_REG_HCLDOOUT 0x39
-#define PCF50633_REG_HCLDOENA 0x3a
-#define PCF50633_REG_HCLDOOVL 0x40
-
-enum pcf50633_regulator_enable {
- PCF50633_REGULATOR_ON = 0x01,
- PCF50633_REGULATOR_ON_GPIO1 = 0x02,
- PCF50633_REGULATOR_ON_GPIO2 = 0x04,
- PCF50633_REGULATOR_ON_GPIO3 = 0x08,
-};
-#define PCF50633_REGULATOR_ON_MASK 0x0f
-
-enum pcf50633_regulator_phase {
- PCF50633_REGULATOR_ACTPH1 = 0x00,
- PCF50633_REGULATOR_ACTPH2 = 0x10,
- PCF50633_REGULATOR_ACTPH3 = 0x20,
- PCF50633_REGULATOR_ACTPH4 = 0x30,
-};
-#define PCF50633_REGULATOR_ACTPH_MASK 0x30
-
-enum pcf50633_regulator_id {
- PCF50633_REGULATOR_AUTO,
- PCF50633_REGULATOR_DOWN1,
- PCF50633_REGULATOR_DOWN2,
- PCF50633_REGULATOR_LDO1,
- PCF50633_REGULATOR_LDO2,
- PCF50633_REGULATOR_LDO3,
- PCF50633_REGULATOR_LDO4,
- PCF50633_REGULATOR_LDO5,
- PCF50633_REGULATOR_LDO6,
- PCF50633_REGULATOR_HCLDO,
- PCF50633_REGULATOR_MEMLDO,
-};
-#endif
-
--
2.48.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: (subset) [PATCH v2 0/9] Remove pcf50633
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (8 preceding siblings ...)
2025-03-11 1:49 ` [PATCH v2 9/9] mfd: pcf50633: Remove remains linux
@ 2025-03-11 20:12 ` Mark Brown
2025-03-14 11:43 ` Lee Jones
10 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2025-03-11 20:12 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, alexandre.belloni,
danielt, jingoohan1, deller, linus.walleij, brgl, tsbogend, linux
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
On Tue, 11 Mar 2025 01:49:50 +0000, linux@treblig.org wrote:
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> Remove it.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[5/9] regulator: pcf50633-regulator: Remove
commit: 248bc01138b11ff3af38c3b4a39cb8db7aae6eb6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/9] power: supply: pcf50633: Remove charger
2025-03-11 1:49 ` [PATCH v2 6/9] power: supply: pcf50633: Remove charger linux
@ 2025-03-12 7:00 ` Sebastian Reichel
0 siblings, 0 replies; 16+ messages in thread
From: Sebastian Reichel @ 2025-03-12 7:00 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend, linux
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
On Tue, 11 Mar 2025 01:49:56 +0000, linux@treblig.org wrote:
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> Remove it.
>
> [...]
Applied, thanks!
[6/9] power: supply: pcf50633: Remove charger
commit: aae075a93f7705e29c599d101abc7e467125d871
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: (subset) [PATCH v2 7/9] backlight: pcf50633-backlight: Remove
2025-03-11 1:49 ` [PATCH v2 7/9] backlight: pcf50633-backlight: Remove linux
@ 2025-03-14 11:36 ` Lee Jones
0 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2025-03-14 11:36 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend, linux
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
On Tue, 11 Mar 2025 01:49:57 +0000, linux@treblig.org wrote:
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> Remove it.
>
> [...]
Applied, thanks!
[7/9] backlight: pcf50633-backlight: Remove
commit: dfc034a0494b8fb8ea881aeb41a0c4e2619ff1e4
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: (subset) [PATCH v2 0/9] Remove pcf50633
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
` (9 preceding siblings ...)
2025-03-11 20:12 ` (subset) [PATCH v2 0/9] Remove pcf50633 Mark Brown
@ 2025-03-14 11:43 ` Lee Jones
10 siblings, 0 replies; 16+ messages in thread
From: Lee Jones @ 2025-03-14 11:43 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend, linux
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
On Tue, 11 Mar 2025 01:49:50 +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> [...]
Applied, thanks!
[1/9] mfd: pcf50633-adc: Remove
commit: 0d0e54953805af76f0022df39602f5668145f747
[3/9] mfd: pcF50633-gpio: Remove
commit: 8559602247d0d054451c7a755942588d2c0de85d
[8/9] mfd: pcf50633: Remove irq code
commit: 786ad21f4350601c9d118ddbd19b7b830c04ece6
[9/9] mfd: pcf50633: Remove remains
commit: 44356090d59efd8db152e9eecb8e7f843be319f0
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: (subset) [PATCH v2 2/9] rtc: pcf50633: Remove
2025-03-11 1:49 ` [PATCH v2 2/9] rtc: pcf50633: Remove linux
@ 2025-03-17 21:56 ` Alexandre Belloni
0 siblings, 0 replies; 16+ messages in thread
From: Alexandre Belloni @ 2025-03-17 21:56 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie, danielt,
jingoohan1, deller, linus.walleij, brgl, tsbogend, linux
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
On Tue, 11 Mar 2025 01:49:52 +0000, linux@treblig.org wrote:
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> Remove it.
>
> [...]
Applied, thanks!
[2/9] rtc: pcf50633: Remove
https://git.kernel.org/abelloni/c/0a243de9d009
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/9] Input: pcf50633-input - Remove
2025-03-11 1:49 ` [PATCH v2 4/9] Input: pcf50633-input - Remove linux
@ 2025-04-01 11:31 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 16+ messages in thread
From: Dr. David Alan Gilbert @ 2025-04-01 11:31 UTC (permalink / raw)
To: arnd, lee, dmitry.torokhov, sre, lgirdwood, broonie,
alexandre.belloni, danielt, jingoohan1, deller, linus.walleij,
brgl, tsbogend
Cc: linux-mips, linux-input, linux-pm, linux-rtc, dri-devel,
linux-fbdev, linux-gpio, linux-kernel
* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> The pcf50633 was used as part of the OpenMoko devices but
> the support for its main chip was recently removed in:
> commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")
>
> See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Has anyone got this input patch lined up?
I think most of the other parts are there; the rtc I see in next.
Then once those go there is a core.h that needs nuking.
Dave
> ---
> drivers/input/misc/Kconfig | 7 --
> drivers/input/misc/Makefile | 1 -
> drivers/input/misc/pcf50633-input.c | 113 ----------------------------
> 3 files changed, 121 deletions(-)
> delete mode 100644 drivers/input/misc/pcf50633-input.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index 13d135257e06..62819144bd8c 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -584,13 +584,6 @@ config INPUT_PALMAS_PWRBUTTON
> To compile this driver as a module, choose M here. The module will
> be called palmas_pwrbutton.
>
> -config INPUT_PCF50633_PMU
> - tristate "PCF50633 PMU events"
> - depends on MFD_PCF50633
> - help
> - Say Y to include support for delivering PMU events via input
> - layer on NXP PCF50633.
> -
> config INPUT_PCF8574
> tristate "PCF8574 Keypad input device"
> depends on I2C
> diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
> index 6d91804d0a6f..d468c8140b93 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -59,7 +59,6 @@ obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o
> obj-$(CONFIG_INPUT_MMA8450) += mma8450.o
> obj-$(CONFIG_INPUT_PALMAS_PWRBUTTON) += palmas-pwrbutton.o
> obj-$(CONFIG_INPUT_PCAP) += pcap_keys.o
> -obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o
> obj-$(CONFIG_INPUT_PCF8574) += pcf8574_keypad.o
> obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
> obj-$(CONFIG_INPUT_PM8941_PWRKEY) += pm8941-pwrkey.o
> diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
> deleted file mode 100644
> index 6d046e236ba6..000000000000
> --- a/drivers/input/misc/pcf50633-input.c
> +++ /dev/null
> @@ -1,113 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/* NXP PCF50633 Input Driver
> - *
> - * (C) 2006-2008 by Openmoko, Inc.
> - * Author: Balaji Rao <balajirrao@openmoko.org>
> - * All rights reserved.
> - *
> - * Broken down from monstrous PCF50633 driver mainly by
> - * Harald Welte, Andy Green and Werner Almesberger
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/device.h>
> -#include <linux/platform_device.h>
> -#include <linux/input.h>
> -#include <linux/slab.h>
> -
> -#include <linux/mfd/pcf50633/core.h>
> -
> -#define PCF50633_OOCSTAT_ONKEY 0x01
> -#define PCF50633_REG_OOCSTAT 0x12
> -#define PCF50633_REG_OOCMODE 0x10
> -
> -struct pcf50633_input {
> - struct pcf50633 *pcf;
> - struct input_dev *input_dev;
> -};
> -
> -static void
> -pcf50633_input_irq(int irq, void *data)
> -{
> - struct pcf50633_input *input;
> - int onkey_released;
> -
> - input = data;
> -
> - /* We report only one event depending on the key press status */
> - onkey_released = pcf50633_reg_read(input->pcf, PCF50633_REG_OOCSTAT)
> - & PCF50633_OOCSTAT_ONKEY;
> -
> - if (irq == PCF50633_IRQ_ONKEYF && !onkey_released)
> - input_report_key(input->input_dev, KEY_POWER, 1);
> - else if (irq == PCF50633_IRQ_ONKEYR && onkey_released)
> - input_report_key(input->input_dev, KEY_POWER, 0);
> -
> - input_sync(input->input_dev);
> -}
> -
> -static int pcf50633_input_probe(struct platform_device *pdev)
> -{
> - struct pcf50633_input *input;
> - struct input_dev *input_dev;
> - int ret;
> -
> -
> - input = kzalloc(sizeof(*input), GFP_KERNEL);
> - if (!input)
> - return -ENOMEM;
> -
> - input_dev = input_allocate_device();
> - if (!input_dev) {
> - kfree(input);
> - return -ENOMEM;
> - }
> -
> - platform_set_drvdata(pdev, input);
> - input->pcf = dev_to_pcf50633(pdev->dev.parent);
> - input->input_dev = input_dev;
> -
> - input_dev->name = "PCF50633 PMU events";
> - input_dev->id.bustype = BUS_I2C;
> - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR);
> - set_bit(KEY_POWER, input_dev->keybit);
> -
> - ret = input_register_device(input_dev);
> - if (ret) {
> - input_free_device(input_dev);
> - kfree(input);
> - return ret;
> - }
> - pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYR,
> - pcf50633_input_irq, input);
> - pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYF,
> - pcf50633_input_irq, input);
> -
> - return 0;
> -}
> -
> -static void pcf50633_input_remove(struct platform_device *pdev)
> -{
> - struct pcf50633_input *input = platform_get_drvdata(pdev);
> -
> - pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYR);
> - pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYF);
> -
> - input_unregister_device(input->input_dev);
> - kfree(input);
> -}
> -
> -static struct platform_driver pcf50633_input_driver = {
> - .driver = {
> - .name = "pcf50633-input",
> - },
> - .probe = pcf50633_input_probe,
> - .remove = pcf50633_input_remove,
> -};
> -module_platform_driver(pcf50633_input_driver);
> -
> -MODULE_AUTHOR("Balaji Rao <balajirrao@openmoko.org>");
> -MODULE_DESCRIPTION("PCF50633 input driver");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:pcf50633-input");
> --
> 2.48.1
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-04-01 12:15 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 1:49 [PATCH v2 0/9] Remove pcf50633 linux
2025-03-11 1:49 ` [PATCH v2 1/9] mfd: pcf50633-adc: Remove linux
2025-03-11 1:49 ` [PATCH v2 2/9] rtc: pcf50633: Remove linux
2025-03-17 21:56 ` (subset) " Alexandre Belloni
2025-03-11 1:49 ` [PATCH v2 3/9] mfd: pcF50633-gpio: Remove linux
2025-03-11 1:49 ` [PATCH v2 4/9] Input: pcf50633-input - Remove linux
2025-04-01 11:31 ` Dr. David Alan Gilbert
2025-03-11 1:49 ` [PATCH v2 5/9] regulator: pcf50633-regulator: Remove linux
2025-03-11 1:49 ` [PATCH v2 6/9] power: supply: pcf50633: Remove charger linux
2025-03-12 7:00 ` Sebastian Reichel
2025-03-11 1:49 ` [PATCH v2 7/9] backlight: pcf50633-backlight: Remove linux
2025-03-14 11:36 ` (subset) " Lee Jones
2025-03-11 1:49 ` [PATCH v2 8/9] mfd: pcf50633: Remove irq code linux
2025-03-11 1:49 ` [PATCH v2 9/9] mfd: pcf50633: Remove remains linux
2025-03-11 20:12 ` (subset) [PATCH v2 0/9] Remove pcf50633 Mark Brown
2025-03-14 11:43 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).