aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/ttusb-budget (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-28regulator: max8952 - fix max8952_pmic_probe error pathAxel Lin1-2/+8
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28regulator: fix build when CONFIG_REGULATOR_DUMMY=nAnand Gadiyar1-4/+0
Commit f03f91826 (regulator: Add option for machine drivers to enable the dummy regulator) in the regulators tree seems to have introduced the following build break when CONFIG_REGULATOR_DUMMY is disabled. Fix this. CC drivers/regulator/dummy.o drivers/regulator/dummy.c:41: error: redefinition of 'regulator_dummy_init' drivers/regulator/dummy.h:28: note: previous definition of 'regulator_dummy_init' was here make[2]: *** [drivers/regulator/dummy.o] Error 1 make[1]: *** [drivers/regulator] Error 2 make: *** [drivers] Error 2 Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28regulator: avoid deadlock when disabling regulator with supplyJeffrey Carlyle1-9/+26
I have a regulator A that sets regulator B as its supply. When I call set_supply to add B as the supply for A, regulator A gets added to the supply_list for regulator B. When I call regulator_disable(A), I end up with a call chain like this: regulator_disable(A) > mutex_lock(A) > _regulator_disable(A) >> _regulator_disable(B) >>> _notifier_call_chain(B) >>>> mutex_lock(A) Which results in dead lock since we are trying to acquire the mutex lock for regulator A which we already hold. This patch addresses this issue by moving the call to disable regulator B outside of the lock aquired inside the initial call to regulator_disable. This change also addresses the issue of not acquiring the mutex for regulator B before calling _regulator_disable(B). Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28regulator: Add option for machine drivers to enable the dummy regulatorMark Brown3-2/+28
Allow machine drivers to explicitly enable the use of the dummy regulator, enabling simpler support for systems with only a few specific supplies visible to software. It is strongly recommended that this is not used on systems with substantial software control over their PMICs, for maximum functionality constrints should be as fully specified as possible. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28Regulator: lp3972 cleanupAxel Lin1-7/+18
This patch includes below fixes based on Mark's comment. - Return actual error if i2c_smbus_read_byte_data() fail - Add spaces around bitwise AND operator(&) to improve readability - Add comment to explain why we need to update voltage change control register for LDO1 and LDO5 - Logging the value for diagnostics if chip reported incorrect voltage value - Add __devinit annotation for setup_regulators() - Show system control register1 value if the value is mismatched - Logging the value for diagnostics if failed to detect device Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28Regulator: LP3972 PMIC regulator driverAxel Lin4-0/+705
This patch adds regulator drivers for National Semiconductors LP3972 PMIC. This LP3972 PMIC controller has 3 DC/DC voltage converters and 5 low drop-out (LDO) regulators. LP3972 PMIC controller uses I2C interface. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28MAX8952 PMIC Driver Initial ReleaseMyungJoo Ham4-0/+504
MAX8952 PMIC is used to provide voltage output between 770mV - 1400mV with DVS support. In this initial release, users can set voltages for four DVS modes, RAMP delay values, and SYNC frequency. Controlling FPWM/SYNC_MODE/Pull-Down/Ramp Modes and reading CHIP_ID is not supported in this release. If GPIO of EN is not valid in platform data, the driver assumes that it is always-on. If GPIO of VID0 or VID1 is invalid, the driver pulls down VID0 and VID1 to fix DVS mode as 0 and disables DVS support. We assume that V_OUT is capable to provide every voltage from 770mV to 1.40V in 10mV steps although the data sheet has some ambiguity on it. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> -- v2: - Style correction - Can accept platform_data with invalid GPIOs - Removed unnecessary features - Improved error handling Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28hwmon: (it87) Add support for the IT8721F/IT8758EJean Delvare3-33/+115
Add support for the IT8721F/IT8758E. These new chips differ from the older IT87xxF chips in the following ways: * ADC LSB is 12 mV instead of 16 mV. * PWM values are 8-bit instead of 7-bit. There are other minor changes we don't have to care about in the driver. Another change is that we will handle internal voltage scaling in the driver instead of delegating the work to user-space. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (it87) Move conversion functionsJean Delvare1-50/+52
Move conversion functions until after structure defintions. This is needed for future changes which make use of the structures in the conversion funtcions. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: Remove many EXPERIMENTAL flagsJean Delvare1-16/+12
Remove the dependency on EXPERIMENTAL for all drivers which are in the kernel tree for a long time, are known to work properly and for which we have documentation. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Juerg Haefliger <juergh@gmail.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (lm85) Add support for ADT7468 high-frequency PWM modeJean Delvare2-7/+35
The ADT7468 supports a high-frequency PWM output mode where all PWM outputs are driven by a 22.5 kHz clock. Add support for this mode, and document it, as it may surprise the user that setting one PWM output frequency also affects the other PWM outputs. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (lm85) Document the ADT7468 as supportedJean Delvare2-25/+31
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (lm85) Fix ADT7468 frequency tableJean Delvare1-0/+1
The ADT7468 uses the same frequency table as the ADT7463. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Cc: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: I2C addresses are constantJean Delvare3-5/+5
We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: George Joseph <george.joseph@fairview5.com> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28Move ams driver to macintoshJean Delvare11-28/+29
The ams driver isn't a hardware monitoring driver, so it shouldn't live under driver/hwmon. drivers/macintosh seems much more appropriate, as the driver is only useful on PowerBooks and iBooks. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Stelian Pop <stelian@popies.net> Cc: Michael Hanselmann <linux-kernel@hansmi.ch> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Grant Likely <grant.likely@secretlab.ca>
2010-10-28hwmon: (pcf8591) Don't attempt to detect devicesJean Delvare2-36/+8
The PCF8591 can't be detected, don't even try. There are plenty of other means to instantiate i2c devices these days. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Aurelien Jarno <aurelien@aurel32.net>
2010-10-28hwmon: (pcf8591) Register as a hwmon deviceJean Delvare1-0/+12
Register PCF8591 devices as hwmon devices. There's little point in implementing the standard sysfs interface if we don't register it in a way libsensors will pick it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Aurelien Jarno <aurelien@aurel32.net>
2010-10-28hwmon: (w83795) Use standard attributes for chassis intrusionJean Delvare1-3/+8
Follow the standard attribute naming for the chassis intrusion feature. I couldn't test the beeping (my board apparently doesn't do that) but the alarm works fine. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) Exclude fan control feature by defaultJean Delvare2-0/+27
The fan control feature of the w83795 driver is insufficiently reviewed and tested for public consumption at this time, so make it optional and disabled by default. We will change the default when review and testing is deemed sufficient. Ultimately the option will go away. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) Add myself as co-author and maintainerJean Delvare2-1/+8
I've made so many changes to the w83795 driver that it's only fair to list myself as a co-author. I'll also maintain the driver for some time. There's more work needed on the driver for sure. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) More style cleanupsJean Delvare1-15/+13
Cleanups suggested by Guenter Roeck, falling into 4 categories: * Swapping test orders, because if (var == CONSTANT) is much easier to read than if (CONSTANT == var). * Simplifying comparisons with 0. * Dropping unneeded masks. * Dropping unneeded parentheses and curly braces. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) Fix LSB reading of voltage limitsJean Delvare1-1/+1
Wrong index caused the wrong register value to be read, resulting in random LSB for voltage limits. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Use dev_get_drvdata() where possibleJean Delvare1-6/+3
When we don't need the client pointer, calling dev_get_drvdata() is more efficient that calling to_i2c_client() and then i2c_get_clientdata(). Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Delay reading pwm config registersJean Delvare1-22/+29
Wait until we need the pwm config register values, instead of pre-reading them. This saves over 1 second on modprobe on my test system. Obviously this time is added when first accessing pwm config attributes, however not everybody will use them, so it seems unfair to slow down driver loading (and thus boot) for an optional feature. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Delay reading limit registersJean Delvare1-1/+6
Wait until we need the limit register values, instead of pre-reading them. This saves 544 ms on modprobe on my test system. Obviously this time is added when first running "sensors" or any other monitoring application, but I think it is better than slowing down the boot. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Move register reads to dedicated functionsJean Delvare1-99/+119
Move initial register reads out of probe, to dedicated functions. This makes the code clearer, and will be needed if we want to delay calling these functions until they are needed, or want to call them periodically. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) Pack similar register readsJean Delvare1-16/+6
Pack similar register reads using for loops. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Make W83795_REG_PWM more efficientJean Delvare1-12/+8
Cascaded conditionals are inefficient. Reorder the fields so that PWM register addresses can be computed more efficiently. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-28hwmon: (w83795) Don't pre-read values we'll update laterJean Delvare1-26/+7
There is no point in reading registers during initialization if we will refresh the values in the update function later. This is only slowing down the driver loading with no benefit, stop doing it. This change saves 480 ms on driver load on my test system. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Simplify temperature sensor type handlingJean Delvare1-83/+24
All 3 temperature sensor type sysfs functions (show_temp_mode, store_temp_mode and show_dts_mode) can be simplified. We don't create these files when the correponding input isn't in temperature monitoring mode, so there is no point in handling that case. Likewise, we don't allow changing inputs from temperature to voltage, so the code handling this case is dead and can be removed. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Drop _NUM constantsJean Delvare1-10/+6
Consistently use ARRAY_SIZE() to control for loops. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Drop REST_VLT_BEGIN/ENDJean Delvare1-6/+3
Get rid of REST_VLT_BEGIN and REST_VLT_END, they don't make the code more readable. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Fix parity checksJean Delvare1-4/+4
x % 1 is obviously wrong, as it always evaluates to 0. You want x % 2, or x & 1, for parity checking. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Get rid of VRLSB_SHIFTJean Delvare1-10/+5
VRLSB_SHIFT is a non-sense, the actual shift depends on the sensor type (fans need 4, other sensors need 6). Get rid of it to prevent any confusion. Also get rid of the useless masking, the meaningful bits are always the MSb so there's nothing to mask out after shifting. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Avoid reading the same register twiceJean Delvare1-2/+9
Shorten driver load time by avoiding duplicate register access during initialization. This saves 112 ms on modprobe on my test system. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Rework beep_enable implementationJean Delvare1-38/+2
Handle beep_enable just like all other beep bits. It doesn't need anything special, so let's avoid redundant code. This also saves a duplicate register read at initialization time. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Report PECI agent Tbase valuesJean Delvare1-0/+13
On systems with PECI, report PECI agent Tbase temperature values. This is informative only. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Properly handle negative temperaturesJean Delvare1-13/+7
The temperature registers hold regular 2's complement values, no need to add any arithmetics. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Rename temperature limit attributesJean Delvare1-10/+10
Follow the standard for temperature limit attribute naming, so that libsensors will pick the values. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Fix PWM duty cycle frequency attributesJean Delvare1-28/+62
The PWM duty cycle frequenty attributes are improperly named (fanN_div instead of pwmN_div) and contain raw values instead of actual frequencies. Rename them and fix their contents. Also improve the logic when the user asks for a new frequency, to always pick the closest supported frequency. The algorithm could certainly be optimized, but the operation is infrequent enough that I don't think it's worth the effort. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Add support for dynamic in0-2 limitsJean Delvare1-0/+56
The W83795G can be configured to set the in0, in1 and/or in2 voltage limits dynamically based on VID input pins. Switch the respective sysfs attributes to read-only. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Fix LSB reading of fan speedsJean Delvare1-5/+5
Misplaced parentheses caused the wrong register value to be read, resulting in random LSB for fan speed values and limits. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Clean up probe functionJean Delvare1-57/+34
* The data structure is zalloc'd, so no need to set individual fields to 0 explicitly. * Refactor the handling of pins that can be used for either temperature or voltage monitoring. * Misc other clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Fix in17-in20 gain factorJean Delvare1-3/+3
Gain bit set means 1x gain and cleared means 8x gain, not the other way around. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Only start monitoring if neededJean Delvare1-3/+10
This saves an SMBus write if monitoring was already enabled. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Add const markersJean Delvare1-8/+10
Attribute structures can be made const. Same for the I2C address list. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Only create fan[1-8]_target files when neededJean Delvare1-23/+4
Only create fan[1-8]_target files when the fan in question can be controlled (PWM output is present.) Also name these files according to the standard. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Move PWM attributes to a dedidated arrayJean Delvare1-10/+8
Use a dedicated 2D array for PWM attributes. This way, PWM attributes are handled the same way as other attributes, this is more consistent. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Use 2D arrays for many device attributesJean Delvare1-29/+37
Use 2D arrays for in, fan, temp and dts device attributes. Using linear arrays is too risky as we have to skip some groups depending on the device model and configuration. Adding or removing an attribute would let the driver build silently but then it would crash at runtime. With 2D arrays, the consistency checking happens at build time, which is much safer. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-10-28hwmon: (w83795) Merge w83795_create_files and w83795_remove_filesJean Delvare1-38/+17
Functions w83795_create_files and w83795_remove_files iterate over the same set of files, just calling a different function. Merge them into a single function which takes the action as a parameter. This saves code, and also ensure that file creation and deletion are in sync. Signed-off-by: Jean Delvare <khali@linux-fr.org>