From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> To: unlisted-recipients:; (no To-header on input) Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Lee Jones <lee.jones@linaro.org>, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 19/44] staging: mfd: hi6421-spmi-pmic: change namespace on its functions Date: Wed, 12 Aug 2020 17:56:29 +0200 [thread overview] Message-ID: <245cc5ea085af9f842406e34ddb4efd20965894f.1597247164.git.mchehab+huawei@kernel.org> (raw) In-Reply-To: <cover.1597247164.git.mchehab+huawei@kernel.org> Rename the functions used internally inside the driver in order for them to follow the driver's name. While here, get rid of some unused definitions at the header file. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 97 +++++++++++---------- include/linux/mfd/hi6421-spmi-pmic.h | 51 ++++------- 2 files changed, 70 insertions(+), 78 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c index aed2d3ec2227..09cedfa1e4bb 100644 --- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c +++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c @@ -62,7 +62,7 @@ static const struct mfd_cell hi6421v600_devs[] = { * Hisilicon SoC use hardware to map PMIC register into SoC mapping. * At here, we are accessing SoC register with 32-bit. */ -u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg) +u32 hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg) { u32 ret; u8 read_value = 0; @@ -82,9 +82,9 @@ u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg) } return (u32)read_value; } -EXPORT_SYMBOL(hisi_pmic_read); +EXPORT_SYMBOL(hi6421_spmi_pmic_read); -void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val) +void hi6421_spmi_pmic_write(struct hi6421_spmi_pmic *pmic, int reg, u32 val) { u32 ret; struct spmi_device *pdev; @@ -101,34 +101,36 @@ void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val) return; } } -EXPORT_SYMBOL(hisi_pmic_write); +EXPORT_SYMBOL(hi6421_spmi_pmic_write); -void hisi_pmic_rmw(struct hisi_pmic *pmic, int reg, u32 mask, u32 bits) +void hi6421_spmi_pmic_rmw(struct hi6421_spmi_pmic *pmic, int reg, + u32 mask, u32 bits) { u32 data; unsigned long flags; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, reg) & ~mask; + data = hi6421_spmi_pmic_read(pmic, reg) & ~mask; data |= mask & bits; - hisi_pmic_write(pmic, reg, data); + hi6421_spmi_pmic_write(pmic, reg, data); spin_unlock_irqrestore(&pmic->lock, flags); } -EXPORT_SYMBOL(hisi_pmic_rmw); +EXPORT_SYMBOL(hi6421_spmi_pmic_rmw); -static irqreturn_t hisi_irq_handler(int irq, void *data) +static irqreturn_t hi6421_spmi_irq_handler(int irq, void *data) { - struct hisi_pmic *pmic = (struct hisi_pmic *)data; + struct hi6421_spmi_pmic *pmic = (struct hi6421_spmi_pmic *)data; unsigned long pending; int i, offset; for (i = 0; i < pmic->irqarray; i++) { - pending = hisi_pmic_read(pmic, (i + pmic->irq_addr.start_addr)); + pending = hi6421_spmi_pmic_read(pmic, (i + pmic->irq_addr.start_addr)); pending &= HISI_MASK_FIELD; if (pending != 0) pr_debug("pending[%d]=0x%lx\n\r", i, pending); - hisi_pmic_write(pmic, (i + pmic->irq_addr.start_addr), pending); + hi6421_spmi_pmic_write(pmic, (i + pmic->irq_addr.start_addr), + pending); /* solve powerkey order */ if ((i == HISI_IRQ_KEY_NUM) && ((pending & HISI_IRQ_KEY_VALUE) == HISI_IRQ_KEY_VALUE)) { @@ -146,9 +148,9 @@ static irqreturn_t hisi_irq_handler(int irq, void *data) return IRQ_HANDLED; } -static void hisi_irq_mask(struct irq_data *d) +static void hi6421_spmi_irq_mask(struct irq_data *d) { - struct hisi_pmic *pmic = irq_data_get_irq_chip_data(d); + struct hi6421_spmi_pmic *pmic = irq_data_get_irq_chip_data(d); u32 data, offset; unsigned long flags; @@ -156,15 +158,15 @@ static void hisi_irq_mask(struct irq_data *d) offset += pmic->irq_mask_addr.start_addr; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, offset); + data = hi6421_spmi_pmic_read(pmic, offset); data |= (1 << (irqd_to_hwirq(d) & 0x07)); - hisi_pmic_write(pmic, offset, data); + hi6421_spmi_pmic_write(pmic, offset, data); spin_unlock_irqrestore(&pmic->lock, flags); } -static void hisi_irq_unmask(struct irq_data *d) +static void hi6421_spmi_irq_unmask(struct irq_data *d) { - struct hisi_pmic *pmic = irq_data_get_irq_chip_data(d); + struct hi6421_spmi_pmic *pmic = irq_data_get_irq_chip_data(d); u32 data, offset; unsigned long flags; @@ -172,26 +174,26 @@ static void hisi_irq_unmask(struct irq_data *d) offset += pmic->irq_mask_addr.start_addr; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, offset); + data = hi6421_spmi_pmic_read(pmic, offset); data &= ~(1 << (irqd_to_hwirq(d) & 0x07)); - hisi_pmic_write(pmic, offset, data); + hi6421_spmi_pmic_write(pmic, offset, data); spin_unlock_irqrestore(&pmic->lock, flags); } -static struct irq_chip hisi_pmu_irqchip = { +static struct irq_chip hi6421_spmi_pmu_irqchip = { .name = "hisi-irq", - .irq_mask = hisi_irq_mask, - .irq_unmask = hisi_irq_unmask, - .irq_disable = hisi_irq_mask, - .irq_enable = hisi_irq_unmask, + .irq_mask = hi6421_spmi_irq_mask, + .irq_unmask = hi6421_spmi_irq_unmask, + .irq_disable = hi6421_spmi_irq_mask, + .irq_enable = hi6421_spmi_irq_unmask, }; -static int hisi_irq_map(struct irq_domain *d, unsigned int virq, +static int hi6421_spmi_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw) { - struct hisi_pmic *pmic = d->host_data; + struct hi6421_spmi_pmic *pmic = d->host_data; - irq_set_chip_and_handler_name(virq, &hisi_pmu_irqchip, + irq_set_chip_and_handler_name(virq, &hi6421_spmi_pmu_irqchip, handle_simple_irq, "hisi"); irq_set_chip_data(virq, pmic); irq_set_irq_type(virq, IRQ_TYPE_NONE); @@ -199,12 +201,13 @@ static int hisi_irq_map(struct irq_domain *d, unsigned int virq, return 0; } -static const struct irq_domain_ops hisi_domain_ops = { - .map = hisi_irq_map, +static const struct irq_domain_ops hi6421_spmi_domain_ops = { + .map = hi6421_spmi_irq_map, .xlate = irq_domain_xlate_twocell, }; -static int get_pmic_device_tree_data(struct device_node *np, struct hisi_pmic *pmic) +static int get_pmic_device_tree_data(struct device_node *np, + struct hi6421_spmi_pmic *pmic) { int ret = 0; @@ -247,27 +250,29 @@ static int get_pmic_device_tree_data(struct device_node *np, struct hisi_pmic *p return ret; } -static void hisi_pmic_irq_prc(struct hisi_pmic *pmic) +static void hi6421_spmi_pmic_irq_prc(struct hi6421_spmi_pmic *pmic) { int i; for (i = 0 ; i < pmic->irq_mask_addr.array; i++) - hisi_pmic_write(pmic, pmic->irq_mask_addr.start_addr + i, HISI_MASK_STATE); + hi6421_spmi_pmic_write(pmic, pmic->irq_mask_addr.start_addr + i, + HISI_MASK_STATE); for (i = 0 ; i < pmic->irq_addr.array; i++) { - unsigned int pending = hisi_pmic_read(pmic, pmic->irq_addr.start_addr + i); + unsigned int pending = hi6421_spmi_pmic_read(pmic, pmic->irq_addr.start_addr + i); pr_debug("PMU IRQ address value:irq[0x%x] = 0x%x\n", pmic->irq_addr.start_addr + i, pending); - hisi_pmic_write(pmic, pmic->irq_addr.start_addr + i, HISI_MASK_STATE); + hi6421_spmi_pmic_write(pmic, pmic->irq_addr.start_addr + i, + HISI_MASK_STATE); } } -static int hisi_pmic_probe(struct spmi_device *pdev) +static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct hisi_pmic *pmic = NULL; + struct hi6421_spmi_pmic *pmic = NULL; enum of_gpio_flags flags; int ret = 0; int i; @@ -305,14 +310,14 @@ static int hisi_pmic_probe(struct spmi_device *pdev) pmic->irq = gpio_to_irq(pmic->gpio); /* mask && clear IRQ status */ - hisi_pmic_irq_prc(pmic); + hi6421_spmi_pmic_irq_prc(pmic); pmic->irqs = devm_kzalloc(dev, pmic->irqnum * sizeof(int), GFP_KERNEL); if (!pmic->irqs) goto irq_malloc; pmic->domain = irq_domain_add_simple(np, pmic->irqnum, 0, - &hisi_domain_ops, pmic); + &hi6421_spmi_domain_ops, pmic); if (!pmic->domain) { dev_err(dev, "failed irq domain add simple!\n"); ret = -ENODEV; @@ -330,7 +335,7 @@ static int hisi_pmic_probe(struct spmi_device *pdev) pr_info("[%s]. pmic->irqs[%d] = %d\n", __func__, i, pmic->irqs[i]); } - ret = request_threaded_irq(pmic->irq, hisi_irq_handler, NULL, + ret = request_threaded_irq(pmic->irq, hi6421_spmi_irq_handler, NULL, IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, "pmic", pmic); if (ret < 0) { @@ -365,9 +370,9 @@ static int hisi_pmic_probe(struct spmi_device *pdev) return ret; } -static void hisi_pmic_remove(struct spmi_device *pdev) +static void hi6421_spmi_pmic_remove(struct spmi_device *pdev) { - struct hisi_pmic *pmic = dev_get_drvdata(&pdev->dev); + struct hi6421_spmi_pmic *pmic = dev_get_drvdata(&pdev->dev); free_irq(pmic->irq, pmic); gpio_free(pmic->gpio); @@ -380,15 +385,15 @@ static const struct of_device_id pmic_spmi_id_table[] = { }; MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); -static struct spmi_driver hisi_pmic_driver = { +static struct spmi_driver hi6421_spmi_pmic_driver = { .driver = { .name = "hi6421-spmi-pmic", .of_match_table = pmic_spmi_id_table, }, - .probe = hisi_pmic_probe, - .remove = hisi_pmic_remove, + .probe = hi6421_spmi_pmic_probe, + .remove = hi6421_spmi_pmic_remove, }; -module_spmi_driver(hisi_pmic_driver); +module_spmi_driver(hi6421_spmi_pmic_driver); MODULE_DESCRIPTION("HiSilicon Hi6421v600 SPMI PMIC driver"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/mfd/hi6421-spmi-pmic.h b/include/linux/mfd/hi6421-spmi-pmic.h index 41b61de48259..d12ad7484018 100644 --- a/include/linux/mfd/hi6421-spmi-pmic.h +++ b/include/linux/mfd/hi6421-spmi-pmic.h @@ -17,49 +17,36 @@ #define HISI_ECO_MODE_ENABLE (1) #define HISI_ECO_MODE_DISABLE (0) -typedef int (*pmic_ocp_callback)(char *); -int hisi_pmic_special_ocp_register(char *power_name, pmic_ocp_callback handler); - -struct irq_mask_info { +struct hi6421_spmi_irq_mask_info { int start_addr; int array; }; -struct irq_info { +struct hi6421_spmi_irq_info { int start_addr; int array; }; -struct bit_info { - int addr; - int bit; -}; - -struct write_lock { - int addr; - int val; -}; - -struct hisi_pmic { - struct resource *res; - struct device *dev; - void __iomem *regs; - spinlock_t lock; - struct irq_domain *domain; - int irq; - int gpio; - unsigned int *irqs; - int irqnum; - int irqarray; - struct irq_mask_info irq_mask_addr; - struct irq_info irq_addr; +struct hi6421_spmi_pmic { + struct resource *res; + struct device *dev; + void __iomem *regs; + spinlock_t lock; + struct irq_domain *domain; + int irq; + int gpio; + unsigned int *irqs; + int irqnum; + int irqarray; + struct hi6421_spmi_irq_mask_info irq_mask_addr; + struct hi6421_spmi_irq_info irq_addr; }; -u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg); -void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val); -void hisi_pmic_rmw(struct hisi_pmic *pmic, int reg, u32 mask, u32 bits); +u32 hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg); +void hi6421_spmi_pmic_write(struct hi6421_spmi_pmic *pmic, int reg, u32 val); +void hi6421_spmi_pmic_rmw(struct hi6421_spmi_pmic *pmic, int reg, u32 mask, u32 bits); -enum pmic_irq_list { +enum hi6421_spmi_pmic_irq_list { OTMP = 0, VBUS_CONNECT, VBUS_DISCONNECT, -- 2.26.2
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Cc: devel@driverdev.osuosl.org, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linuxarm@huawei.com, linux-kernel@vger.kernel.org, mauro.chehab@huawei.com, Lee Jones <lee.jones@linaro.org> Subject: [PATCH 19/44] staging: mfd: hi6421-spmi-pmic: change namespace on its functions Date: Wed, 12 Aug 2020 17:56:29 +0200 [thread overview] Message-ID: <245cc5ea085af9f842406e34ddb4efd20965894f.1597247164.git.mchehab+huawei@kernel.org> (raw) In-Reply-To: <cover.1597247164.git.mchehab+huawei@kernel.org> Rename the functions used internally inside the driver in order for them to follow the driver's name. While here, get rid of some unused definitions at the header file. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> --- drivers/staging/hikey9xx/hi6421-spmi-pmic.c | 97 +++++++++++---------- include/linux/mfd/hi6421-spmi-pmic.h | 51 ++++------- 2 files changed, 70 insertions(+), 78 deletions(-) diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c index aed2d3ec2227..09cedfa1e4bb 100644 --- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c +++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c @@ -62,7 +62,7 @@ static const struct mfd_cell hi6421v600_devs[] = { * Hisilicon SoC use hardware to map PMIC register into SoC mapping. * At here, we are accessing SoC register with 32-bit. */ -u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg) +u32 hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg) { u32 ret; u8 read_value = 0; @@ -82,9 +82,9 @@ u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg) } return (u32)read_value; } -EXPORT_SYMBOL(hisi_pmic_read); +EXPORT_SYMBOL(hi6421_spmi_pmic_read); -void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val) +void hi6421_spmi_pmic_write(struct hi6421_spmi_pmic *pmic, int reg, u32 val) { u32 ret; struct spmi_device *pdev; @@ -101,34 +101,36 @@ void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val) return; } } -EXPORT_SYMBOL(hisi_pmic_write); +EXPORT_SYMBOL(hi6421_spmi_pmic_write); -void hisi_pmic_rmw(struct hisi_pmic *pmic, int reg, u32 mask, u32 bits) +void hi6421_spmi_pmic_rmw(struct hi6421_spmi_pmic *pmic, int reg, + u32 mask, u32 bits) { u32 data; unsigned long flags; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, reg) & ~mask; + data = hi6421_spmi_pmic_read(pmic, reg) & ~mask; data |= mask & bits; - hisi_pmic_write(pmic, reg, data); + hi6421_spmi_pmic_write(pmic, reg, data); spin_unlock_irqrestore(&pmic->lock, flags); } -EXPORT_SYMBOL(hisi_pmic_rmw); +EXPORT_SYMBOL(hi6421_spmi_pmic_rmw); -static irqreturn_t hisi_irq_handler(int irq, void *data) +static irqreturn_t hi6421_spmi_irq_handler(int irq, void *data) { - struct hisi_pmic *pmic = (struct hisi_pmic *)data; + struct hi6421_spmi_pmic *pmic = (struct hi6421_spmi_pmic *)data; unsigned long pending; int i, offset; for (i = 0; i < pmic->irqarray; i++) { - pending = hisi_pmic_read(pmic, (i + pmic->irq_addr.start_addr)); + pending = hi6421_spmi_pmic_read(pmic, (i + pmic->irq_addr.start_addr)); pending &= HISI_MASK_FIELD; if (pending != 0) pr_debug("pending[%d]=0x%lx\n\r", i, pending); - hisi_pmic_write(pmic, (i + pmic->irq_addr.start_addr), pending); + hi6421_spmi_pmic_write(pmic, (i + pmic->irq_addr.start_addr), + pending); /* solve powerkey order */ if ((i == HISI_IRQ_KEY_NUM) && ((pending & HISI_IRQ_KEY_VALUE) == HISI_IRQ_KEY_VALUE)) { @@ -146,9 +148,9 @@ static irqreturn_t hisi_irq_handler(int irq, void *data) return IRQ_HANDLED; } -static void hisi_irq_mask(struct irq_data *d) +static void hi6421_spmi_irq_mask(struct irq_data *d) { - struct hisi_pmic *pmic = irq_data_get_irq_chip_data(d); + struct hi6421_spmi_pmic *pmic = irq_data_get_irq_chip_data(d); u32 data, offset; unsigned long flags; @@ -156,15 +158,15 @@ static void hisi_irq_mask(struct irq_data *d) offset += pmic->irq_mask_addr.start_addr; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, offset); + data = hi6421_spmi_pmic_read(pmic, offset); data |= (1 << (irqd_to_hwirq(d) & 0x07)); - hisi_pmic_write(pmic, offset, data); + hi6421_spmi_pmic_write(pmic, offset, data); spin_unlock_irqrestore(&pmic->lock, flags); } -static void hisi_irq_unmask(struct irq_data *d) +static void hi6421_spmi_irq_unmask(struct irq_data *d) { - struct hisi_pmic *pmic = irq_data_get_irq_chip_data(d); + struct hi6421_spmi_pmic *pmic = irq_data_get_irq_chip_data(d); u32 data, offset; unsigned long flags; @@ -172,26 +174,26 @@ static void hisi_irq_unmask(struct irq_data *d) offset += pmic->irq_mask_addr.start_addr; spin_lock_irqsave(&pmic->lock, flags); - data = hisi_pmic_read(pmic, offset); + data = hi6421_spmi_pmic_read(pmic, offset); data &= ~(1 << (irqd_to_hwirq(d) & 0x07)); - hisi_pmic_write(pmic, offset, data); + hi6421_spmi_pmic_write(pmic, offset, data); spin_unlock_irqrestore(&pmic->lock, flags); } -static struct irq_chip hisi_pmu_irqchip = { +static struct irq_chip hi6421_spmi_pmu_irqchip = { .name = "hisi-irq", - .irq_mask = hisi_irq_mask, - .irq_unmask = hisi_irq_unmask, - .irq_disable = hisi_irq_mask, - .irq_enable = hisi_irq_unmask, + .irq_mask = hi6421_spmi_irq_mask, + .irq_unmask = hi6421_spmi_irq_unmask, + .irq_disable = hi6421_spmi_irq_mask, + .irq_enable = hi6421_spmi_irq_unmask, }; -static int hisi_irq_map(struct irq_domain *d, unsigned int virq, +static int hi6421_spmi_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw) { - struct hisi_pmic *pmic = d->host_data; + struct hi6421_spmi_pmic *pmic = d->host_data; - irq_set_chip_and_handler_name(virq, &hisi_pmu_irqchip, + irq_set_chip_and_handler_name(virq, &hi6421_spmi_pmu_irqchip, handle_simple_irq, "hisi"); irq_set_chip_data(virq, pmic); irq_set_irq_type(virq, IRQ_TYPE_NONE); @@ -199,12 +201,13 @@ static int hisi_irq_map(struct irq_domain *d, unsigned int virq, return 0; } -static const struct irq_domain_ops hisi_domain_ops = { - .map = hisi_irq_map, +static const struct irq_domain_ops hi6421_spmi_domain_ops = { + .map = hi6421_spmi_irq_map, .xlate = irq_domain_xlate_twocell, }; -static int get_pmic_device_tree_data(struct device_node *np, struct hisi_pmic *pmic) +static int get_pmic_device_tree_data(struct device_node *np, + struct hi6421_spmi_pmic *pmic) { int ret = 0; @@ -247,27 +250,29 @@ static int get_pmic_device_tree_data(struct device_node *np, struct hisi_pmic *p return ret; } -static void hisi_pmic_irq_prc(struct hisi_pmic *pmic) +static void hi6421_spmi_pmic_irq_prc(struct hi6421_spmi_pmic *pmic) { int i; for (i = 0 ; i < pmic->irq_mask_addr.array; i++) - hisi_pmic_write(pmic, pmic->irq_mask_addr.start_addr + i, HISI_MASK_STATE); + hi6421_spmi_pmic_write(pmic, pmic->irq_mask_addr.start_addr + i, + HISI_MASK_STATE); for (i = 0 ; i < pmic->irq_addr.array; i++) { - unsigned int pending = hisi_pmic_read(pmic, pmic->irq_addr.start_addr + i); + unsigned int pending = hi6421_spmi_pmic_read(pmic, pmic->irq_addr.start_addr + i); pr_debug("PMU IRQ address value:irq[0x%x] = 0x%x\n", pmic->irq_addr.start_addr + i, pending); - hisi_pmic_write(pmic, pmic->irq_addr.start_addr + i, HISI_MASK_STATE); + hi6421_spmi_pmic_write(pmic, pmic->irq_addr.start_addr + i, + HISI_MASK_STATE); } } -static int hisi_pmic_probe(struct spmi_device *pdev) +static int hi6421_spmi_pmic_probe(struct spmi_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct hisi_pmic *pmic = NULL; + struct hi6421_spmi_pmic *pmic = NULL; enum of_gpio_flags flags; int ret = 0; int i; @@ -305,14 +310,14 @@ static int hisi_pmic_probe(struct spmi_device *pdev) pmic->irq = gpio_to_irq(pmic->gpio); /* mask && clear IRQ status */ - hisi_pmic_irq_prc(pmic); + hi6421_spmi_pmic_irq_prc(pmic); pmic->irqs = devm_kzalloc(dev, pmic->irqnum * sizeof(int), GFP_KERNEL); if (!pmic->irqs) goto irq_malloc; pmic->domain = irq_domain_add_simple(np, pmic->irqnum, 0, - &hisi_domain_ops, pmic); + &hi6421_spmi_domain_ops, pmic); if (!pmic->domain) { dev_err(dev, "failed irq domain add simple!\n"); ret = -ENODEV; @@ -330,7 +335,7 @@ static int hisi_pmic_probe(struct spmi_device *pdev) pr_info("[%s]. pmic->irqs[%d] = %d\n", __func__, i, pmic->irqs[i]); } - ret = request_threaded_irq(pmic->irq, hisi_irq_handler, NULL, + ret = request_threaded_irq(pmic->irq, hi6421_spmi_irq_handler, NULL, IRQF_TRIGGER_LOW | IRQF_SHARED | IRQF_NO_SUSPEND, "pmic", pmic); if (ret < 0) { @@ -365,9 +370,9 @@ static int hisi_pmic_probe(struct spmi_device *pdev) return ret; } -static void hisi_pmic_remove(struct spmi_device *pdev) +static void hi6421_spmi_pmic_remove(struct spmi_device *pdev) { - struct hisi_pmic *pmic = dev_get_drvdata(&pdev->dev); + struct hi6421_spmi_pmic *pmic = dev_get_drvdata(&pdev->dev); free_irq(pmic->irq, pmic); gpio_free(pmic->gpio); @@ -380,15 +385,15 @@ static const struct of_device_id pmic_spmi_id_table[] = { }; MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); -static struct spmi_driver hisi_pmic_driver = { +static struct spmi_driver hi6421_spmi_pmic_driver = { .driver = { .name = "hi6421-spmi-pmic", .of_match_table = pmic_spmi_id_table, }, - .probe = hisi_pmic_probe, - .remove = hisi_pmic_remove, + .probe = hi6421_spmi_pmic_probe, + .remove = hi6421_spmi_pmic_remove, }; -module_spmi_driver(hisi_pmic_driver); +module_spmi_driver(hi6421_spmi_pmic_driver); MODULE_DESCRIPTION("HiSilicon Hi6421v600 SPMI PMIC driver"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/mfd/hi6421-spmi-pmic.h b/include/linux/mfd/hi6421-spmi-pmic.h index 41b61de48259..d12ad7484018 100644 --- a/include/linux/mfd/hi6421-spmi-pmic.h +++ b/include/linux/mfd/hi6421-spmi-pmic.h @@ -17,49 +17,36 @@ #define HISI_ECO_MODE_ENABLE (1) #define HISI_ECO_MODE_DISABLE (0) -typedef int (*pmic_ocp_callback)(char *); -int hisi_pmic_special_ocp_register(char *power_name, pmic_ocp_callback handler); - -struct irq_mask_info { +struct hi6421_spmi_irq_mask_info { int start_addr; int array; }; -struct irq_info { +struct hi6421_spmi_irq_info { int start_addr; int array; }; -struct bit_info { - int addr; - int bit; -}; - -struct write_lock { - int addr; - int val; -}; - -struct hisi_pmic { - struct resource *res; - struct device *dev; - void __iomem *regs; - spinlock_t lock; - struct irq_domain *domain; - int irq; - int gpio; - unsigned int *irqs; - int irqnum; - int irqarray; - struct irq_mask_info irq_mask_addr; - struct irq_info irq_addr; +struct hi6421_spmi_pmic { + struct resource *res; + struct device *dev; + void __iomem *regs; + spinlock_t lock; + struct irq_domain *domain; + int irq; + int gpio; + unsigned int *irqs; + int irqnum; + int irqarray; + struct hi6421_spmi_irq_mask_info irq_mask_addr; + struct hi6421_spmi_irq_info irq_addr; }; -u32 hisi_pmic_read(struct hisi_pmic *pmic, int reg); -void hisi_pmic_write(struct hisi_pmic *pmic, int reg, u32 val); -void hisi_pmic_rmw(struct hisi_pmic *pmic, int reg, u32 mask, u32 bits); +u32 hi6421_spmi_pmic_read(struct hi6421_spmi_pmic *pmic, int reg); +void hi6421_spmi_pmic_write(struct hi6421_spmi_pmic *pmic, int reg, u32 val); +void hi6421_spmi_pmic_rmw(struct hi6421_spmi_pmic *pmic, int reg, u32 mask, u32 bits); -enum pmic_irq_list { +enum hi6421_spmi_pmic_irq_list { OTMP = 0, VBUS_CONNECT, VBUS_DISCONNECT, -- 2.26.2 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2020-08-12 15:57 UTC|newest] Thread overview: 129+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-12 15:56 [PATCH 00/44] SPMI patches needed by Hikey 970 Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 01/44] staging: spmi: add Hikey 970 SPMI controller driver Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 16:28 ` Greg Kroah-Hartman 2020-08-12 16:28 ` Greg Kroah-Hartman 2020-08-12 18:59 ` Mauro Carvalho Chehab 2020-08-12 18:59 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 02/44] staging: spmi: hisi-spmi-controller: coding style fixup Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 03/44] staging: spmi: hisi-spmi-controller: fix it to probe successfully Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 04/44] staging: spmi: hisi-spmi-controller: fix a typo Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 05/44] staging: spmi: hisi-spmi-controller: adjust whitespaces at defines Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 06/44] staging: spmi: hisi-spmi-controller: use le32 macros where needed Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 16:21 ` Joe Perches 2020-08-12 16:21 ` Joe Perches 2020-08-12 19:02 ` Mauro Carvalho Chehab 2020-08-12 19:02 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 07/44] staging: spmi: hisi-spmi-controller: add debug when values are read/write Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 08/44] staging: spmi: hisi-spmi-controller: fix the dev_foo() logic Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 09/44] staging: spmi: hisi-spmi-controller: add it to the building system Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 10/44] staging: spmi: hisi-spmi-controller: do some code cleanups Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 16:17 ` Joe Perches 2020-08-12 16:17 ` Joe Perches 2020-08-12 15:56 ` [PATCH 11/44] staging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 12/44] staging: mfd: hi6421-spmi-pmic: get rid of unused code Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 13/44] staging: mfd: hi6421-spmi-pmic: deal with non-static functions Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 14/44] staging: mfd: hi6421-spmi-pmic: get rid of the static vars Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 15/44] staging: mfd: hi6421-spmi-pmic: cleanup hi6421-spmi-pmic.h header Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 16/44] staging: mfd: hi6421-spmi-pmic: change the binding logic Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 17/44] staging: mfd: hi6421-spmi-pmic: get rid of unused OF properties Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 18/44] staging: mfd: hi6421-spmi-pmic: cleanup " Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab [this message] 2020-08-12 15:56 ` [PATCH 19/44] staging: mfd: hi6421-spmi-pmic: change namespace on its functions Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 20/44] staging: mfd: hi6421-spmi-pmic: fix some coding style issues Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 16:12 ` Joe Perches 2020-08-12 16:12 ` Joe Perches 2020-08-12 15:56 ` [PATCH 21/44] staging: mfd: hi6421-spmi-pmic: add it to the building system Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 22/44] staging: mfd: hi6421-spmi-pmic: cleanup the code Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 23/44] staging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 24/44] staging: regulator: hi6421v600-regulator: get rid of unused code Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 25/44] staging: regulator: hi6421v600-regulator: port it to upstream Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 26/44] staging: regulator: hi6421v600-regulator: coding style fixups Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 27/44] staging: regulator: hi6421v600-regulator: change the binding logic Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 28/44] staging: regulator: hi6421v600-regulator: cleanup struct hisi_regulator Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 29/44] staging: regulator: hi6421v600-regulator: cleanup debug messages Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 30/44] staging: regulator: hi6421v600-regulator: use shorter names for OF properties Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 31/44] staging: regulator: hi6421v600-regulator: better handle modes Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 32/44] staging: regulator: hi6421v600-regulator: change namespace Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 33/44] staging: regulator: hi6421v600-regulator: convert to use get/set voltage_sel Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 34/44] staging: regulator: hi6421v600-regulator: don't use usleep_range for off_on_delay Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a driver-specific debug macro Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 16:10 ` Joe Perches 2020-08-12 16:10 ` Joe Perches 2020-08-13 10:10 ` Mauro Carvalho Chehab 2020-08-13 10:10 ` Mauro Carvalho Chehab 2020-08-13 15:07 ` Joe Perches 2020-08-13 15:07 ` Joe Perches 2020-08-14 4:01 ` [PATCH] media: debugging logging cleanup Joe Perches 2020-08-14 4:01 ` Joe Perches 2020-08-12 15:56 ` [PATCH 36/44] staging: regulator: hi6421v600-regulator: initialize ramp_delay Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 37/44] staging: regulator: hi6421v600-regulator: cleanup DT settings Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 38/44] staging: regulator: hi6421v600-regulator: fix some coding style issues Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 39/44] staging: regulator: hi6421v600-regulator: add it to the building system Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 40/44] staging: regulator: hi6421v600-regulator: code cleanup Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 41/44] staging: hikey9xx: add a TODO list Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 42/44] MAINTAINERS: add an entry for HiSilicon 6421v600 drivers Mauro Carvalho Chehab 2020-08-12 15:56 ` [PATCH 43/44] dt: document HiSilicon SPMI controller and mfd/regulator properties Mauro Carvalho Chehab 2020-08-14 20:17 ` Rob Herring 2020-08-15 9:55 ` Mauro Carvalho Chehab 2020-08-17 14:13 ` Rob Herring 2020-08-12 15:56 ` [PATCH 44/44] dt: hisilicon: add support for the PMIC found on Hikey 970 Mauro Carvalho Chehab 2020-08-12 15:56 ` Mauro Carvalho Chehab 2020-08-12 17:13 ` [PATCH 00/44] SPMI patches needed by " Joe Perches 2020-08-12 17:13 ` Joe Perches 2020-08-12 17:13 ` Joe Perches 2020-08-12 18:47 ` Mauro Carvalho Chehab 2020-08-12 18:47 ` Mauro Carvalho Chehab 2020-08-12 18:47 ` Mauro Carvalho Chehab 2020-08-12 18:58 ` Joe Perches 2020-08-12 18:58 ` Joe Perches 2020-08-12 18:58 ` Joe Perches 2020-08-12 19:07 ` Mauro Carvalho Chehab 2020-08-12 19:07 ` Mauro Carvalho Chehab 2020-08-12 19:07 ` Mauro Carvalho Chehab 2020-08-13 7:58 ` Lee Jones 2020-08-13 7:58 ` Lee Jones 2020-08-13 7:58 ` Lee Jones 2020-08-13 9:58 ` Mauro Carvalho Chehab 2020-08-13 9:58 ` Mauro Carvalho Chehab 2020-08-13 9:58 ` Mauro Carvalho Chehab
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=245cc5ea085af9f842406e34ddb4efd20965894f.1597247164.git.mchehab+huawei@kernel.org \ --to=mchehab+huawei@kernel.org \ --cc=devel@driverdev.osuosl.org \ --cc=gregkh@linuxfoundation.org \ --cc=lee.jones@linaro.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxarm@huawei.com \ --cc=mauro.chehab@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.