aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/tps65217.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-10-13mfd: tps65217: Introduce dependency on CONFIG_OFKeerthy1-6/+0
Currently the driver boots only via device tree hence add a dependency on CONFIG_OF. This leaves with a bunch of unused code so clean that up. This patch also makes use of probe_new function in place of the probe function so as to avoid passing i2c_device_id. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-12-19Merge tag 'mfd-for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfdLinus Torvalds1-1/+3
Pull MFD updates from Lee Jones: "New Device Support - Add support for Ricoh RC5T619 PMIC to rn5t618 - Add support for PM8821 PMIC to qcom-pm8xxx New Functionality: - Add support for GPIO to lpc_ich - Add support for GPADC to sun4i - Add ability for rk808 to shutdown Fix-ups: - Simplify/strip unnecessary code; tps65218, palmas, tps65217 - Device Tree binding updates; tps65218, altera-a10sr - Provide/export device ID info; tps65218, axp20x-i2c, hi655x-pmic, fsl-imx25-tsadc, intel_soc_pmic_bxtwc - Use MFD API instead of of_platform_populate(); tps65218 - Generalise name-space; pm8xxx - Supply/edit regmap configuration; axp20x, cs47l24-tables, axp20x - Enable compile testing; max77620, max77686, exynos-lpass, abx500-core - Coding style issues; wm8994-core, wm5102-tables - Supply endian support; syscon - Remove module support; ab3100-core, ab8500-debugfs, ab8500-gpadc, abx500-core Bug Fixes: - Fix ordering issues; wm8994 - Fix dependencies (build-time/run-time); exynos_lpass, sun4i-gpadc - Fix compiler warnings; sun4i-gpadc - Fix leaks; mfd-core - Fix page fault during module unload; tps65217" * tag 'mfd-for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits) mfd: tps65217: Support an interrupt pin as the system wakeup mfd: tps65217: Make an interrupt handler simpler mfd: tps65217: Update register interrupt mask bits instead of writing operation mfd: tps65217: Specify the IRQ name mfd: tps65217: Fix page fault on unloading modules mfd: palmas: Remove redundant check in palmas_power_off mfd: arizona: Disable IRQs during driver remove mfd: pm8xxx: add support to pm8821 mfd: intel-lpss: Try to enable Memory-Write-Invalidate mfd: rn5t618: Add Ricoh RC5T619 PMIC support mfd: axp20x: Add address extension registers for AXP806 regmap mfd: intel_soc_pmic_bxtwc: Fix a typo in MODULE_DEVICE_TABLE() mfd: core: Fix device reference leak in mfd_clone_cell mfd: bcm590xx: Simplify a test mfd: sun4i-gpadc: Select regmap-irq mfd: abx500-core: drop unused MODULE_ tags from non-modular code mfd: ab8500: make sysctrl explicitly non-modular mfd: ab8500-gpadc: Make it explicitly non-modular mfd: ab8500-debugfs: Make it explicitly non-modular mfd: ab8500-core: Make it explicitly non-modular ...
2016-11-29mfd: tps65217: Make an interrupt handler simplerMilo Kim1-0/+1
Rework the IRQ handler by using HW IRQ number and status bit. Each HW IRQ number is matched with TPS65217 register layout[*]. (USB IRQ number is 0, AC is 1, Push button is 2) When an interrupt is enabled, mask bit should be cleared (unmasked). If an interrupt is disabled, then mask bit should be set (masked). This mask value is updated into the TPS65217 register in irq_sync_unlock(). Mask bit and interrupt status bit can be handled with HW IRQ number. Eventually, additional IRQ data, 'tps65217_irqs[]' and the function, 'irq_to_tps65217_irq()' are not necessary. [*] TPS65217 interrupt register layout Bit7 6 5 4 3 2 1 0 ---------------------------------------------- | x | PBM | ACM | USBM | x | PBI | ACI | USBI PBM: Push button status change interrupt mask ACM: AC interrupt mask USBM: USB power status change interrupt mask PBI: Push button status change interrupt ACI: AC power status change interrupt USBI: USB power status change interrupt x: Not used Signed-off-by: Milo Kim <woogyom.kim@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-29mfd: tps65217: Update register interrupt mask bits instead of writing operationMilo Kim1-1/+2
TPS65217 interrupt register includes read/writeable mask bits with read-only status bits. (bit 4, 5, 6 are R/W, bit 0, 1, 2 are RO) And reserved bit is not required. Register update operation is preferred for disabling all interrupts during the device initialisation. Signed-off-by: Milo Kim <woogyom.kim@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-11-09mfd: tps65217: Fix mismatched interrupt numberMilo Kim1-6/+5
Enum value of 'tps65217_irq_type' is not matched with DT parsed hwirq number[*]. The MFD driver gets the IRQ data by referencing hwirq, but the value is different. So, irq_to_tps65217_irq() returns mismatched IRQ data. Eventually, the power button driver enables not PB but USB interrupt when it is probed. According to the TPS65217 register map[**], USB interrupt is the LSB. This patch defines synchronized IRQ value. [*] include/dt-bindings/mfd/tps65217.h [**] http://www.ti.com/lit/ds/symlink/tps65217.pdf Signed-off-by: Milo Kim <woogyom.kim@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2016-10-04mfd: tps65217: Add support for IRQsMarcin Niestroj1-0/+12
Add support for handling IRQs: power button, AC and USB power state changes. Mask and interrupt bits are shared within one register, which prevents us to use regmap_irq implementation. New irq_domain is created in order to add interrupt handling for each tps65217's subsystem. IRQ resources have been added for charger subsystem to be able to notify about AC and USB state changes. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-06-27regulator: tps65217: Enable suspend configurationRuss Dill1-0/+1
The TPS65217 has a pre-defined power-up / power-down sequence which in a typical application does not need to be changed. However, it is possible to define custom sequences under I2C control. The power-up sequence is defined by strobes and delay times. Each output rail is assigned to a strobe to determine the order in which the rails are enabled. Every regulator of tps65217 PMIC has sequence registers and every regulator has a default strobe value and gets disabled when a particular power down sequence occurs. To keep a regulator on during suspend we write value 0 to strobe so that the regulator is out of all sequencers and is not impacted by any power down sequence. Hence saving the default strobe value during probe so that when we want to regulator to be enabled during suspend we write 0 to strobe and when we want it to get disabled during suspend we write the default saved strobe value. This allows platform data to specify which power rails should be on or off during RTC only suspend. This is necessary to keep DDR state while in RTC only suspend. Signed-off-by: Russ Dill <Russ.Dill@ti.com> [Enhanced commit log and added dynamic allocation for strobes] Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26mfd: tps65217: Tell regmap what registers are validMark Brown1-0/+2
Allow regmap to provide debugfs access to the register map by telling it what registers are valid. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-04-18regulator: tps65217: Remove *rdev[] from struct tps65217Axel Lin1-1/+0
Now this driver uses devm_regulator_register() so we don't need to save rdev pointer to tps->rdev[i] for cleanup. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-19mfd: tps65217: Naturalise cross-architecture discrepanciesLee Jones1-2/+2
If we compile the TPS65217 for a 64bit architecture we receive the following warnings: drivers/mfd/tps65217.c: In function ‘tps65217_probe’: drivers/mfd/tps65217.c:173:13: warning: cast from pointer to integer of different size chip_id = (unsigned int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-08-30regulator: tps65217: Convert to use linear rangesAxel Lin1-19/+0
Below is the equation in original code: tps65217_uv1_ranges: 0 ... 24: uV = vsel * 25000 + 900000; 25 ... 52: uV = (vsel - 24) * 50000 + 1500000; = (vsel - 25) * 50000 + 1550000; 53 ... 55: uV = (vsel - 52) * 100000 + 2900000; = (vsel - 53) * 100000 + 3000000; 56 ... 62: uV = 3300000; tps65217_uv2_ranges: 0 ... 8: uV = vsel * 50000 + 1500000; 9 ... 13: uV = (vsel - 8) * 100000 + 1900000; = (vsel - 9) * 100000 + 2000000; 14 ... 31: uV = (vsel - 13) * 50000 + 2400000; = (vsel - 14) * 50000 + 2450000; The voltage tables are composed of linear ranges. This patch converts this driver to use multiple linear ranges APIs. In original code, voltage range for DCDC1 is 900000 ~ 1800000 and voltage range for DCDC3 is 900000 ~ 1500000. This patch separates the range 25~52 in tps65217_uv1_ranges table to two linear ranges: 25~30 and 31~52. This change makes it possible to reuse the same linear_ranges table for DCDCx. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-04-29drivers/video/backlight/tps65217_bl.c add default brightness value optionMatus Ujhelyi1-0/+1
Signed-off-by: Matus Ujhelyi <matus.ujhelyi@streamunlimited.com> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-09-25backlight: Add TPS65217 WLED driverMatthias Kaehlcke1-0/+18
The TPS65217 chip contains a boost converter and current sinks which can be used to drive LEDs for use as backlights. Expose this functionality via the backlight API. Tested on an AM335x based custom board with a single WLED string, using different values for ISEL and FDIM (though it would be hard to tell the difference except for the value in WLEDCTRL1). Both instantiation through the device tree and by passing platform data have been tested. Testing has been done with an Androidized 3.2 kernel from the rowboat project. Koen Kooi reported the driver to be working on a Beaglebone board with LCD3 cape Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-08-22mfd: Move tps65217 regulator plat data handling to regulatorAnilKumar Ch1-3/+9
Regulator platform data handling was mistakenly added to MFD driver. So we will see build errors if we compile MFD drivers without CONFIG_REGULATOR. This patch moves regulator platform data handling from TPS65217 MFD driver to regulator driver. This makes MFD driver independent of REGULATOR framework so build error is fixed if CONFIG_REGULATOR is not set. drivers/built-in.o: In function `tps65217_probe': tps65217.c:(.devinit.text+0x13e37): undefined reference to `of_regulator_match' This patch also fix allocation size of tps65217 platform data. Current implementation allocates a struct tps65217_board for each regulator specified in the device tree. But the structure itself provides array of regulators so one instance of it is sufficient. Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
2012-07-12regulator: tps65217: Add device tree supportAnilKumar Ch1-1/+2
This commit adds device tree support for tps65217 pmic. And usage details are added to device tree documentation. Driver is tested by using kernel module with regulator set and get APIs. Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-01regulator: tps65217: Convert LDO1 to use regulator_list_voltage_tableAxel Lin1-4/+0
Convert tps65217_pmic_ldo1_ops to use regulator_list_voltage_table. We have n_voltages and volt_table settings in regulator_desc, so we don't need the table and table_len fields in struct tps_info. Thus remove them from struct tps_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13regulator: tps65217: Convert to regulator_[is_enabled|get_voltage_sel]_regmapAxel Lin1-6/+0
This patch converts .is_enabled and .get_voltage_sel to regulator_is_enabled_regmap and regulator_get_voltage_sel_regmap. For .enable, .disable, and .set_voltage_sel, the write protect level is either 1 or 2. So we cannot use regulator_[enable|disable|set_voltage_sel]_regmap. Now we store the enable reg/mask and vsel reg/mask in regulator_desc, so we can remove enable_mask, set_vout_reg, and set_vout_mask from struct tps_info. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-06mfd: Add new mfd device for TPS65217AnilKumar Ch1-0/+283
The TPS65217 chip is a power management IC for Portable Navigation Systems and Tablet Computing devices. It contains the following components: - Regulators - White LED - USB battery charger This patch adds support for tps65217 mfd device. At this time only the regulator functionality is made available. Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>