Eric Anholt [Fri, 17 Oct 2008 22:41:26 +0000 (15:41 -0700)]
i915: Enable IMR passthrough of vblank events before enabling it in pipestat.
Otherwise, if we lost the race, the pipestat bit would be set without being
reflected in IIR, and we would never clear the pipestat bit so the pipe
event would never be generated again, and all vblank waits would time out.
Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Matthias Hopf [Fri, 17 Oct 2008 21:18:05 +0000 (07:18 +1000)]
drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.
Keith Packard [Wed, 15 Oct 2008 04:41:13 +0000 (21:41 -0700)]
i915: Don't run retire work handler while suspended
At leavevt and lastclose time, cancel any pending retire work handler
invocation, and keep the retire work handler from requeuing itself if it is
currently running.
This patch restructures i915_gem_idle to perform all of these tasks instead
of having both leavevt and lastclose call a sequence of functions.
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Keith Packard [Wed, 15 Oct 2008 02:55:10 +0000 (19:55 -0700)]
i915: Map status page cached for chips with GTT-based HWS location.
This should improve performance by avoiding uncached reads by the CPU (the
point of having a status page), and may improve stability. This patch only
affects G33, GM45 and G45 chips as those are the only ones using GTT-based
HWS mappings.
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Keith Packard [Wed, 15 Oct 2008 00:20:35 +0000 (17:20 -0700)]
i915: Fix up ring initialization to cover G45 oddities
G45 appears quite sensitive to ring initialization register writes,
sometimes leaving the HEAD register with the START register contents. Check
to make sure HEAD is reset correctly when START is written, and fix it up,
screaming loudly.
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Like the last patch but adds a macro to get at the irq value instead of
dereferencing pdev directly. Should make things easier for the BSD guys and
if we ever support non-PCI devices.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Tue, 23 Sep 2008 21:50:57 +0000 (14:50 -0700)]
drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC.
Fixes failure to map the ringbuffer when PAT tells us we don't get to do
uncached on something that's already mapped WC, or something along those lines.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Mon, 1 Sep 2008 23:45:29 +0000 (16:45 -0700)]
i915: Use struct_mutex to protect ring in GEM mode.
In the conversion for GEM, we had stopped using the hardware lock to protect
ring usage, since it was all internal to the DRM now. However, some paths
weren't converted to using struct_mutex to prevent multiple threads from
concurrently working on the ring, in particular between the vblank swap handler
and ioctls.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Wed, 30 Jul 2008 19:06:12 +0000 (12:06 -0700)]
drm: Add GEM ("graphics execution manager") to i915 driver.
GEM allows the creation of persistent buffer objects accessible by the
graphics device through new ioctls for managing execution of commands on the
device. The userland API is almost entirely driver-specific to ensure that
any driver building on this model can easily map the interface to individual
driver requirements.
GEM is used by the 2d driver for managing its internal state allocations and
will be used for pixmap storage to reduce memory consumption and enable
zero-copy GLX_EXT_texture_from_pixmap, and in the 3d driver is used to enable
GL_EXT_framebuffer_object and GL_ARB_pixel_buffer_object.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Thu, 21 Aug 2008 19:53:33 +0000 (12:53 -0700)]
Export kmap_atomic_pfn for DRM-GEM.
The driver would like to map IO space directly for copying data in when
appropriate, to avoid CPU cache flushing for streaming writes.
kmap_atomic_pfn lets us avoid IPIs associated with ioremap for this process.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Keith Packard [Fri, 20 Jun 2008 07:08:06 +0000 (00:08 -0700)]
Export shmem_file_setup for DRM-GEM
GEM needs to create shmem files to back buffer objects. Though currently
creation of files for objects could have been driven from userland, the
modesetting work will require allocation of buffer objects before userland
is running, for boot-time message display.
Signed-off-by: Eric Anholt <eric@anholt.net> Cc: Nick Piggin <npiggin@suse.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
drm: Rework vblank-wait handling to allow interrupt reduction.
Previously, drivers supporting vblank interrupt waits would run the interrupt
all the time, or all the time that any 3d client was running, preventing the
CPU from sleeping for long when the system was otherwise idle. Now, interrupts
are disabled any time that no client is waiting on a vblank event. The new
method uses vblank counters on the chipsets when the interrupts are turned
off, rather than counting interrupts, so that we can continue to present
accurate vblank numbers.
Co-author: Michel Dänzer <michel@tungstengraphics.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
David Howells [Tue, 2 Sep 2008 01:03:14 +0000 (11:03 +1000)]
drm/cred: wrap task credential accesses in the drm driver.
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.
Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: David Airlie <airlied@redhat.com>
Jesse Barnes [Mon, 25 Aug 2008 22:11:06 +0000 (15:11 -0700)]
separate i915 suspend/resume functions into their own file
[Patch against drm-next. Consider this a trial balloon for our new Linux
development model.]
This is a big chunk of code. Separating it out makes it easier to change
without churn on the main i915_drv.c file (and there will be churn as we
fix bugs and add things like kernel mode setting). Also makes it easier
to share this file with BSD.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Matthew Garrett [Tue, 5 Aug 2008 18:37:25 +0000 (19:37 +0100)]
Add Intel ACPI IGD OpRegion support
This adds the support necessary for allowing ACPI backlight control to
work on some newer Intel-based graphics systems. Tested on Thinkpad T61
and HP 2510p hardware.
Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Eric Anholt [Tue, 29 Jul 2008 19:10:39 +0000 (12:10 -0700)]
i915: Add support for MSI and interrupt mitigation.
Previous attempts at interrupt mitigation had been foiled by i915_wait_irq's
failure to update the sarea seqno value when the status page indicated that
the seqno had already been passed. MSI support has been seen to cut CPU
costs by up to 40% in some workloads by avoiding other expensive interrupt
handlers for frequent graphics interrupts.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
David Howells [Wed, 30 Jul 2008 19:29:37 +0000 (12:29 -0700)]
SiS DRM: fix the memory allocator if the SIS FB is built as a module
Fix the SIS DRM memory allocator if the SIS FB built as a module. The SIS DRM
code initialises the mm allocation hooks, but _only_ if the SIS FB is not
built as a module because it depends on CONFIG_FB_SIS, and that's unset if the
SIS FB is not built in. It must check CONFIG_FB_SIS_MODULE as well.
Signed-off-by: David Howells <dhowells@redhat.com> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Carlos R. Mafra [Wed, 30 Jul 2008 19:29:37 +0000 (12:29 -0700)]
drm: remove #define's for non-linux systems
There is no point in considering FreeBSD et al. in the linux kernel
source code.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Linus Torvalds [Fri, 17 Oct 2008 16:33:39 +0000 (09:33 -0700)]
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (47 commits)
hwmon: (adm1026) Prevent log spamming
hwmon: (adm1026) Fix debug messages
hwmon: (adm1029) Use mask for fan_div value
hwmon: (adt7470) Add documentation
hwmon: (ibmaem) Automatically load on IBM systems via DMI
hwmon: (ibmpex) Automatically load on IBM systems via DMI
hwmon: (w83781d) Use new style driver binding
hwmon: (w83781d) Stop abusing struct i2c_client for ISA devices
hwmon: (w83781d) Make ISA interface depend on CONFIG_ISA
hwmon: (w83781d) Additional information about AS99127F PWM
hwmon: (w83781d) Detect alias chips
hwmon: (w83781d) Refactor beep enable handling
hwmon: Drop dead links to old National Semiconductor chip datasheets
hwmon: (w83791d) add support for thermal cruise mode
hwmon: (w83791d) add pwm_enable support
hwmon: (w83791d) add manual PWM support
hwmon: (w83791d) fan 4/5 pins can also be used for gpio
hwmon: (max1619) Use inline functions instead of macros
hwmon: (it87) Fix thermal sensor type values
hwmon: (lm78) Convert to a new-style i2c driver
...
Linus Torvalds [Fri, 17 Oct 2008 16:29:55 +0000 (09:29 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: remove __generic_unplug_device() from exports
block: move q->unplug_work initialization
blktrace: pass zfcp driver data
blktrace: add support for driver data
block: fix current kernel-doc warnings
block: only call ->request_fn when the queue is not stopped
block: simplify string handling in elv_iosched_store()
block: fix kernel-doc for blk_alloc_devt()
block: fix nr_phys_segments miscalculation bug
block: add partition attribute for partition number
block: add BIG FAT WARNING to CONFIG_DEBUG_BLOCK_EXT_DEVT
softirq: Add support for triggering softirq work on softirqs.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
net: Remove CONFIG_KMOD from net/ (towards removing CONFIG_KMOD entirely)
ipv4: Add a missing rcu_assign_pointer() in routing cache.
[netdrvr] ibmtr: PCMCIA IBMTR is ok on 64bit
xen-netfront: Avoid unaligned accesses to IP header
lmc: copy_*_user under spinlock
[netdrvr] myri10ge, ixgbe: remove broken select INTEL_IOATDMA
Jean Delvare [Fri, 17 Oct 2008 15:51:20 +0000 (17:51 +0200)]
hwmon: (adm1026) Prevent log spamming
When debugging is enabled, the adm1026 driver currently logs the
message "Setting VID from GPIO11-15" 108 times each time you run
"sensors". Once should be enough.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Philip Pokorny <ppokorny@penguincomputing.com>
This patch modifies the w83781d driver to use new style driver binding.
Substantial code modifications are required to deal with the new
interface, especially legacy device detection.
[JD: largely edited to make the patch smaller and to get the driver
to work again on ISA devices.]
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Fri, 17 Oct 2008 15:51:19 +0000 (17:51 +0200)]
hwmon: (w83781d) Stop abusing struct i2c_client for ISA devices
Upcoming changes to the I2C part of the w83781d driver will cause ISA
devices to no longer have a struct i2c_client at hand. So, we must
stop (ab)using it now.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Wolfgang Grandegger <wg@grandegger.com>
hwmon: (w83781d) Make ISA interface depend on CONFIG_ISA
Probing the ISA bus on systems without ISA bus may hang the system.
This patch makes the ISA bus related code depend on the kernel
configuration parameter CONFIG_ISA. It moves ISA bus related code
into one #ifdef CONFIG_ISA ... #endif block and adds some helper
function.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Fri, 17 Oct 2008 15:51:18 +0000 (17:51 +0200)]
hwmon: (w83781d) Additional information about AS99127F PWM
This information was provided in lm-sensors ticket #2350:
http://www.lm-sensors.org/ticket/2350
This is IMHO still not enough to be able to safely implement fan
control support for the AS99127F, but this is valuable information so
I am adding it to the documentation.
Jean Delvare [Fri, 17 Oct 2008 15:51:18 +0000 (17:51 +0200)]
hwmon: (w83781d) Detect alias chips
The W83781D and W83782D can be accessed either on the I2C bus or the
ISA bus. We must not access the same chip through both interfaces. So
far we were relying on the user passing the correct ignore parameter
to skip the registration of the I2C interface as suggested by
sensors-detect, but this is fragile: the user may load the w83781d
driver without running sensors-detect, and the i2c bus numbers are
not stable across reboots and hardware changes.
So, better detect alias chips in the driver directly, and skip any
I2C chip which is obviously an alias of the ISA chip. This is done
by comparing the value of 26 selected registers.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Wolfgang Grandegger <wg@grandegger.com>
Jean Delvare [Fri, 17 Oct 2008 15:51:16 +0000 (17:51 +0200)]
hwmon: (it87) Fix thermal sensor type values
The it87 driver doesn't follow the standard sensor type values as
documented in Documentation/hwmon/sysfs-interface. It uses value 2 for
thermistors instead of value 4. This causes "sensors" to tell the user
that the chip is setup for a transistor while it is actually setup for
a thermistor.
Using value 4 for thermistors solves the problem. For compatibility
reasons, we still accept value 2 but emit a warning message so that
users update their configuration files.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com>
Jean Delvare [Fri, 17 Oct 2008 15:51:15 +0000 (17:51 +0200)]
hwmon: (lm78) Stop abusing struct i2c_client for ISA devices
Upcoming changes to the I2C part of the lm78 driver will cause ISA
devices to no longer have a struct i2c_client at hand. So, we must
stop (ab)using it now.
Jean Delvare [Fri, 17 Oct 2008 15:51:15 +0000 (17:51 +0200)]
hwmon: (lm78) Prevent misdetection of Winbond chips
The LM78 detection is relatively weak, and sometimes recent Winbond
chips can be misdetected as an LM78. We have had repeated reports of
this happening. We have an explicit check against this for the ISA
access, do the same for I2C access now.
Jean Delvare [Fri, 17 Oct 2008 15:51:15 +0000 (17:51 +0200)]
hwmon: (lm78) Detect alias chips
The LM78 and LM79 can be accessed either on the I2C bus or the ISA
bus. We must not access the same chip through both interfaces. So far
we were relying on the user passing the correct ignore parameter to
skip the registration of the I2C interface as suggested by
sensors-detect, but this is fragile: the user may load the lm78
driver without running sensors-detect, and the i2c bus numbers are
not stable across reboots and hardware changes.
So, better detect alias chips in the driver directly, and skip any
I2C chip which is obviously an alias of the ISA chip. This is done
by comparing the value of 26 selected registers.
Jean Delvare [Fri, 17 Oct 2008 15:51:15 +0000 (17:51 +0200)]
hwmon: (lm78) Fix I/O resource conflict with PNP
Only request I/O ports 0x295-0x296 instead of the full I/O address
range. This solves a conflict with PNP resources on a few motherboards.
Also request the I/O ports in two parts (4 low ports, 4 high ports)
during device detection, otherwise the PNP resource make the request
(and thus the detection) fail.
This is the exact same fix that was applied to driver w83781d in
March 2008 to address the same problem:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2961cb22ef02850d90e7a12c28a14d74e327df8d
Jean Delvare [Fri, 17 Oct 2008 15:51:14 +0000 (17:51 +0200)]
hwmon: (lm85) Simplify RANGE_TO_REG
Function RANGE_TO_REG can easily be simplified. Credits go to Herbert
Poetzl for indirectly suggesting this to me. I tested that the new
implementation returns the same result as the original implementation
for all input values.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
Jean Delvare [Fri, 17 Oct 2008 15:51:14 +0000 (17:51 +0200)]
hwmon: (lm85) Support different PWM frequency tables
The Analog Devices and SMSC devices supported by the lm85 driver do
not have the same PWM frequency table as the National Semiconductor
devices. Add support for per-device frequency tables.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
Jean Delvare [Fri, 17 Oct 2008 15:51:13 +0000 (17:51 +0200)]
hwmon: (lm85) Select the closest PWM frequency
The LM85 and compatible chips only support 8 arbitrary PWM frequencies.
The algorithm to pick one of them based on the user input is not
optimum. Improve it to always pick the closest supported frequency.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
Jean Delvare [Fri, 17 Oct 2008 15:51:13 +0000 (17:51 +0200)]
hwmon: (lm85) Implement the standard PWM frequency interface
Implement the standard PWM frequency interface: pwm[1-*]_freq in
units of 1 Hz, instead of the non-standard pwm[1-*]_auto_pwm_freq
in units of 0.1 Hz. The old naming was not only non-standard, it was
also confusing, because it suggested that the frequency value only
applied in automatic fan speed mode, which isn't true.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
Dmitry Torokhov [Fri, 17 Oct 2008 15:51:12 +0000 (17:51 +0200)]
hwmon: (ams) Fix locking issues
Use a separate mutex to serialize input device creation/removal,
otheriwse we deadlock if we try to remove input device while it is
being polled. Also do not take ams_info.lock when it is not needed.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Dmitry Torokhov [Fri, 17 Oct 2008 15:51:12 +0000 (17:51 +0200)]
hwmon: (ams) Fix permissions on 'joystick' module parameter
We should not allow writes to the 'joystick' module parameters since
writing there will not trigger creation of the input device. Disable
writes since we provide alternative way of enabling input device via
AMS device's sysfs attribute.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Fri, 17 Oct 2008 15:51:12 +0000 (17:51 +0200)]
hwmon: (ams) Convert to a new-style i2c driver
The legacy i2c binding model is phasing out, so the ams driver needs
to be converted to a new-style i2c driver. Here is a naive approach of
this conversion. Basically it is moving the i2c device creation from
the ams driver to the i2c-powermac driver. This should work, but I
suspect we could come up with something cleaner by declaring the i2c
device as part of the platform setup. This could be done later by
someone more familiar with openfirmware-based platforms than I am
myself.
One nice thing brought by this conversion is that the ams driver
should be loaded automatically on systems where is is needed (at
least when the I2C interface to the chip is used) providing
coldplug-aware user-space environment.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Johannes Berg <johannes@sipsolutions.net> Cc: Stelian Pop <stelian@popies.net> Cc: Michael Hanselmann <linux-kernel@hansmi.ch> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Ben Hutchings [Fri, 17 Oct 2008 15:51:12 +0000 (17:51 +0200)]
hwmon: (lm87) Add support for configuration through platform_data
The lm87 driver normally assumes that firmware configured the chip
correctly. Since this is not always the case, alllow platform code to
set the channel register value via platform_data. All other
configuration registers can be changed after driver initialisation.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Ben Hutchings [Fri, 17 Oct 2008 15:51:11 +0000 (17:51 +0200)]
hwmon: (lm87) Fix masking of config register in lm87_init_client()
lm87_init_client() conditionally sets the Start bit and clears the
INT#_Clear bit in the Config 1 register. The condition should be that
either of these bits needs changing, but currently it checks the
(self-clearing) Initialization bit instead of INT#_Clear.
Fix the condition and also ensure we never set the Initialization bit.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Fri, 17 Oct 2008 15:51:11 +0000 (17:51 +0200)]
hwmon: (lm90) Don't spam the kernel log
Degrade the "Unsupported chip" message from info to debug level.
There's nothing wrong with this, so no need to bother the user.
Also make the message slightly more descriptive.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
Ben Hutchings [Fri, 17 Oct 2008 15:51:10 +0000 (17:51 +0200)]
hwmon: (lm90) Rename temperature conversion functions to match usage
The encoding of temperatures varies between chips and modes. So do not
use "temp1" or "temp2" in the names of the conversion functions, but
specify the encoding.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Martyn Welch <martyn.welch@gefanuc.com>
Nate Case [Fri, 17 Oct 2008 15:51:10 +0000 (17:51 +0200)]
hwmon: (lm90) Support ADT7461 in extended mode
Support ADT7461 in extended temperature range mode, which will change
the range of readings from 0..127 to -64..191 degC. Adjust the
register conversion functions accordingly.
Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Martyn Welch <martyn.welch@gefanuc.com>
Nate Case [Fri, 17 Oct 2008 15:51:10 +0000 (17:51 +0200)]
hwmon: (lm90) Convert some macros to static functions
Use static functions instead of the TEMPx_FROM_REG* and TEMPx_TO_REG*
macros. This will ensure type safety and eliminate any side effects
from arguments passed in since the macros referenced 'val' multiple
times. This change should not affect functionality.
Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Martyn Welch <martyn.welch@gefanuc.com>