Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1212427 > unrolled thread
| Started by | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| First post | 2015-08-24 21:00 +0200 |
| Last post | 2015-08-25 10:50 +0200 |
| Articles | 9 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH-v2 0/5] clk: 88pm800: Add new clk provider driver for 88PM800 MFD Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-24 21:00 +0200
[PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-24 21:00 +0200
Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue Lee Jones <lee.jones@linaro.org> - 2015-08-25 10:10 +0200
Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-25 11:00 +0200
Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue Lee Jones <lee.jones@linaro.org> - 2015-08-25 12:40 +0200
Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-25 13:00 +0200
[PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-24 21:00 +0200
Re: [PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros Lee Jones <lee.jones@linaro.org> - 2015-08-25 10:20 +0200
Re: [PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2015-08-25 10:50 +0200
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-24 21:00 +0200 |
| Subject | [PATCH-v2 0/5] clk: 88pm800: Add new clk provider driver for 88PM800 MFD |
| Message-ID | <q158m-7Qs-7@gated-at.bofh.it> |
88PM800 family of devices provides multiple buffered 32.768 KHz clock output. 88PM800 : CLK32k_1, CLK32k_2 and CLK32k_3 88PM860 : CLK32k_1 and CLK32k_2 This patch-series adds new clock provider driver for enabling/disabling buffered 32Khz clock output from 88PM800 family of device. Adds clock device to MFD and updates the binding documentation. The PATCH [1/4], created separately, as it would be easy between maintainers to queue it. Note that, I have access to only 88PM800 and 88PM860 datasheet, so enabling support for only above two devices. Testing: - Boot tested on 88PM860 based platform - Clock enable/disable - Non PM860, to make sure that it won't lead to any issues V1 => V2: ======== Link to V1: https://lkml.org/lkml/2015/7/21/298 - Added new patch to the series [1/5], fixing tabbing issue in the file - Removed unnecessary brackets around macro value - Used devm_kcalloc variants for array allocation instead of kzalloc. - Fixed all other trivial issues. Vaibhav Hiremath (5): mfd: 88pm800: Fix tabbing issue mfd: 88pm800: Update the header file with 32K clk related macros mfd: devicetree: bindings: Add clock subdevice node information clk: 88pm800: Add clk provider driver for 88pm800 family of devices mfd: 88pm800: Add support for clk subdevice Documentation/devicetree/bindings/mfd/88pm800.txt | 27 ++ drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-88pm800.c | 341 ++++++++++++++++++++++ drivers/mfd/88pm800.c | 150 ++++++---- include/linux/mfd/88pm80x.h | 12 + 6 files changed, 475 insertions(+), 64 deletions(-) create mode 100644 drivers/clk/clk-88pm800.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-24 21:00 +0200 |
| Subject | [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue |
| Message-ID | <q158m-7Qs-25@gated-at.bofh.it> |
| In reply to | #1212427 |
Driver had coding style issues where spaces were used instead
of tabs. This patch fixes them all.
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
drivers/mfd/88pm800.c | 125 ++++++++++++++++++++++++--------------------------
1 file changed, 61 insertions(+), 64 deletions(-)
diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
index f104a32..c4e097d 100644
--- a/drivers/mfd/88pm800.c
+++ b/drivers/mfd/88pm800.c
@@ -30,55 +30,55 @@
#include <linux/of_device.h>
/* Interrupt Registers */
-#define PM800_INT_STATUS1 (0x05)
+#define PM800_INT_STATUS1 0x05
#define PM800_ONKEY_INT_STS1 (1 << 0)
#define PM800_EXTON_INT_STS1 (1 << 1)
-#define PM800_CHG_INT_STS1 (1 << 2)
-#define PM800_BAT_INT_STS1 (1 << 3)
-#define PM800_RTC_INT_STS1 (1 << 4)
+#define PM800_CHG_INT_STS1 (1 << 2)
+#define PM800_BAT_INT_STS1 (1 << 3)
+#define PM800_RTC_INT_STS1 (1 << 4)
#define PM800_CLASSD_OC_INT_STS1 (1 << 5)
-#define PM800_INT_STATUS2 (0x06)
+#define PM800_INT_STATUS2 0x06
#define PM800_VBAT_INT_STS2 (1 << 0)
#define PM800_VSYS_INT_STS2 (1 << 1)
#define PM800_VCHG_INT_STS2 (1 << 2)
#define PM800_TINT_INT_STS2 (1 << 3)
-#define PM800_GPADC0_INT_STS2 (1 << 4)
+#define PM800_GPADC0_INT_STS2 (1 << 4)
#define PM800_TBAT_INT_STS2 (1 << 5)
-#define PM800_GPADC2_INT_STS2 (1 << 6)
-#define PM800_GPADC3_INT_STS2 (1 << 7)
+#define PM800_GPADC2_INT_STS2 (1 << 6)
+#define PM800_GPADC3_INT_STS2 (1 << 7)
-#define PM800_INT_STATUS3 (0x07)
+#define PM800_INT_STATUS3 0x07
-#define PM800_INT_STATUS4 (0x08)
+#define PM800_INT_STATUS4 0x08
#define PM800_GPIO0_INT_STS4 (1 << 0)
#define PM800_GPIO1_INT_STS4 (1 << 1)
#define PM800_GPIO2_INT_STS4 (1 << 2)
#define PM800_GPIO3_INT_STS4 (1 << 3)
#define PM800_GPIO4_INT_STS4 (1 << 4)
-#define PM800_INT_ENA_1 (0x09)
+#define PM800_INT_ENA_1 0x09
#define PM800_ONKEY_INT_ENA1 (1 << 0)
#define PM800_EXTON_INT_ENA1 (1 << 1)
-#define PM800_CHG_INT_ENA1 (1 << 2)
-#define PM800_BAT_INT_ENA1 (1 << 3)
-#define PM800_RTC_INT_ENA1 (1 << 4)
+#define PM800_CHG_INT_ENA1 (1 << 2)
+#define PM800_BAT_INT_ENA1 (1 << 3)
+#define PM800_RTC_INT_ENA1 (1 << 4)
#define PM800_CLASSD_OC_INT_ENA1 (1 << 5)
-#define PM800_INT_ENA_2 (0x0A)
+#define PM800_INT_ENA_2 0x0A
#define PM800_VBAT_INT_ENA2 (1 << 0)
#define PM800_VSYS_INT_ENA2 (1 << 1)
#define PM800_VCHG_INT_ENA2 (1 << 2)
#define PM800_TINT_INT_ENA2 (1 << 3)
-#define PM800_INT_ENA_3 (0x0B)
+#define PM800_INT_ENA_3 0x0B
#define PM800_GPADC0_INT_ENA3 (1 << 0)
#define PM800_GPADC1_INT_ENA3 (1 << 1)
#define PM800_GPADC2_INT_ENA3 (1 << 2)
#define PM800_GPADC3_INT_ENA3 (1 << 3)
#define PM800_GPADC4_INT_ENA3 (1 << 4)
-#define PM800_INT_ENA_4 (0x0C)
+#define PM800_INT_ENA_4 0x0C
#define PM800_GPIO0_INT_ENA4 (1 << 0)
#define PM800_GPIO1_INT_ENA4 (1 << 1)
#define PM800_GPIO2_INT_ENA4 (1 << 2)
@@ -86,7 +86,7 @@
#define PM800_GPIO4_INT_ENA4 (1 << 4)
/* number of INT_ENA & INT_STATUS regs */
-#define PM800_INT_REG_NUM (4)
+#define PM800_INT_REG_NUM 4
/* Interrupt Number in 88PM800 */
enum {
@@ -114,7 +114,7 @@ enum {
};
/* PM800: generation identification number */
-#define PM800_CHIP_GEN_ID_NUM 0x3
+#define PM800_CHIP_GEN_ID_NUM 0x3
static const struct i2c_device_id pm80x_id_table[] = {
{"88PM800", 0},
@@ -129,47 +129,47 @@ static const struct of_device_id pm80x_of_match_table[] = {
static struct resource rtc_resources[] = {
{
- .name = "88pm80x-rtc",
- .start = PM800_IRQ_RTC,
- .end = PM800_IRQ_RTC,
- .flags = IORESOURCE_IRQ,
- },
+ .name = "88pm80x-rtc",
+ .start = PM800_IRQ_RTC,
+ .end = PM800_IRQ_RTC,
+ .flags = IORESOURCE_IRQ,
+ },
};
static struct mfd_cell rtc_devs[] = {
{
- .name = "88pm80x-rtc",
- .of_compatible = "marvell,88pm80x-rtc",
- .num_resources = ARRAY_SIZE(rtc_resources),
- .resources = &rtc_resources[0],
- .id = -1,
- },
+ .name = "88pm80x-rtc",
+ .of_compatible = "marvell,88pm80x-rtc",
+ .num_resources = ARRAY_SIZE(rtc_resources),
+ .resources = &rtc_resources[0],
+ .id = -1,
+ },
};
static struct resource onkey_resources[] = {
{
- .name = "88pm80x-onkey",
- .start = PM800_IRQ_ONKEY,
- .end = PM800_IRQ_ONKEY,
- .flags = IORESOURCE_IRQ,
- },
+ .name = "88pm80x-onkey",
+ .start = PM800_IRQ_ONKEY,
+ .end = PM800_IRQ_ONKEY,
+ .flags = IORESOURCE_IRQ,
+ },
};
static const struct mfd_cell onkey_devs[] = {
{
- .name = "88pm80x-onkey",
- .of_compatible = "marvell,88pm80x-onkey",
- .num_resources = 1,
- .resources = &onkey_resources[0],
- .id = -1,
- },
+ .name = "88pm80x-onkey",
+ .of_compatible = "marvell,88pm80x-onkey",
+ .num_resources = 1,
+ .resources = &onkey_resources[0],
+ .id = -1,
+ },
};
static const struct mfd_cell regulator_devs[] = {
{
- .name = "88pm80x-regulator",
- .of_compatible = "marvell,88pm80x-regulator",
- .id = -1,
+ .name = "88pm80x-regulator",
+ .of_compatible = "marvell,88pm80x-regulator",
+ .id = -1,
},
};
@@ -323,8 +323,8 @@ out:
static int device_onkey_init(struct pm80x_chip *chip)
{
return mfd_add_devices(chip->dev, 0, &onkey_devs[0],
- ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0,
- NULL);
+ ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0,
+ NULL);
}
static int device_rtc_init(struct pm80x_chip *chip)
@@ -335,13 +335,13 @@ static int device_rtc_init(struct pm80x_chip *chip)
rtc_devs[0].pdata_size = pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0;
return mfd_add_devices(chip->dev, 0, &rtc_devs[0],
- ARRAY_SIZE(rtc_devs), NULL, 0, NULL);
+ ARRAY_SIZE(rtc_devs), NULL, 0, NULL);
}
static int device_regulator_init(struct pm80x_chip *chip)
{
return mfd_add_devices(chip->dev, 0, ®ulator_devs[0],
- ARRAY_SIZE(regulator_devs), NULL, 0, NULL);
+ ARRAY_SIZE(regulator_devs), NULL, 0, NULL);
}
static int device_irq_init_800(struct pm80x_chip *chip)
@@ -358,11 +358,10 @@ static int device_irq_init_800(struct pm80x_chip *chip)
/*
* irq_clr_on_wr defines the way of clearing interrupt by
- * read/write(0/1). It's read-clear by default.
+ * read/write(0/1). It's read-clear by default.
*/
- mask =
- PM800_WAKEUP2_INV_INT | PM800_WAKEUP2_INT_CLEAR |
- PM800_WAKEUP2_INT_MASK;
+ mask = PM800_WAKEUP2_INV_INT | PM800_WAKEUP2_INT_CLEAR |
+ PM800_WAKEUP2_INT_MASK;
irq_clr_mode = pdata->irq_clr_method == PM800_IRQ_CLR_ON_WRITE ?
PM800_WAKEUP2_INT_WRITE_CLEAR : PM800_WAKEUP2_INT_READ_CLEAR;
@@ -371,9 +370,8 @@ static int device_irq_init_800(struct pm80x_chip *chip)
if (ret < 0)
goto out;
- ret =
- regmap_add_irq_chip(chip->regmap, chip->irq, flags, -1,
- chip->regmap_irq_chip, &chip->irq_data);
+ ret = regmap_add_irq_chip(chip->regmap, chip->irq, flags, -1,
+ chip->regmap_irq_chip, &chip->irq_data);
out:
return ret;
@@ -409,18 +407,18 @@ static int pm800_pages_init(struct pm80x_chip *chip)
/* PM800 block power page */
subchip->power_page = i2c_new_dummy(client->adapter,
- subchip->power_page_addr);
+ subchip->power_page_addr);
if (subchip->power_page == NULL) {
ret = -ENODEV;
goto out;
}
subchip->regmap_power = devm_regmap_init_i2c(subchip->power_page,
- &pm80x_regmap_config);
+ &pm80x_regmap_config);
if (IS_ERR(subchip->regmap_power)) {
ret = PTR_ERR(subchip->regmap_power);
dev_err(chip->dev,
- "Failed to allocate regmap_power: %d\n", ret);
+ "Failed to allocate regmap_power: %d\n", ret);
goto out;
}
@@ -428,18 +426,18 @@ static int pm800_pages_init(struct pm80x_chip *chip)
/* PM800 block GPADC */
subchip->gpadc_page = i2c_new_dummy(client->adapter,
- subchip->gpadc_page_addr);
+ subchip->gpadc_page_addr);
if (subchip->gpadc_page == NULL) {
ret = -ENODEV;
goto out;
}
subchip->regmap_gpadc = devm_regmap_init_i2c(subchip->gpadc_page,
- &pm80x_regmap_config);
+ &pm80x_regmap_config);
if (IS_ERR(subchip->regmap_gpadc)) {
ret = PTR_ERR(subchip->regmap_gpadc);
dev_err(chip->dev,
- "Failed to allocate regmap_gpadc: %d\n", ret);
+ "Failed to allocate regmap_gpadc: %d\n", ret);
goto out;
}
i2c_set_clientdata(subchip->gpadc_page, chip);
@@ -620,8 +618,7 @@ static int pm800_probe(struct i2c_client *client,
chip = i2c_get_clientdata(client);
/* init subchip for PM800 */
- subchip =
- devm_kzalloc(&client->dev, sizeof(struct pm80x_subchip),
+ subchip = devm_kzalloc(&client->dev, sizeof(struct pm80x_subchip),
GFP_KERNEL);
if (!subchip) {
ret = -ENOMEM;
@@ -684,7 +681,7 @@ static struct i2c_driver pm800_driver = {
.owner = THIS_MODULE,
.pm = &pm80x_pm_ops,
.of_match_table = pm80x_of_match_table,
- },
+ },
.probe = pm800_probe,
.remove = pm800_remove,
.id_table = pm80x_id_table,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2015-08-25 10:10 +0200 |
| Subject | Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue |
| Message-ID | <q1hsR-Dz-1@gated-at.bofh.it> |
| In reply to | #1212428 |
On Tue, 25 Aug 2015, Vaibhav Hiremath wrote:
> Driver had coding style issues where spaces were used instead
> of tabs. This patch fixes them all.
>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> drivers/mfd/88pm800.c | 125 ++++++++++++++++++++++++--------------------------
> 1 file changed, 61 insertions(+), 64 deletions(-)
Same comment as before.
How similar is this file to the other one?
Can you reduce the size by having shared register defines?
> diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
> index f104a32..c4e097d 100644
> --- a/drivers/mfd/88pm800.c
> +++ b/drivers/mfd/88pm800.c
> @@ -30,55 +30,55 @@
> #include <linux/of_device.h>
>
> /* Interrupt Registers */
> -#define PM800_INT_STATUS1 (0x05)
> +#define PM800_INT_STATUS1 0x05
> #define PM800_ONKEY_INT_STS1 (1 << 0)
> #define PM800_EXTON_INT_STS1 (1 << 1)
> -#define PM800_CHG_INT_STS1 (1 << 2)
> -#define PM800_BAT_INT_STS1 (1 << 3)
> -#define PM800_RTC_INT_STS1 (1 << 4)
> +#define PM800_CHG_INT_STS1 (1 << 2)
> +#define PM800_BAT_INT_STS1 (1 << 3)
> +#define PM800_RTC_INT_STS1 (1 << 4)
> #define PM800_CLASSD_OC_INT_STS1 (1 << 5)
>
> -#define PM800_INT_STATUS2 (0x06)
> +#define PM800_INT_STATUS2 0x06
> #define PM800_VBAT_INT_STS2 (1 << 0)
> #define PM800_VSYS_INT_STS2 (1 << 1)
> #define PM800_VCHG_INT_STS2 (1 << 2)
> #define PM800_TINT_INT_STS2 (1 << 3)
> -#define PM800_GPADC0_INT_STS2 (1 << 4)
> +#define PM800_GPADC0_INT_STS2 (1 << 4)
> #define PM800_TBAT_INT_STS2 (1 << 5)
> -#define PM800_GPADC2_INT_STS2 (1 << 6)
> -#define PM800_GPADC3_INT_STS2 (1 << 7)
> +#define PM800_GPADC2_INT_STS2 (1 << 6)
> +#define PM800_GPADC3_INT_STS2 (1 << 7)
>
> -#define PM800_INT_STATUS3 (0x07)
> +#define PM800_INT_STATUS3 0x07
>
> -#define PM800_INT_STATUS4 (0x08)
> +#define PM800_INT_STATUS4 0x08
> #define PM800_GPIO0_INT_STS4 (1 << 0)
> #define PM800_GPIO1_INT_STS4 (1 << 1)
> #define PM800_GPIO2_INT_STS4 (1 << 2)
> #define PM800_GPIO3_INT_STS4 (1 << 3)
> #define PM800_GPIO4_INT_STS4 (1 << 4)
>
> -#define PM800_INT_ENA_1 (0x09)
> +#define PM800_INT_ENA_1 0x09
> #define PM800_ONKEY_INT_ENA1 (1 << 0)
> #define PM800_EXTON_INT_ENA1 (1 << 1)
> -#define PM800_CHG_INT_ENA1 (1 << 2)
> -#define PM800_BAT_INT_ENA1 (1 << 3)
> -#define PM800_RTC_INT_ENA1 (1 << 4)
> +#define PM800_CHG_INT_ENA1 (1 << 2)
> +#define PM800_BAT_INT_ENA1 (1 << 3)
> +#define PM800_RTC_INT_ENA1 (1 << 4)
> #define PM800_CLASSD_OC_INT_ENA1 (1 << 5)
>
> -#define PM800_INT_ENA_2 (0x0A)
> +#define PM800_INT_ENA_2 0x0A
> #define PM800_VBAT_INT_ENA2 (1 << 0)
> #define PM800_VSYS_INT_ENA2 (1 << 1)
> #define PM800_VCHG_INT_ENA2 (1 << 2)
> #define PM800_TINT_INT_ENA2 (1 << 3)
>
> -#define PM800_INT_ENA_3 (0x0B)
> +#define PM800_INT_ENA_3 0x0B
> #define PM800_GPADC0_INT_ENA3 (1 << 0)
> #define PM800_GPADC1_INT_ENA3 (1 << 1)
> #define PM800_GPADC2_INT_ENA3 (1 << 2)
> #define PM800_GPADC3_INT_ENA3 (1 << 3)
> #define PM800_GPADC4_INT_ENA3 (1 << 4)
>
> -#define PM800_INT_ENA_4 (0x0C)
> +#define PM800_INT_ENA_4 0x0C
> #define PM800_GPIO0_INT_ENA4 (1 << 0)
> #define PM800_GPIO1_INT_ENA4 (1 << 1)
> #define PM800_GPIO2_INT_ENA4 (1 << 2)
> @@ -86,7 +86,7 @@
> #define PM800_GPIO4_INT_ENA4 (1 << 4)
>
> /* number of INT_ENA & INT_STATUS regs */
> -#define PM800_INT_REG_NUM (4)
> +#define PM800_INT_REG_NUM 4
>
> /* Interrupt Number in 88PM800 */
> enum {
> @@ -114,7 +114,7 @@ enum {
> };
>
> /* PM800: generation identification number */
> -#define PM800_CHIP_GEN_ID_NUM 0x3
> +#define PM800_CHIP_GEN_ID_NUM 0x3
>
> static const struct i2c_device_id pm80x_id_table[] = {
> {"88PM800", 0},
> @@ -129,47 +129,47 @@ static const struct of_device_id pm80x_of_match_table[] = {
>
> static struct resource rtc_resources[] = {
> {
> - .name = "88pm80x-rtc",
> - .start = PM800_IRQ_RTC,
> - .end = PM800_IRQ_RTC,
> - .flags = IORESOURCE_IRQ,
> - },
> + .name = "88pm80x-rtc",
> + .start = PM800_IRQ_RTC,
> + .end = PM800_IRQ_RTC,
> + .flags = IORESOURCE_IRQ,
> + },
> };
>
> static struct mfd_cell rtc_devs[] = {
> {
> - .name = "88pm80x-rtc",
> - .of_compatible = "marvell,88pm80x-rtc",
> - .num_resources = ARRAY_SIZE(rtc_resources),
> - .resources = &rtc_resources[0],
> - .id = -1,
> - },
> + .name = "88pm80x-rtc",
> + .of_compatible = "marvell,88pm80x-rtc",
> + .num_resources = ARRAY_SIZE(rtc_resources),
> + .resources = &rtc_resources[0],
> + .id = -1,
> + },
> };
>
> static struct resource onkey_resources[] = {
> {
> - .name = "88pm80x-onkey",
> - .start = PM800_IRQ_ONKEY,
> - .end = PM800_IRQ_ONKEY,
> - .flags = IORESOURCE_IRQ,
> - },
> + .name = "88pm80x-onkey",
> + .start = PM800_IRQ_ONKEY,
> + .end = PM800_IRQ_ONKEY,
> + .flags = IORESOURCE_IRQ,
> + },
> };
>
> static const struct mfd_cell onkey_devs[] = {
> {
> - .name = "88pm80x-onkey",
> - .of_compatible = "marvell,88pm80x-onkey",
> - .num_resources = 1,
> - .resources = &onkey_resources[0],
> - .id = -1,
> - },
> + .name = "88pm80x-onkey",
> + .of_compatible = "marvell,88pm80x-onkey",
> + .num_resources = 1,
> + .resources = &onkey_resources[0],
> + .id = -1,
> + },
> };
>
> static const struct mfd_cell regulator_devs[] = {
> {
> - .name = "88pm80x-regulator",
> - .of_compatible = "marvell,88pm80x-regulator",
> - .id = -1,
> + .name = "88pm80x-regulator",
> + .of_compatible = "marvell,88pm80x-regulator",
> + .id = -1,
> },
> };
>
> @@ -323,8 +323,8 @@ out:
> static int device_onkey_init(struct pm80x_chip *chip)
> {
> return mfd_add_devices(chip->dev, 0, &onkey_devs[0],
> - ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0,
> - NULL);
> + ARRAY_SIZE(onkey_devs), &onkey_resources[0], 0,
> + NULL);
> }
>
> static int device_rtc_init(struct pm80x_chip *chip)
> @@ -335,13 +335,13 @@ static int device_rtc_init(struct pm80x_chip *chip)
> rtc_devs[0].pdata_size = pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0;
>
> return mfd_add_devices(chip->dev, 0, &rtc_devs[0],
> - ARRAY_SIZE(rtc_devs), NULL, 0, NULL);
> + ARRAY_SIZE(rtc_devs), NULL, 0, NULL);
> }
>
> static int device_regulator_init(struct pm80x_chip *chip)
> {
> return mfd_add_devices(chip->dev, 0, ®ulator_devs[0],
> - ARRAY_SIZE(regulator_devs), NULL, 0, NULL);
> + ARRAY_SIZE(regulator_devs), NULL, 0, NULL);
> }
>
> static int device_irq_init_800(struct pm80x_chip *chip)
> @@ -358,11 +358,10 @@ static int device_irq_init_800(struct pm80x_chip *chip)
>
> /*
> * irq_clr_on_wr defines the way of clearing interrupt by
> - * read/write(0/1). It's read-clear by default.
> + * read/write(0/1). It's read-clear by default.
> */
> - mask =
> - PM800_WAKEUP2_INV_INT | PM800_WAKEUP2_INT_CLEAR |
> - PM800_WAKEUP2_INT_MASK;
> + mask = PM800_WAKEUP2_INV_INT | PM800_WAKEUP2_INT_CLEAR |
> + PM800_WAKEUP2_INT_MASK;
>
> irq_clr_mode = pdata->irq_clr_method == PM800_IRQ_CLR_ON_WRITE ?
> PM800_WAKEUP2_INT_WRITE_CLEAR : PM800_WAKEUP2_INT_READ_CLEAR;
> @@ -371,9 +370,8 @@ static int device_irq_init_800(struct pm80x_chip *chip)
> if (ret < 0)
> goto out;
>
> - ret =
> - regmap_add_irq_chip(chip->regmap, chip->irq, flags, -1,
> - chip->regmap_irq_chip, &chip->irq_data);
> + ret = regmap_add_irq_chip(chip->regmap, chip->irq, flags, -1,
> + chip->regmap_irq_chip, &chip->irq_data);
>
> out:
> return ret;
> @@ -409,18 +407,18 @@ static int pm800_pages_init(struct pm80x_chip *chip)
>
> /* PM800 block power page */
> subchip->power_page = i2c_new_dummy(client->adapter,
> - subchip->power_page_addr);
> + subchip->power_page_addr);
> if (subchip->power_page == NULL) {
> ret = -ENODEV;
> goto out;
> }
>
> subchip->regmap_power = devm_regmap_init_i2c(subchip->power_page,
> - &pm80x_regmap_config);
> + &pm80x_regmap_config);
> if (IS_ERR(subchip->regmap_power)) {
> ret = PTR_ERR(subchip->regmap_power);
> dev_err(chip->dev,
> - "Failed to allocate regmap_power: %d\n", ret);
> + "Failed to allocate regmap_power: %d\n", ret);
> goto out;
> }
>
> @@ -428,18 +426,18 @@ static int pm800_pages_init(struct pm80x_chip *chip)
>
> /* PM800 block GPADC */
> subchip->gpadc_page = i2c_new_dummy(client->adapter,
> - subchip->gpadc_page_addr);
> + subchip->gpadc_page_addr);
> if (subchip->gpadc_page == NULL) {
> ret = -ENODEV;
> goto out;
> }
>
> subchip->regmap_gpadc = devm_regmap_init_i2c(subchip->gpadc_page,
> - &pm80x_regmap_config);
> + &pm80x_regmap_config);
> if (IS_ERR(subchip->regmap_gpadc)) {
> ret = PTR_ERR(subchip->regmap_gpadc);
> dev_err(chip->dev,
> - "Failed to allocate regmap_gpadc: %d\n", ret);
> + "Failed to allocate regmap_gpadc: %d\n", ret);
> goto out;
> }
> i2c_set_clientdata(subchip->gpadc_page, chip);
> @@ -620,8 +618,7 @@ static int pm800_probe(struct i2c_client *client,
> chip = i2c_get_clientdata(client);
>
> /* init subchip for PM800 */
> - subchip =
> - devm_kzalloc(&client->dev, sizeof(struct pm80x_subchip),
> + subchip = devm_kzalloc(&client->dev, sizeof(struct pm80x_subchip),
> GFP_KERNEL);
> if (!subchip) {
> ret = -ENOMEM;
> @@ -684,7 +681,7 @@ static struct i2c_driver pm800_driver = {
> .owner = THIS_MODULE,
> .pm = &pm80x_pm_ops,
> .of_match_table = pm80x_of_match_table,
> - },
> + },
> .probe = pm800_probe,
> .remove = pm800_remove,
> .id_table = pm80x_id_table,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-25 11:00 +0200 |
| Subject | Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue |
| Message-ID | <q1ifh-1xW-9@gated-at.bofh.it> |
| In reply to | #1212784 |
On Tuesday 25 August 2015 01:22 PM, Lee Jones wrote: > On Tue, 25 Aug 2015, Vaibhav Hiremath wrote: > >> Driver had coding style issues where spaces were used instead >> of tabs. This patch fixes them all. >> >> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> >> --- >> drivers/mfd/88pm800.c | 125 ++++++++++++++++++++++++-------------------------- >> 1 file changed, 61 insertions(+), 64 deletions(-) > > Same comment as before. > > How similar is this file to the other one? I believe you are referring to include/linux/mfd/88pm80x.h > > Can you reduce the size by having shared register defines? > Not sure whether I understand your comment here, They are common defines. PM860 only defines are named as PM860_XXXX Similarly, PM805 only defines are named as PM805_XXXX and PM800_xxx should be common. Thanks, Vaibhav -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2015-08-25 12:40 +0200 |
| Subject | Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue |
| Message-ID | <q1jO2-3RS-5@gated-at.bofh.it> |
| In reply to | #1212853 |
On Tue, 25 Aug 2015, Vaibhav Hiremath wrote: > > > On Tuesday 25 August 2015 01:22 PM, Lee Jones wrote: > >On Tue, 25 Aug 2015, Vaibhav Hiremath wrote: > > > >>Driver had coding style issues where spaces were used instead > >>of tabs. This patch fixes them all. > >> > >>Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> > >>--- > >> drivers/mfd/88pm800.c | 125 ++++++++++++++++++++++++-------------------------- > >> 1 file changed, 61 insertions(+), 64 deletions(-) > > > >Same comment as before. > > > >How similar is this file to the other one? > > I believe you are referring to include/linux/mfd/88pm80x.h > > > > >Can you reduce the size by having shared register defines? > > > > Not sure whether I understand your comment here, > They are common defines. I guess the question was a little convoluted. How about; why are the extra defines in the driver? Why aren't all of them in the header file? What is the difference between the defines in the C file compared with the ones defined in the header? -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-25 13:00 +0200 |
| Subject | Re: [PATCH-v2 1/5] mfd: 88pm800: Fix tabbing issue |
| Message-ID | <q1k7o-4eG-21@gated-at.bofh.it> |
| In reply to | #1212941 |
On Tuesday 25 August 2015 04:05 PM, Lee Jones wrote: > On Tue, 25 Aug 2015, Vaibhav Hiremath wrote: > >> >> >> On Tuesday 25 August 2015 01:22 PM, Lee Jones wrote: >>> On Tue, 25 Aug 2015, Vaibhav Hiremath wrote: >>> >>>> Driver had coding style issues where spaces were used instead >>>> of tabs. This patch fixes them all. >>>> >>>> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> >>>> --- >>>> drivers/mfd/88pm800.c | 125 ++++++++++++++++++++++++-------------------------- >>>> 1 file changed, 61 insertions(+), 64 deletions(-) >>> >>> Same comment as before. >>> >>> How similar is this file to the other one? >> >> I believe you are referring to include/linux/mfd/88pm80x.h >> >>> >>> Can you reduce the size by having shared register defines? >>> >> >> Not sure whether I understand your comment here, >> They are common defines. > > I guess the question was a little convoluted. > > How about; why are the extra defines in the driver? Why aren't all of > them in the header file? What is the difference between the defines > in the C file compared with the ones defined in the header? > I do not see any difference and need of having defines separately in C file. That's the cleanup I was referring to in another email. I will walk through the whole driver code and try to cleanup all such coding related issues. Probably expect separate series here. Thanks, Vaibhav -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-24 21:00 +0200 |
| Subject | [PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros |
| Message-ID | <q158n-7Qs-27@gated-at.bofh.it> |
| In reply to | #1212427 |
Update header file with required macros for 32KHz buffered clock
output of 88PM800 family of device.
These macros will be used in clk provider driver.
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
include/linux/mfd/88pm80x.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index 122cfd2..0215d5f 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -91,6 +91,7 @@ enum {
/* Referance and low power registers */
#define PM800_LOW_POWER1 (0x20)
#define PM800_LOW_POWER2 (0x21)
+#define PM800_LOW_POWER2_XO_LJ_EN BIT(5)
#define PM800_LOW_POWER_CONFIG3 (0x22)
#define PM800_LDOBK_FREEZE BIT(7)
@@ -138,6 +139,13 @@ enum {
#define PM800_ALARM BIT(5)
#define PM800_RTC1_USE_XO BIT(7)
+#define PM800_32K_OUTX_SEL_MASK 0x3
+/* 32KHz clk output sel mode */
+#define PM800_32K_OUTX_SEL_ZERO 0x0
+#define PM800_32K_OUTX_SEL_INT_32KHZ 0x1
+#define PM800_32K_OUTX_SEL_XO_32KHZ 0x2
+#define PM800_32K_OUTX_SEL_HIZ 0x3
+
/* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */
/* buck registers */
@@ -208,6 +216,10 @@ enum {
#define PM800_PMOD_MEAS1 0x52
#define PM800_PMOD_MEAS2 0x53
+/* Oscillator control */
+#define PM800_OSC_CNTRL1 0x50
+#define PM800_OSC_CNTRL1_OSC_FREERUN_EN BIT(1)
+
#define PM800_GPADC0_MEAS1 0x54
#define PM800_GPADC0_MEAS2 0x55
#define PM800_GPADC1_MEAS1 0x56
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2015-08-25 10:20 +0200 |
| Subject | Re: [PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros |
| Message-ID | <q1hCz-P0-47@gated-at.bofh.it> |
| In reply to | #1212430 |
On Tue, 25 Aug 2015, Vaibhav Hiremath wrote:
> Update header file with required macros for 32KHz buffered clock
> output of 88PM800 family of device.
> These macros will be used in clk provider driver.
>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> include/linux/mfd/88pm80x.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
> index 122cfd2..0215d5f 100644
> --- a/include/linux/mfd/88pm80x.h
> +++ b/include/linux/mfd/88pm80x.h
> @@ -91,6 +91,7 @@ enum {
> /* Referance and low power registers */
> #define PM800_LOW_POWER1 (0x20)
> #define PM800_LOW_POWER2 (0x21)
> +#define PM800_LOW_POWER2_XO_LJ_EN BIT(5)
Some people add an extra space for register bits, which I quite like.
So:
#define SOME_REGISTER_ADDRESS 0x123
#define SOME_BIT_VALUE BIT(4)
Feel free to use it, or not.
> #define PM800_LOW_POWER_CONFIG3 (0x22)
> #define PM800_LDOBK_FREEZE BIT(7)
> @@ -138,6 +139,13 @@ enum {
> #define PM800_ALARM BIT(5)
> #define PM800_RTC1_USE_XO BIT(7)
>
> +#define PM800_32K_OUTX_SEL_MASK 0x3
> +/* 32KHz clk output sel mode */
> +#define PM800_32K_OUTX_SEL_ZERO 0x0
> +#define PM800_32K_OUTX_SEL_INT_32KHZ 0x1
> +#define PM800_32K_OUTX_SEL_XO_32KHZ 0x2
> +#define PM800_32K_OUTX_SEL_HIZ 0x3
> +
> /* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */
>
> /* buck registers */
> @@ -208,6 +216,10 @@ enum {
> #define PM800_PMOD_MEAS1 0x52
> #define PM800_PMOD_MEAS2 0x53
>
> +/* Oscillator control */
> +#define PM800_OSC_CNTRL1 0x50
> +#define PM800_OSC_CNTRL1_OSC_FREERUN_EN BIT(1)
0x50 goes before 0x52 (and 0x51 if it's there).
> #define PM800_GPADC0_MEAS1 0x54
> #define PM800_GPADC0_MEAS2 0x55
> #define PM800_GPADC1_MEAS1 0x56
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> |
|---|---|
| Date | 2015-08-25 10:50 +0200 |
| Subject | Re: [PATCH-v2 2/5] mfd: 88pm800: Update the header file with 32K clk related macros |
| Message-ID | <q1i5B-1mK-21@gated-at.bofh.it> |
| In reply to | #1212806 |
On Tuesday 25 August 2015 01:25 PM, Lee Jones wrote:
> On Tue, 25 Aug 2015, Vaibhav Hiremath wrote:
>
>> Update header file with required macros for 32KHz buffered clock
>> output of 88PM800 family of device.
>> These macros will be used in clk provider driver.
>>
>> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
>> ---
>> include/linux/mfd/88pm80x.h | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
>> index 122cfd2..0215d5f 100644
>> --- a/include/linux/mfd/88pm80x.h
>> +++ b/include/linux/mfd/88pm80x.h
>> @@ -91,6 +91,7 @@ enum {
>> /* Referance and low power registers */
>> #define PM800_LOW_POWER1 (0x20)
>> #define PM800_LOW_POWER2 (0x21)
>> +#define PM800_LOW_POWER2_XO_LJ_EN BIT(5)
>
> Some people add an extra space for register bits, which I quite like.
>
> So:
>
> #define SOME_REGISTER_ADDRESS 0x123
> #define SOME_BIT_VALUE BIT(4)
>
> Feel free to use it, or not.
>
>> #define PM800_LOW_POWER_CONFIG3 (0x22)
>> #define PM800_LDOBK_FREEZE BIT(7)
>> @@ -138,6 +139,13 @@ enum {
>> #define PM800_ALARM BIT(5)
>> #define PM800_RTC1_USE_XO BIT(7)
>>
>> +#define PM800_32K_OUTX_SEL_MASK 0x3
>> +/* 32KHz clk output sel mode */
>> +#define PM800_32K_OUTX_SEL_ZERO 0x0
>> +#define PM800_32K_OUTX_SEL_INT_32KHZ 0x1
>> +#define PM800_32K_OUTX_SEL_XO_32KHZ 0x2
>> +#define PM800_32K_OUTX_SEL_HIZ 0x3
>> +
>> /* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */
>>
>> /* buck registers */
>> @@ -208,6 +216,10 @@ enum {
>> #define PM800_PMOD_MEAS1 0x52
>> #define PM800_PMOD_MEAS2 0x53
>>
>> +/* Oscillator control */
>> +#define PM800_OSC_CNTRL1 0x50
>> +#define PM800_OSC_CNTRL1_OSC_FREERUN_EN BIT(1)
>
> 0x50 goes before 0x52 (and 0x51 if it's there).
Will reorder in next version.
Thanks,
Vaibhav
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web