aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2008-10-17hwmon: (lm85) Better label namesJean Delvare
Label names ERROR1 and ERROR3 aren't exactly explicit. Change them for better names that indicate what we are up to. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
2008-10-17hwmon: (lm85) Simplify RANGE_TO_REGJean Delvare
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>
2008-10-17hwmon: (lm85) Convert to a new-style i2c driverJean Delvare
The new-style lm85 driver implements the optional detect() callback to cover the use cases of the legacy driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
2008-10-17hwmon: (lm85) Support different PWM frequency tablesJean Delvare
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>
2008-10-17hwmon: (lm85) Select the closest PWM frequencyJean Delvare
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>
2008-10-17hwmon: (lm85) Implement the standard PWM frequency interfaceJean Delvare
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>
2008-10-17hwmon: (lm85) Rework the device detectionJean Delvare
Rework the device detection to make it clearer and faster in the general case (when a known device is found.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at>
2008-10-17hwmon: (ams) Simplify IRQ handling routineDmitry Torokhov
Simplify the IRQ handling routine of ams driver. 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>
2008-10-17hwmon: (ams) Fix locking issuesDmitry Torokhov
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>
2008-10-17hwmon: (ams) Fix permissions on 'joystick' module parameterDmitry Torokhov
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>
2008-10-17hwmon: (ams) Convert to a new-style i2c driverJean Delvare
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>
2008-10-17hwmon: (lm87) Add support for configuration through platform_dataBen Hutchings
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>
2008-10-17hwmon: (lm87) Restore original configuration register on removalBen Hutchings
This means that if we have to start the monitor when probed, we also stop it on removal. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-10-17hwmon: (lm87) Fix masking of config register in lm87_init_client()Ben Hutchings
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>
2008-10-17hwmon: (lm90) Don't spam the kernel logJean Delvare
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>
2008-10-17hwmon: (lm90) Support MAX6646, MAX6647 and MAX6649Ben Hutchings
These Maxim chips are similar to MAX6657 but use unsigned temperature values to allow for readings up to 145 degrees. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2008-10-17hwmon: (lm90) Rename temperature conversion functions to match usageBen Hutchings
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>
2008-10-17hwmon: (lm90) Support ADT7461 in extended modeNate Case
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>
2008-10-17hwmon: (lm90) Convert some macros to static functionsNate Case
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>
2008-10-17hwmon: (lm90) Update datasheet linksJean Delvare
Update the links to the datasheet of some of the devices supported by the lm90 driver. Also remove the links from the driver itself, so that we don't have to update them twice each time they change. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
2008-10-17hwmon: (lm90) Don't access nonexistent registers on Maxim chipsJean Delvare
The Maxim chips supported by the lm90 driver have 8-bit high and low remote limit values, not 11-bit as the other chips have. So stop reading from and writing to registers that do not exist on these chips. Also round the limit values set by the user properly. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
2008-10-17hwmon: (lm90) Support the extra resolution bits of MAX6657Jean Delvare
The Maxim MAX6657, MAX6658 and MAX6659 have extra resolution bits for the local temperature measurement. Let the lm90 driver read them and export them to user-space. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
2008-10-17hwmon: (lm90) Move 16-bit value read to a separate functionJean Delvare
Move the code which aggregates two 8-bit register values into a 16-bit value to a separate function. We'll need to do it a second time soon and I don't want to duplicate the code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Martyn Welch <martyn.welch@gefanuc.com>
2008-10-16{pci,pnp} quirks.c: don't use deprecated print_fn_descriptor_symbol()Linus Torvalds
I dunno how this missed Bjorn and his quest to use %pF in commit c80cfb0406c01bb5da91bfe30f5cb1fd96831138 ("vsprintf: use new vsprintf symbolic function pointer format"), but it did. So use %pF in the two remaining places that still tried to print out function pointers by hand. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16Merge branch 'kvm-updates/2.6.28' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm * 'kvm-updates/2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (134 commits) KVM: ia64: Add intel iommu support for guests. KVM: ia64: add directed mmio range support for kvm guests KVM: ia64: Make pmt table be able to hold physical mmio entries. KVM: Move irqchip_in_kernel() from ioapic.h to irq.h KVM: Separate irq ack notification out of arch/x86/kvm/irq.c KVM: Change is_mmio_pfn to kvm_is_mmio_pfn, and make it common for all archs KVM: Move device assignment logic to common code KVM: Device Assignment: Move vtd.c from arch/x86/kvm/ to virt/kvm/ KVM: VMX: enable invlpg exiting if EPT is disabled KVM: x86: Silence various LAPIC-related host kernel messages KVM: Device Assignment: Map mmio pages into VT-d page table KVM: PIC: enhance IPI avoidance KVM: MMU: add "oos_shadow" parameter to disable oos KVM: MMU: speed up mmu_unsync_walk KVM: MMU: out of sync shadow core KVM: MMU: mmu_convert_notrap helper KVM: MMU: awareness of new kvm_mmu_zap_page behaviour KVM: MMU: mmu_parent_walk KVM: x86: trap invlpg KVM: MMU: sync roots on mmu reload ...
2008-10-16Merge branch 'core-v28-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: do_generic_file_read: s/EINTR/EIO/ if lock_page_killable() fails softirq, warning fix: correct a format to avoid a warning softirqs, debug: preemption check x86, pci-hotplug, calgary / rio: fix EBDA ioremap() IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes softlockup: Documentation/sysctl/kernel.txt: fix softlockup_thresh description dmi scan: warn about too early calls to dmi_check_system() generic: redefine resource_size_t as phys_addr_t generic: make PFN_PHYS explicitly return phys_addr_t generic: add phys_addr_t for holding physical addresses softirq: allocate less vectors IO resources: fix/remove printk printk: robustify printk, update comment printk: robustify printk, fix #2 printk: robustify printk, fix printk: robustify printk Fixed up conflicts in: arch/powerpc/include/asm/types.h arch/powerpc/platforms/Kconfig.cputype manually.
2008-10-16Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: Add more documentation to firewire-cdev.h firewire: fix ioctl() return code firewire: fix setting tag and sy in iso transmission firewire: fw-sbp2: fix another small generation access bug firewire: fw-sbp2: enforce s/g segment size limit firewire: fw_send_request_sync() ieee1394: survive a few seconds connection loss ieee1394: nodemgr clean up class iterators ieee1394: dv1394, video1394: remove unnecessary expressions ieee1394: raw1394: make write() thread-safe ieee1394: raw1394: narrow down the state_mutex protected region ieee1394: raw1394: replace BKL by local mutex, make ioctl() and mmap() thread-safe ieee1394: sbp2: enforce s/g segment size limit ieee1394: sbp2: check for DMA mapping failures ieee1394: sbp2: stricter dma_sync ieee1394: Use DIV_ROUND_UP
2008-10-16Merge branch 'agp-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6 * 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6: agp/nvidia: Support agp user-memory on nvidia agp. agp/amd-k7: Suspend support for AMD K7 GART driver agp/intel: Reduce extraneous PCI posting reads during init agp: Fix stolen memory counting on G4X.
2008-10-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits) UIO: Fix mapping of logical and virtual memory UIO: add automata sercos3 pci card support UIO: Change driver name of uio_pdrv UIO: Add alignment warnings for uio-mem Driver core: add bus_sort_breadthfirst() function NET: convert the phy_device file to use bus_find_device_by_name kobject: Cleanup kobject_rename and !CONFIG_SYSFS kobject: Fix kobject_rename and !CONFIG_SYSFS sysfs: Make dir and name args to sysfs_notify() const platform: add new device registration helper sysfs: use ilookup5() instead of ilookup5_nowait() PNP: create device attributes via default device attributes Driver core: make bus_find_device_by_name() more robust usb: turn dev_warn+WARN_ON combos into dev_WARN debug: use dev_WARN() rather than WARN_ON() in device_pm_add() debug: Introduce a dev_WARN() function sysfs: fix deadlock device model: Do a quickcheck for driver binding before doing an expensive check Driver core: Fix cleanup in device_create_vargs(). Driver core: Clarify device cleanup. ...
2008-10-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linusLinus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: module: remove CONFIG_KMOD in comment after #endif remove CONFIG_KMOD from fs remove CONFIG_KMOD from drivers Manually fix conflict due to include cleanups in drivers/md/md.c
2008-10-16Merge branch 'for-linus' of git://neil.brown.name/mdLinus Torvalds
* 'for-linus' of git://neil.brown.name/md: md: fix input truncation in safe_delay_store() md: check for memory allocation failure in faulty personality md: build failure due to missing delay.h md: Relax minimum size restrictions on chunk_size. md: remove space after function name in declaration and call. md: Remove unnecessary #includes, #defines, and function declarations. md: Convert remaining 1k representations in linear.c to sectors. md: linear.c: Make two local variables sector-based. md: linear: Represent dev_info->size and dev_info->offset in sectors. md: linear.c: Remove broken debug code. md: linear.c: Remove pointless initialization of curr_offset. md: linear.c: Fix typo in comment. md: Don't try to set an array to 'read-auto' if it is already in that state. md: Allow metadata_version to be updated for externally managed metadata. md: Fix rdev_size_store with size == 0
2008-10-16Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (32 commits) Input: wm97xx - update email address for Liam Girdwood Input: i8042 - add Thinkpad R31 to nomux list Input: move map_to_7segment.h to include/linux Input: ads7846 - fix cache line sharing issue Input: cm109 - add missing newlines to messages Input: document i8042.debug in kernel-parameters.txt Input: keyboard - fix potential out of bound access to key_map Input: psmouse - add OLPC touchpad driver Input: psmouse - tweak PSMOUSE_DEFINE_ATTR to support raw set callbacks Input: psmouse - add psmouse_queue_work() for ps/2 extension to make use of Input: psmouse - export psmouse_set_state for ps/2 extensions to use Input: ads7846 - introduce .gpio_pendown to get pendown state Input: ALPS - add signature for DualPoint found in Dell Latitude E6500 Input: serio_raw - allow attaching to translated (SERIO_I8042XL) ports Input: cm109 - don't use obsolete logging macros Input: atkbd - expand Latitude's force release quirk to other Dells Input: bf54x-keys - add power management support Input: atmel_tsadcc - improve accuracy Input: convert drivers to use strict_strtoul() Input: appletouch - handle geyser 3/4 status bits ...
2008-10-16rtc: rtc-ds1286 and rtc-m48t35 need <linux/io.h>Geert Uytterhoeven
With m68k allmodconfig, I get: | drivers/rtc/rtc-ds1286.c: In function 'ds1286_rtc_read': | drivers/rtc/rtc-ds1286.c:33: error: implicit declaration of function '__raw_readl' | drivers/rtc/rtc-ds1286.c: In function 'ds1286_rtc_write': | drivers/rtc/rtc-ds1286.c:38: error: implicit declaration of function '__raw_writel' | drivers/rtc/rtc-ds1286.c: In function 'ds1286_probe': | drivers/rtc/rtc-ds1286.c:345: error: implicit declaration of function 'ioremap' | drivers/rtc/rtc-ds1286.c:345: warning: assignment makes pointer from integer without a cast | drivers/rtc/rtc-ds1286.c:365: error: implicit declaration of function 'iounmap' and | drivers/rtc/rtc-m48t35.c: In function 'm48t35_read_time': | drivers/rtc/rtc-m48t35.c:59: error: implicit declaration of function 'readb' | drivers/rtc/rtc-m48t35.c:60: error: implicit declaration of function 'writeb' | drivers/rtc/rtc-m48t35.c: In function 'm48t35_probe': | drivers/rtc/rtc-m48t35.c:168: error: implicit declaration of function 'ioremap' | drivers/rtc/rtc-m48t35.c:168: warning: assignment makes pointer from integer without a cast | drivers/rtc/rtc-m48t35.c:188: error: implicit declaration of function 'iounmap' Include <linux/io.h> to get access to the I/O API. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: blacklist additional SoundGraph iMon LCD models HID: fix/improve help texts for quirk drivers HID: fix default building of HID-quirk drivers
2008-10-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits) decnet: Fix compiler warning in dn_dev.c IPV6: Fix default gateway criteria wrt. HIGH/LOW preference radv option net/802/fc.c: Fix compilation warnings netns: correct mib stats in ip6_route_me_harder() netns: fix net_generic array leak rt2x00: fix regression introduced by "mac80211: free up 2 bytes in skb->cb" rtl8187: Add USB ID for Belkin F5D7050 with RTL8187B chip p54usb: Device ID updates mac80211: fixme for kernel-doc ath9k/mac80211: disallow fragmentation in ath9k, report to userspace libertas : Remove unused variable warning for "old_channel" from cmd.c mac80211: Fix scan RX processing oops orinoco: fix unsafe locking in spectrum_cs_suspend orinoco: fix unsafe locking in orinoco_cs_resume cfg80211: fix debugfs error handling mac80211: fix debugfs netdev rename iwlwifi: fix ct kill configuration for 5350 mac80211: fix HT information element parsing p54: Fix compilation problem on PPC mac80211: fix debugfs lockup ...
2008-10-16Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (51 commits) [ARM] 5308/1: Fix Viper ISA IRQ handling [ARM] 5307/1: pxa: fix CM-X2XX PCMCIA build error [ARM] 5306/1: pxa: fix build error on CM-X270 [ARM] 5302/1: ARM: OMAP: Revert omap3 WDT changes to avoid merge conflict [ARM] 5305/1: ARM: OMAP: Fix compile of McBSP by removing unnecessary check [ARM] 5301/1: ARM: OMAP: Add missing irq defines ARM: OMAP3: Add default kernel config for OMAP LDP ARM: OMAP3: Add basic board support for OMAP LDP ARM: OMAP3: Defconfig for the Gumstix Overo board (rev 3) ARM: OMAP3: Add support for the Gumstix Overo board (rev 3) ARM: OMAP3: Add Beagle defconfig ARM: OMAP3: Add minimal Beagle board support ARM: OMAP3: Add minimal omap3430 support ARM: OMAP2: Fix sparse, checkpatch warnings in OMAP2/3 IRQ code ARM: OMAP: Fixes to omap_mcbsp_request function ARM: OMAP: Add support for OMAP2430 in McBSP ARM: OMAP: Add support for McBSP devices 3 - 5 on 34xx ARM: OMAP: Allocate McBSP devices dynamically Fix sections for omap-mcbsp platform driver [ARM] S3C24XX: Additional include moves ...
2008-10-16drivers/net/xen-netfront.c: Use DIV_ROUND_UPJulia Lawall
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @haskernel@ @@ #include <linux/kernel.h> @depends on haskernel@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)) / d + DIV_ROUND_UP(n,d) ) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP((n),d) + DIV_ROUND_UP(n,d) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP(n,(d)) + DIV_ROUND_UP(n,d) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16make hp_wmi_notify() staticAdrian Bunk
Make the needlessly global hp_wmi_notify() static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16resource: add resource_type() and IORESOURCE_TYPE_BITSMagnus Damm
Add resource_type() and IORESOURCE_TYPE_BITS. They make it easier to add more resource types without having to rewrite tons of code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16GRU driver: minor updatesJack Steiner
A few minor updates for the GRU driver. - documentation changes found in code reviews - changes to #ifdefs to make them recognized by "unifdef" (used in simulator testing) - change GRU context load/unload to prefetch data [akpm@linux-foundation.org: fix typo in comment] Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16w1: new driver. DS2431 chipBernhard Weirich
[akpm@linux-foundation.org: minor fixlets and cleanups] Signed-off-by: Bernhard Weirich <bernhard.weirich@riedel.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Ben Gardner <bgardner@wabtec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c optimize ds_set_pullupDavid Fries
Optimize the ds_set_pullup function. For a strong pullup to be sent the ds2490 has to have both the strong pullup mode enabled, and the specific write operation has to have the SPU bit enabled. Previously the write always had the SPU bit enabled and both the duration and model was set when a strong pullup was requested. Now the strong pullup mode is enabled at initialization time, the delay is updated only when the value changes, and the write SPU bit is set only when a strong pullup is required. This removes two or three bus transactions per strong pullup request. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c ds_write_block remove extra ds_wait_statusDavid Fries
Drop the extra ds_wait_status() in ds_write_block(). Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c magic number workDavid Fries
This replaces some magic numbers with marcos and corrects one marco. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c reset ds2490 in initDavid Fries
Reset the device in init as it can be in a bad state. This is necessary because a block write will wait for data to be placed in the output buffer and block any later commands which will keep accumulating and the device will not be idle. Another case is removing the ds2490 module while a bus search is in progress, somehow a few commands get through, but the input transfers fail leaving data in the input buffer. This will cause the next read to fail see the note in ds_recv_data. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c ds_reset remove ds_wait_statusDavid Fries
ds_reset no longer calls ds_wait_status, the result wasn't used and it would only delay the following data operations. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c ds_dump_status reworkDavid Fries
- add result register #defines - rename ds_dump_status to ds_print_msg - rename ds_recv_status to ds_dump_status - ds_dump_status prints the requested status and no longer reads the status, this is because the second status read can return different data for example the result register - the result register will be printed, though limited to detecting a new device, detecting other values such as a short would require additional reporting methods - ST_EPOF was moved to ds_wait_status to clear the error condition sooner Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c simplify and fix ds_touch_bitDavid Fries
Simplify and fix ds_touch_bit. If a device is attached in the middle of a bus search the status register will return more than the default 16 bytes. The additional bytes indicate that it has detected a new device. The way ds_wait_status is coded, if it doesn't read 16 status bytes it returns an error value. ds_touch_bit then will detect that error and return an error. In that case it doesn't read the input buffer and returns uninitialized data. It doesn't stop there. The next transaction will not expect the extra byte in the input buffer and the short read will cause an error and clear out both the old byte and new data in the input buffer. Just ignore the value of ds_wait_status. It is still required to wait until ds2490 is again idle and there is data to read when ds_recv_data is called. This also removes the while loop. None of the other commands wait and verify that the issued command is in the status register. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c disable bit read and writeDavid Fries
Don't export read and write bit operations, they didn't work, they weren't used, and they can't be made to work. The one wire low level bit operations expect to set high or low levels, the ds2490 hardware only supports complete read or write time slots, better to just comment them out. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16W1: ds2490.c ds_write_bit, grouping error, disable readbackDavid Fries
ds_write_bit doesn't read the input buffer, so add COMM_ICP and a comment that it will no longer generate a read back data byte. If there is an extra data byte later on then it will cause an error and discard what data was there. Corrected operator ordering for ds_send_control. Signed-off-by: David Fries <david@fries.net> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>