| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I6d7b8d21f901cf0a139e978519b041c00f35e4a3
|
|
|
|
|
|
|
|
|
|
| |
Currently, we use the calibrated adc outputs - however,
these are off for tuna (especially for channel 2, breaking headset buttons).
This commit makes the gpadc conversions return the raw values,
which was the pre-gpadc behaviour.
Change-Id: I4ca17d5ce9edd6bd4a67663b6ea90ca05be1f37e
|
|\
| |
| |
| |
| | |
Conflicts:
arch/arm/include/asm/hardware/cache-l2x0.h
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
commit c6cc25fda58da8685ecef3f179adc7b99c8253b2 upstream.
The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is
cleared. So we need to make sure to restore it during resume if it was set
before suspend.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1)Removed request_irq() and replaced it with request_threaded_irq().
2)Removed generic_handle_irq() and replaced it with handle_nested_irq().
Handling these interrupts is nested, as we are handling an interrupt
(for e.g rtc,mmc1) when we are still servicing TWL irq.
Change-Id: I2eb46653a676ce8481fb934e02e8cc7e3e87df02
Signed-off-by: Naga Venkata Srikanth V <vnv.srikanth@samsung.com>
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Corrected misspelled "default" label in switch
statement.
Change-Id: I89bdd57310c9dab54d247e6ea5a848df1088c007
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After GPADC conversion is started, we wait for finish it with
a busy flag polling in twl6030_gpadc_wait_conversion_ready().
Actually the GPADC busy loop finishes immediately, but for the
worst case condition the sleep is added.
modified: drivers/mfd/twl6030-gpadc.c
Change-Id: If20a9bfe6943814bcce98e591fd876d66f986e44
Signed-off-by: x0169938 <vasyl.yushchyshen@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In case we want to use software gpadc conversion with sample type
TWL6030_GPADC_IRQ_ONESHOT, maximum one adc channel can be converted
at a time due to the hardware restrictions of the twl6032.
Change-Id: Iacc4a56eea7a06528513cbc93b2c40feef290ea7
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Lets gpacd module will be detect the twl6030 or twl6032 chip and
use appropriate software conversion method.
Change-Id: I2eac6e0b9e97b37e13cfa2bfbc9a0956fc68d1a9
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously was not possible to read the corrected and converted values
of the gpadc conversion in the call back function. Now pointer
to the twl6030_gpadc_request returned to the call back function
and we can read all adc channel values: raw without correction
and convertation, corrected and converted, raw values etc.
Change-Id: I4a3699952ddf9cacc4cca5e205b93e28502f291d
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds a possibility to read corrected and converted ADC
ch (command TWL6030_GPADC_IOCX_ADC_READ) to the ioctl.
Change-Id: Ia896bf9224a876083815aa5a0d172e08b77141cb
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Function twl6030_gpadc_ioctl returns calibrated and corrected adc ch
values instead raw code values (command TWL6030_GPADC_IOCX_ADC_RAW_READ).
This patch fixes it.
Change-Id: I2709e378b764ee1f8c2786ed5fec5741d440c9e6
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| | |
This patch adds raw code ADC inputs values to the sysfs.
Change-Id: I498a2171a2a08abc157b929cec3a5c5ad398a4df
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Function twl6030_gpadc_read_channels reads raw_code and
raw_channel_value correctly for the TWL6030. For the TWL6032
raw_code was not updated and raw_channel_value was with
raw_code channel value. Now function twl6030_gpadc_read_channels
works correctly for both chips.
Change-Id: I689a5095e33878a99d6970aec08cad3b21aa222f
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For the twl6032 was no possible to read channels 17 and 18 because
for the twl6032 channel number was compared with TWL6030_GPADC_MAX_CHANNELS.
This patch fix it.
Change-Id: Ie3b96586d58d8938b6e46649735cb26fa43540cb
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For converting data from GPADC incorrect coefficients where used
for some channels.
All channels except 0 return millivolts, which is confusing. Make
it uniform, so, all channels return millivolts.
For channel 0 further conversion should be done in place.
Change-Id: I8b9db495ab9b9c7f18a4906306c20e0d777f292d
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Sample type of the conversion was not set in the ioctl function
and it was with random value. As result - many attempts to start
GPADC conversion via ioctl function were ended with the EINVAL
error. This patch fixes it.
Change-Id: Id8dc13f9cb7f8b828bc6f74bcac4a47b269bb83c
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch corrects GPADC calibration for the TWL6032 due to the
TWL6032 data manual.
Change-Id: I15fb4148bf94a5123467e8b7a316e7edcdb55ebc
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the latest iteration of the data sheet the TRIM information was
changed from 2s complement to magnitude + sign. And the codes for
channel 10 were updated. Update code to reflect this change.
Change-Id: Ibaa3cbbe2241e1ce844e1249f0ab6389a1ed9b93
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When scheduler preempts just started GPADC conversion,
the timeout appears because a time is exhausted
but actual status register value is not updated yet.
Simple scenario:
1. GPADC convertion is started before this function starts to run.
2. reg = twl6030_gpadc_read(gpadc, status_reg);
3. if (!(reg & TWL6030_GPADC_BUSY) && (reg & TWL6030_GPADC_EOC_SW))
return 0;
GPADC is not yet ready, so function does not return.
4. This moment the context is switched to another thread(s)
----------------------------------------------------------------------->
5. thread(s) work(s) for timeout_ms or more time.
GPADC convertion is finished.
6. <-----------------------------------------------------------------------
The context is switched back.
7. } while (!time_after(jiffies, timeout))
Next cycle pass does not start, even if GPADC is yet ready.
8. The Timeout Error is returned.
Additional GPADC status register reading is added for such cases.
modified: drivers/mfd/twl6030-gpadc.c
Change-Id: I94b61bb8318c6a03972ad057ab3fd026d1b4c13f
Signed-off-by: x0169938 <vasyl.yushchyshen@ti.com>
|
| |
| |
| |
| |
| |
| |
| | |
This patch adds interrupt mapping table for the twl6032.
Change-Id: Iee641e3fbbbc6506e28ac5bab66313686fcb7606
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
There was an typo in the regulator registration in the twl-core.c.
This patch corrects it.
Change-Id: Iea35b635806281ebc7473181d62c828e3e7a586c
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This errata affects only TWL6030 ES2.1. Each time a charge is
enabled via SW, a THMREG interrupt triggers (Internal USB charger
fault interrupt line).
Workaround: Interrupt (the bit #1 of CHARGERUSB_INT_MASK) has to be
masked before enabling the charge, and unmasked after charge is
enabled.
Change-Id: I14074e384a863c82ba61af9ea9434afe75cc2bc8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This errata affects only TWL6030 ES2.1. The usage of the CIN_LIMIT
codes above 600mA (CHARGERUSB_CINLIMIT Register, codes
650mA/700mA/750mA) may lead to an unlimited input current in
case VBUS < 4.1V.
Workaround: The anti-collapse feature needs to be enabled before
usage of the CIN_LIMIT. All CIN_LIMIT codes will be functional at
all anti-collapse levels.
Change-Id: I4fc0eb64cc96b692f4761a27098df307e1f5cd54
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There were two different ways of battery detection: one for
TWL6030 and second for TWL6032. ADC returned resistance for
TWL6030 but voltage for TWL6032 (channel 0). The threshold 5000
in function is_battery_present() was not correct for TWL6032. But
threshold was used for both ways of battery detection and we
couldn't change it.
The next changes were implemented:
ADC returns voltage from channel 0 for TWL6030.
The same way of battery detection was implemented for TWL6030
and TWL6032.
Threshold was changed.
Change-Id: I30a5282c95947edb06a33388d195fc4d17fbd96c
Signed-off-by: Sergii Postulga <x0153364@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Residual voltage may be present on VBUS when USB cable is unplugged.
Workaround: Increase the VBUS anticollapse loop threshold to 4.44 V.
This errata affects only TWL6032 ES1.1
Change-Id: I7533fa7e3caa98e9e326f0c30cfb31d813303be8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds for the kernel code ability to the errata
implementation for the TWL6030/TWL6032 chips.
Change-Id: Ieb2329ec3cf1e0300decc2908fba28aa471854e5
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The TWL6032 chip has a different but similar GPADC. The resolution
has been increased to 12bits and there are more channels. The method
correction values are stored in EPROM is also changed.
Change-Id: Iec060638ebecab50fb6562b0fae592f807554a42
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The TWL6032 supports two different mode of operation for its
charger. One is very similar to twl6030 with only a couple of tweaks.
The other the charger control is moved to hardware and the driver
becomes just a monitor for hardware state.
Change-Id: I5920c3b042017da5ae8a72a0bb12854e2f7c342e
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds support for the battery charging component of the
Phoenix IC. It enables charging via USB.
Change-Id: Ia076c3f6009c7d064a68153f9193b7f927553ad9
Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TWL40XX and TWL60XX devices has an interrupt line which is connected to
application processor like OMAP. Since these devices supports many features
like MMC card detect, USB cable detect, RTC interrupt etc which needs to
wakeup application processor on these events.
So provide the i2c client driver suspend hooks so that wakeup capability
can be enabled on these events using the common IRQ line.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Axel Haslam <axelhaslam@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently GPADC is kept enabled through-out, so enable/disable
GPADC during resume/suspend so that VANA can enter lp state.
GPADC_TEMP{1,2}_EN along with thermal monitor features are
handled as part of BCI driver. So removing enabling/disabling
of GPADC_TEMP1_EN from GPADC driver.
Change-Id: I02553c5e324764cc2d8720c2f586871917b31ef7
Signed-off-by: Ambresh K <ambresh@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
During OFF mode need to take care of GPADC cntrl module
so that leakage is minimal. Disable/Enable TEMP1 over
suspend/resume.
Change-Id: I09ae8a880a9ef0c95a9905dc3dbe54d1973871ca
Signed-off-by: Girish S G <girishsg@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Increasing debounce time for SD card insert. Without
this, we are seeing erroneous card insert detect
interrupts coming in even while removal of SD card.
Change-Id: I1e8fcaec22f438708fe40db2871a4ab565bfb9a5
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds support for the General Purpose A/D Convertor in
TWL6030.
This driver is based on the twl4030-madc driver written by Mikko Ylinen
and Filipe Balbi, and currently has a 'misc' device interface. It needs
to be moved to drivers/hwmon as per comments from the community on the
twl4030-madc driver.
Change-Id: I84568c847502e562f7a1656b845f94b00e6aaecf
Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The GPADC_SW_EOC interrupt offset was incorrectly specified in
the twl6030 interrupt mapping table. Fix the same.
Change-Id: I4bbfe4f6685da46d3e27f62c3821653505726509
Signed-off-by: Mohan V <mohanv@ti.com>
Signed-off-by: Maulik Mankad <maulik@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Modifying operational code to adjust for the compilation issue:
drivers/mfd/twl6030-poweroff.c:28: warning: "TWL6030_PHOENIX_DEV_ON"
redefined include/linux/i2c/twl.h:473: note: this is the location
of the previous definition drivers/mfd/twl6030-poweroff.c
Change-Id: Ifa344bbdcf1348024c9f06ee83ca802f7de40407
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
There was an typo in the TWL6032 power resources assignments
table. This patch corrects it.
Change-Id: Ie270bceb62dee4cb67790eb7194eeb52e86b8dea
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds definition and initialization of the resources
assignments (LDOs, SYSEN, SMPS, etc) for the TWL6032.
Change-Id: Icdca2129d0ca552fae8f8b0849489d9d1c77f526
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| |
| | |
Add the power button support for the twl6030
Signed-off-by: Dan Murphy <dmurphy@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
REGEN1 is added to platform data, so that it can be
modelled as an regulator and the state of it can be
controlled through drivers and board file.
Change-Id: I3e3251d95841a8522db530b7826746e375e23ce6
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
|
| |
| |
| |
| |
| | |
Change-Id: If4b4b9365424282abb623329d094706a52bc777f
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The OMAP4 HS USB host subsystem supports the configurations
with two HSIC interfaces. This patch adds the ability
to use both of them
Change-Id: I95478563e07bba6811fed56abe442e640ccd71e4
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Automatic power-up completion result can be affected by race
conditions between the completion task itself and the READYINT
handler, leading to false power-up failures as the completion
timeout may expire before READYINT handler gets executed and
marks completion.
Instead, the first verification for a successful power-up sequence
is the expected state of NCPCTL, LDOCTL and LPPLLCTL registers.
These registers will have specific values after automatic power-up
sequence has completed.
False power-up success is still checked, this is the case where
the READYINT is received but the hardware state is not consistent
with what is known/expected after a successful sequence. Under these
circumstances, we retry automatic power-up.
Change-Id: I9f85d67a10e84564a38f7d97a78345be06ac3b16
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Refactor power-on verification which consists of checking NCPCTL,
LDOCTL and LPPLLCTL registers against expected values of successful
automatic power-up sequences.
Change-Id: I20c0693922baa6700a117881c47cbf400716446b
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the TWL6040 temperature increases above a threshold that could
damage the device, a thermal interrupt and shutdown are started
automatically by the hardware.
The thermal event handling involves the following steps:
1. Forcefully deassert AUDPWRON to avoid keeping TWL6040 is
Power-On state any longer
2. The event is notified to Android userspace through the switch
class based mechanism so that further actions can be taken
3. While the device is in thermal shutdown, accesses to VDD/VSS
registers will affect only register cache
4. Once the device has recovered from the thermal event, it will
be put back to Power-On state regardless of the state requested
by MFD clients:
4.1. If clients have requested Power-On state, then the context
of VDD/VSS registers is restored
4.2. If clients have requested Sleep state, then the request will
be honored. The additional Power-On -> Sleep transition is
required to ensure that reference system is disabled after
thermal shutdown
5. An additional notification is sent to Android userspace to inform
about thermal shutdown recovery.
Change-Id: I38afa98fea03210312fc01ab0d2c6ab2a10c447d
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add register context restore per supply.
Change-Id: I4918efee4fcc83f4998f59f3d376b798822ca3ce
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a new set of APIs to TWL6040 MFD to query the supply of its
registers: twl6040_get_reg_supply(), twl6040_reg_is_vdd() and
twl6040_reg_is_vio().
Change-Id: Ic320ad7759c66d705f6025361cd6a296ac695dd9
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
|