Re: [PATCH v3 3/5] mfd: tps65912: Add driver for the TPS65912 PMIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/28/2015 11:01 AM, Grygorii Strashko wrote:
On 09/24/2015 09:52 AM, Andrew F. Davis wrote:
This patch adds support for TPS65912 mfd device. It provides
communication through the I2C and SPI interfaces. It contains
the following components:

   - Regulators
   - GPIO controller

Signed-off-by: Andrew F. Davis <afd@xxxxxx>
---
   drivers/mfd/Kconfig          |  24 +++
   drivers/mfd/Makefile         |   3 +
   drivers/mfd/tps65912-core.c  | 114 +++++++++++++
   drivers/mfd/tps65912-i2c.c   |  86 ++++++++++
   drivers/mfd/tps65912-spi.c   |  85 ++++++++++
   include/linux/mfd/tps65912.h | 393 +++++++++++++++++++++++++++++++++++++++++++
   6 files changed, 705 insertions(+)
   create mode 100644 drivers/mfd/tps65912-core.c
   create mode 100644 drivers/mfd/tps65912-i2c.c
   create mode 100644 drivers/mfd/tps65912-spi.c
   create mode 100644 include/linux/mfd/tps65912.h


[...]

+
+/*
+ * struct tps_info - packages regulator constraints
+ * @id: Id of the regulator
+ * @name: Voltage regulator name
+ * @min_uV: Minimum micro volts
+ * @max_uV: Minimum micro volts
+ *
+ * This data is used to check the regulator voltage limits while setting.
+ */
+struct tps_info {
+	int id;
+	const char *name;
+	int min_uV;
+	int max_uV;
+};

Could you move structure's definitions to the corresponding c-files
if they are used only locally in this files, pls?


ACK

+
+/*
+ * struct tps65912 - state holder for the tps65912 driver
+ *
+ * Device data may be used to access the TPS65912 chip
+ */
+struct tps65912 {
+	struct device *dev;
+	unsigned int id;
+
+	/* IRQ Data */
+	int irq;
+	struct regmap_irq_chip_data *irq_data;
+
+	struct regulator_desc desc[TPS65912_NUM_REGULATOR];
+	struct tps_info *info[TPS65912_NUM_REGULATOR];

seems above two field are not used (and id?).


The idea was for a someday use, but because I never did that I'll
remove them for now.

Thanks,
Andrew

+	struct regmap *regmap;
+};
+
+static const struct regmap_range tps65912_yes_ranges[] = {
+	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
+};
+
+static const struct regmap_access_table tps65912_volatile_table = {
+	.yes_ranges = tps65912_yes_ranges,
+	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
+};
+
+static const struct regmap_config tps65912_regmap_co	nfig = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.cache_type = REGCACHE_RBTREE,
+	.volatile_table = &tps65912_volatile_table,
+};
+
+int tps65912_device_init(struct tps65912 *tps);
+int tps65912_device_exit(struct tps65912 *tps);
+
+#endif /*  __LINUX_MFD_TPS65912_H */



--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux