safe/jmp/linux-2.6
14 years agohrtimer: Tune hrtimer_interrupt hang logic
Thomas Gleixner [Fri, 13 Nov 2009 16:05:44 +0000 (17:05 +0100)]
hrtimer: Tune hrtimer_interrupt hang logic

The hrtimer_interrupt hang logic adjusts min_delta_ns based on the
execution time of the hrtimer callbacks.

This is error-prone for virtual machines, where a guest vcpu can be
scheduled out during the execution of the callbacks (and the callbacks
themselves can do operations that translate to blocking operations in
the hypervisor), which in can lead to large min_delta_ns rendering the
system unusable.

Replace the current heuristics with something more reliable. Allow the
interrupt code to try 3 times to catch up with the lost time. If that
fails use the total time spent in the interrupt handler to defer the
next timer interrupt so the system can catch up with other things
which got delayed. Limit that deferment to 100ms.

The retry events and the maximum time spent in the interrupt handler
are recorded and exposed via /proc/timer_list

Inspired by a patch from Marcelo.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
14 years agoMerge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Thu, 10 Dec 2009 03:57:06 +0000 (19:57 -0800)]
Merge branch 'acpica' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPICA: Update version to 20091112.
  ACPICA: Add additional module-level code support
  ACPICA: Deploy new create integer interface where appropriate
  ACPICA: New internal utility function to create Integer objects
  ACPICA: Add repair for predefined methods that must return sorted lists
  ACPICA: Fix possible fault if return Package objects contain NULL elements
  ACPICA: Add post-order callback to acpi_walk_namespace
  ACPICA: Change package length error message to an info message
  ACPICA: Reduce severity of predefined repair messages, Warning to Info
  ACPICA: Update version to 20091013
  ACPICA: Fix possible memory leak for Scope ASL operator
  ACPICA: Remove possibility of executing _REG methods twice
  ACPICA: Add repair for bad _MAT buffers
  ACPICA: Add repair for bad _BIF/_BIX packages

14 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
Linus Torvalds [Thu, 10 Dec 2009 03:53:11 +0000 (19:53 -0800)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: (41 commits)
  hwmon: (adt7475) Add VID support for the ADT7476
  hwmon: (adt7475) Add an entry in MAINTAINERS
  hwmon: (adt7475) Add support for the ADT7476
  hwmon: (adt7475) Voltage attenuators can be bypassed
  hwmon: (adt7475) Print device information on probe
  hwmon: (adt7475) Handle alternative pin functions
  hwmon: (adt7475) Move sysfs files removal to a separate function
  hwmon: (adt7475) Add support for the ADT7490
  hwmon: (adt7475) Improve device detection
  hwmon: (adt7475) Add missing static marker
  hwmon: (adt7475) Rework voltage inputs handling
  hwmon: (adt7475) Implement pwm_use_point2_pwm_at_crit
  hwmon: (adt7475) New documentation
  hwmon: (adt7475) Add support for the ADT7473
  hwmon: (f71882fg) Add support for the f71889fg (version 2)
  hwmon: (f71882fg) Fix sysfs file removal
  hwmon: (f71882fg) Cleanup sysfs attr creation 2/2
  hwmon: (f71882fg) Cleanup sysfs attr creation 1/2
  hwmon: (thmc50) Stop using I2C_CLIENT_MODULE_PARM
  hwmon: Add Freescale MC13783 ADC driver
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:52:13 +0000 (19:52 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume
  ALSA: hda/realtek: quirk for D945GCLF2 mainboard
  ALSA: hda - Terradici HDA controllers does not support 64-bit mode
  ALSA: document: Add direct git link to grub hda-analyzer
  ALSA: radio/sound/miro: fix build, cleanup depends/selects
  ALSA: hda - Generalize EAPD inversion check in patch_analog.c
  ASoC: Wrong variable returned on error
  ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII
  ALSA: hda - Exclude unusable ADCs for ALC88x
  ALSA: hda - Add missing Line-Out and PCM switches as slave
  ALSA: hda - iMac 9,1 sound patch.
  ALSA: opti93x: set MC indirect registers base from PnP data

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Thu, 10 Dec 2009 03:52:01 +0000 (19:52 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits)
  Input: appletouch - give up maintainership
  Input: dm355evm_kbd - switch to using sparse keymap library
  Input: wistron_btns - switch to using sparse keymap library
  Input: add generic support for sparse keymaps
  Input: fix memory leak in force feedback core
  Input: wistron - remove identification strings from DMI table
  Input: psmouse - remove identification strings from DMI tables
  Input: atkbd - remove identification strings from DMI table
  Input: i8042 - remove identification strings from DMI tables
  DMI: allow omitting ident strings in DMI tables
  Input: psmouse - do not carry DMI data around
  Input: matrix-keypad - switch to using dev_pm_ops
  Input: keyboard - fix lack of locking when traversing handler->h_list
  Input: gpio_keys - scan gpio state at probe and resume time
  Input: keyboard - add locking around event handling
  Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller
  Input: xpad - add two new Xbox 360 devices
  Input: polled device - do not start polling if interval is zero
  Input: polled device - schedule first poll immediately
  Input: add S3C24XX touchscreen driver
  ...

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Thu, 10 Dec 2009 03:50:49 +0000 (19:50 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (345 commits)
  V4L/DVB (13542): ir-keytable: Allow dynamic table change
  V4L/DVB (13541): atbm8830: replace 64-bit division and floating point usage
  V4L/DVB (13540): ir-common: Cleanup get key evdev code
  V4L/DVB (13539): ir-common: add __func__ for debug messages
  V4L/DVB (13538): ir-common: Use a dynamic keycode table
  V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation
  V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller
  V4L/DVB (13535): ir-common: Add a hauppauge new table with the complete RC5 code
  V4L/DVB (13534): ir-common: Remove some unused fields/structs
  V4L/DVB (13533): ir: use dynamic tables, instead of static ones
  V4L/DVB (13532): ir-common: Add infrastructure to use a dynamic keycode table
  V4L/DVB (13531): ir-common: rename the debug routine to allow exporting it
  V4L/DVB (13458): go7007: subdev conversion
  V4L/DVB (13457): s2250: subdev conversion
  V4L/DVB (13456): s2250: Change module structure
  V4L/DVB (13528): em28xx: add support for em2800 VC211A card
  em28xx: don't reduce scale to half size for em2800
  em28xx: don't load audio modules when AC97 is mis-detected
  em28xx: em2800 chips support max width of 640
  V4L/DVB (13523): dvb-bt8xx: fix compile warning
  ...

Fix up trivial conflicts due to spelling fixes from the trivial tree in
Documentation/video4linux/gspca.txt
drivers/media/video/cx18/cx18-mailbox.h

14 years agoMerge branch 'next-i2c' of git://git.fluff.org/bjdooks/linux
Linus Torvalds [Thu, 10 Dec 2009 03:46:12 +0000 (19:46 -0800)]
Merge branch 'next-i2c' of git://git.fluff.org/bjdooks/linux

* 'next-i2c' of git://git.fluff.org/bjdooks/linux: (25 commits)
  i2c-pnx: Map I2C adapter number to platform ID number
  i2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode
  i2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg() for NOACK cases
  i2c-designware: Cosmetic cleanups
  i2c-designware: Tx abort cleanups
  i2c-designware: Skip RX_FULL and TX_EMPTY bits on tx abort errors
  i2c-designware: i2c_dw_xfer_msg: Fix error handling procedures
  i2c-designware: Disable TX_EMPTY when all i2c_msg msgs has been processed
  i2c-designware: Process all i2c_msg messages in the interrupt handler
  i2c-designware: i2c_dw_read: Remove redundant target address checker
  i2c-designware: i2c_dw_func: Set I2C_FUNC_SMBUS_foo bits
  i2c-designware: Initialize byte count variables just prior to being used
  i2c-designware: i2c_dw_xfer_msg: Introduce a local "buf" pointer
  i2c-designware: Divide i2c_dw_xfer_msg into two functions
  i2c-designware: Enable RX_FULL interrupt
  i2c-designware: Set Tx/Rx FIFO threshold levels
  i2c-designware: Process i2c_msg messages in the interrupt handler
  i2c-designware: i2c_dw_xfer_msg: Fix i2c_msg search bug
  i2c-designware: Improved _HCNT/_LCNT calculation
  i2c-designware: Remove an useless local variable "num"
  ...

14 years agoMerge branch 's3c24xx-updates' of git://git.fluff.org/bjdooks/linux
Linus Torvalds [Thu, 10 Dec 2009 03:45:58 +0000 (19:45 -0800)]
Merge branch 's3c24xx-updates' of git://git.fluff.org/bjdooks/linux

* 's3c24xx-updates' of git://git.fluff.org/bjdooks/linux:
  ARM: S3C24XX: DMA: Use valid index when accessing array
  ARM: S3C: move s3c_pwm_remove to .devexit.text
  ARM: S3C24XX: Export s3c24xx_set_fiq for modules.
  ARM: S3C: move s3c_adc_remove to .devexit.text

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:45:38 +0000 (19:45 -0800)]
Merge git://git./linux/kernel/git/davem/ide-next-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6:
  sl82c105: remove no longer needed debugging code
  sis5513: remove stale TODO
  pdc202xx_old: remove no longer needed debugging code
  cy82c693: remove no longer needed debugging code
  cmd64x: remove no longer needed debugging code
  alim15x3: remove obsolete and dangerous wdc_udma parameter
  ide: Increase WAIT_DRQ to accomodate some CF cards and SSD drives.
  cs5535: add pci id for AMD based CS5535 controllers
  slc90e66: fix UDMA handling
  drivers/ide/tx4938ide.c: use resource_size()
  drivers/ide/ide_platform.c: use resource_size()
  drivers/ide/au1xxx-ide.c: use resource_size()
  hpt366: remove dead old timing tables
  ide: update Kconfig text to mark as deprecated
  ide-tape: remove the BKL
  hpt366: kill unused #define's

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Linus Torvalds [Thu, 10 Dec 2009 03:43:33 +0000 (19:43 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/trivial

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
  tree-wide: fix misspelling of "definition" in comments
  reiserfs: fix misspelling of "journaled"
  doc: Fix a typo in slub.txt.
  inotify: remove superfluous return code check
  hdlc: spelling fix in find_pvc() comment
  doc: fix regulator docs cut-and-pasteism
  mtd: Fix comment in Kconfig
  doc: Fix IRQ chip docs
  tree-wide: fix assorted typos all over the place
  drivers/ata/libata-sff.c: comment spelling fixes
  fix typos/grammos in Documentation/edac.txt
  sysctl: add missing comments
  fs/debugfs/inode.c: fix comment typos
  sgivwfb: Make use of ARRAY_SIZE.
  sky2: fix sky2_link_down copy/paste comment error
  tree-wide: fix typos "couter" -> "counter"
  tree-wide: fix typos "offest" -> "offset"
  fix kerneldoc for set_irq_msi()
  spidev: fix double "of of" in comment
  comment typo fix: sybsystem -> subsystem
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Thu, 10 Dec 2009 03:43:19 +0000 (19:43 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: add multi-input quirk for NextWindow Touchscreen.
  HID: add support for Acan FG-8100 barcode reader
  HID: make Media key on Logitech DiNovo Mini work
  HID: support Logitech/3DConnexion SpaceTraveler and SpaceNavigator
  HID: remove BKL from hiddev_ioctl_usage()
  HID: fixup quirk for NCR devices
  HID: pidff - fix unnecessary loop iterations on reset
  HID: add NOGET quirk for another device from CH Products
  HID: remove useless DRIVER_VERSION macro
  HID: fix MODULE_AUTHOR usage in HID modules
  HID: blacklist Acer Ferrari 4005 optical mouse

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:42:25 +0000 (19:42 -0800)]
Merge git://git./linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
  [SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
  [SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
  [SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
  [SCSI] zfcp: Update FSF error reporting
  [SCSI] zfcp: Improve ELS ADISC handling
  [SCSI] zfcp: Simplify handling of ct and els requests
  [SCSI] zfcp: Remove ZFCP_DID_MASK
  [SCSI] zfcp: Move WKA port to zfcp FC code
  [SCSI] zfcp: Use common code definitions for FC CT structs
  [SCSI] zfcp: Use common code definitions for FC ELS structs
  [SCSI] zfcp: Update FCP protocol related code
  [SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
  [SCSI] zfcp: Assign scheduled work to driver queue
  [SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
  [SCSI] zfcp: Implement module unloading
  [SCSI] zfcp: Merge trace code for fsf requests in one function
  [SCSI] zfcp: Access ports and units with container_of in sysfs code
  [SCSI] zfcp: Remove suspend callback
  [SCSI] zfcp: Remove global config_mutex
  [SCSI] zfcp: Replace local reference counting with common kref
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Linus Torvalds [Thu, 10 Dec 2009 03:09:42 +0000 (19:09 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/gerg/m68knommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68knommu: export clk_* symbols in clk.c
  m68knommu: Split the .init section into INIT_TEXT_SECTION and INIT_DATA_SECTION.
  m68knommu: Move __init_end out of the .init section.
  m68knommu: Move __init_begin out of the .init section.
  m68knommu: Use more macros inside the .init section.
  m68knommu: Use INIT_TASK_DATA and CACHELINE_ALIGNED_DATA.
  m68knommu: Make THREAD_SIZE available to assembly files.
  m68knommu: Don't hardcode the value of PAGE_SIZE in the linker script.
  m68knommu: rename BSS define in linker script
  m68knommu: add a task_pt_regs() macro
  m68knommu: define arch_has_single_step() and friends
  m68knommu: add uboot commandline argument passing support
  m68knommu: Coldfire GPIO corrections
  m68knommu: move mcf_remove to .devexit.text

Fixed up (?) conflict in arch/m68k/include/asm/ptrace.h

14 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:03:49 +0000 (19:03 -0800)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Fix cut/paste detritus from unistd.h

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:03:16 +0000 (19:03 -0800)]
Merge git://git./linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (137 commits)
  sh: include empty zero page in romImage
  sh: Make associative cache writes fatal on all SH-4A parts.
  sh: Drop associative writes for SH-4 cache flushes.
  sh: Partial revert of copy/clear_user_highpage() optimizations.
  sh: Add default uImage rule for se7724, ap325rxa, and migor.
  sh: allow runtime pm without suspend/resume callbacks
  sh: mach-ecovec24: Remove un-defined settings for VPU
  sh: mach-ecovec24: LCDC drive ability become high
  sh: fix sh7724 VEU3F resource size
  serial: sh-sci: Fix too early port disabling.
  sh: pfc: pr_info() -> pr_debug() cleanups.
  sh: pfc: Convert from ctrl_xxx() to __raw_xxx() I/O routines.
  sh: Improve kfr2r09 serial port setup code
  sh: Break out SuperH PFC code
  sh: Move KEYSC header file
  sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
  sh: Add CPG save/restore code for sh7724 R-standby
  sh: Add SDHI power control support to Ecovec
  mfd: Add power control platform data to SDHI driver
  sh: mach-ecovec24: modify address map
  ...

14 years agoMerge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 10 Dec 2009 03:02:46 +0000 (19:02 -0800)]
Merge branch 'davinci-for-linus' of git://git./linux/kernel/git/khilman/linux-davinci

* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (69 commits)
  davinci: Initial support for Neuros OSD2 platform.
  davinci: remove unused variable in arch/arm/mach-davinci/board-sffsdr.c
  davinci: fix section mismatch warning in arch/arm/mach-davinci/board-dm646x-evm.c
  DaVinci: DM365: Enable DaVinci RTC support for DM365 EVM
  DA8xx/OMAP-L1xx: Add high speed SD/MMC capabilities
  davinci: DA8XX/OMAP-L1XX: enable cpuidle and regulator in defconfig
  davinci: DA850/OMAP-L138: avoid using separate initcall for initializing regulator
  davinci: DA850/OMAP-L138 EVM: register for cpuidle support
  davinci: DA8XX/OMAP-L1XX: add support for cpuidle driver register
  davinci: add CPU idle driver
  davinci: DA8XX/OMAP-L1XX: fix compiler warning
  davinci: DA850/OMAP-L138: eliminate static function declaration
  davinci: DA850/OMAP-L138 EVM: simplify configuration of emac in MII/RMII mode
  davinci: DA850/OMAP-L138 EVM: get rid of DA850_UI_EXP config option
  davinci: DA850/OMAP-L138 EVM: implement autodetect of RMII PHY
  davinci: DA830/OMAP-L137 EVM: do not configure NAND on UI card when MMC/SD is selected
  davinci: DA830/OMAP-L137 EVM: use runtime detection for UI card
  davinci: DA830/OMAP-L137 EVM: remove ifdefs inside da830_evm_init()
  davinci: DA830/OMAP-L137 EVM: fix warning with default config
  davinci: Add NAND support for DA830/OMAP-L137 EVM platform
  ...

14 years agoMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Thu, 10 Dec 2009 03:01:47 +0000 (19:01 -0800)]
Merge branch 'for-linus' of git://git390.marist.edu/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (72 commits)
  [S390] 3215/3270 console: remove wrong comment
  [S390] dasd: remove BKL from extended error reporting code
  [S390] vmlogrdr: remove BKL
  [S390] vmur: remove BKL
  [S390] zcrypt: remove BKL
  [S390] 3270: remove BKL
  [S390] vmwatchdog: remove lock_kernel() from open() function
  [S390] monwriter: remove lock_kernel() from open() function
  [S390] monreader: remove lock_kernel() from open() function
  [S390] s390: remove unused nfsd #includes
  [S390] ftrace: build ftrace.o when CONFIG_FTRACE_SYSCALLS is set for s390
  [S390] etr/stp: put correct per cpu variable
  [S390] tty3270: move keyboard compat ioctls
  [S390] sclp: improve servicability setting
  [S390] s390: use change recording override for kernel mapping
  [S390] MAINTAINERS: Add s390 drivers block
  [S390] use generic sockios.h header file
  [S390] use generic termbits.h header file
  [S390] smp: remove unused typedef and defines
  [S390] cmm: free pages on hibernate.
  ...

14 years agoDoc: use misc-devices/ dir for drivers
Jean Delvare [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
Doc: use misc-devices/ dir for drivers

We have a directory for misc drivers documentation, let's use it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoDoc: better explanation of procs_running
Luis Garces-Erice [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
Doc: better explanation of procs_running

the description in Documentation/filesystems/proc.txt of the
procs_running entry in /proc/stat is confusing (according to that
description, it looks as if procs_running could only be a number
between 0 and the number of CPUs).

Changed it to a more accurate description in the patch attached.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agocorrect gpio.txt typos
Dominik D. Geyer [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
correct gpio.txt typos

Corrected sysfs gpio chip node name and fixed punctuation.

Signed-off-by: Dominik D. Geyer <dominik.geyer@gmx.de>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agodocbook: fix signal_pending() argument
Shawn Bohrer [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
docbook: fix signal_pending() argument

Since signal_pending() takes a task_struct pointer as an argument, update
the example to pass in 'current'.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agouse DMA_BIT_MASK instead of inline constant
Marin Mitov [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
use DMA_BIT_MASK instead of inline constant

Use DMA_BIT_MASK(24) instead of 0x00ffffff in DMA-mapping.txt

Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoUse KERN_WARNING instead of KERN_WARN, which does not exist
Randy Dunlap [Mon, 7 Dec 2009 02:30:44 +0000 (18:30 -0800)]
Use KERN_WARNING instead of KERN_WARN, which does not exist

Reported-by: Andrew Lyon <andrew.lyon@gmail.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agonvram: Fix missing smp_lock.h in nvram
Frederic Weisbecker [Wed, 9 Dec 2009 17:31:53 +0000 (18:31 +0100)]
nvram: Fix missing smp_lock.h in nvram

The bkl has been removed from nvram_llseek() and smp_lock.h was removed
because another patch in the same tree zapped the remaining usage of bkl
in the same file.  But this patch must have been excluded later, then we
still need the smp_lock.h headers for the bkl use in nvram_open().

This fixes the following build error:

  drivers/char/nvram.c: In function ‘nvram_open’:
  drivers/char/nvram.c:332: erreur: implicit declaration of function ‘lock_kernel’
  drivers/char/nvram.c:339: erreur: implicit declaration of function ‘unlock_kernel’
  make[2]: *** [drivers/char/nvram.o] Erreur 1
  make[1]: *** [drivers/char] Erreur 2
  make: *** [drivers] Erreur 2

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agohwmon: (adt7475) Add VID support for the ADT7476
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add VID support for the ADT7476

The ADT7476 has 5 dedicated pins for VID input, and the +12V input can
optionally be used as a 6th VID pin. Add support for VID input.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Add an entry in MAINTAINERS
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add an entry in MAINTAINERS

As I've just done a lot of changes to the adt7475 driver, I volunteer
to maintain it for the year to come.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Add support for the ADT7476
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7476

Add support for the Analog Devices ADT7476 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 5 voltage inputs instead of 2, and VID input
pins.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Voltage attenuators can be bypassed
Jean Delvare [Wed, 9 Dec 2009 19:36:07 +0000 (20:36 +0100)]
hwmon: (adt7475) Voltage attenuators can be bypassed

It is possible to bypass the voltage attenuators on the +2.5V, Vccp,
+5V and +12V voltage monitoring inputs. This is useful to connect
other voltage channels than the ones the monitoring chip was
originally designed for. When this feature is enabled, we must not
include the scaling factors in our computations.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Print device information on probe
Jean Delvare [Wed, 9 Dec 2009 19:36:07 +0000 (20:36 +0100)]
hwmon: (adt7475) Print device information on probe

Print the device name and revision at probe time, as well as a list of
all optional features which are available.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Handle alternative pin functions
Jean Delvare [Wed, 9 Dec 2009 19:36:06 +0000 (20:36 +0100)]
hwmon: (adt7475) Handle alternative pin functions

The TACH4 pin can be used for other functions, so fan4 may not always
be available. Likewise, the PWM2 pin can be used for ALERT output, in
which case pwm2 is not available

For the ADT7490, the +2.5 Vin pin may also be used for other
functions, in which case in0 is not available.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Move sysfs files removal to a separate function
Jean Delvare [Wed, 9 Dec 2009 19:36:06 +0000 (20:36 +0100)]
hwmon: (adt7475) Move sysfs files removal to a separate function

Move sysfs files removal to a separate function. The code is common to
the device probing error path and the standard device removal path. As
it will grow with future driver development, this avoids code
duplication.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Add support for the ADT7490
Jean Delvare [Wed, 9 Dec 2009 19:36:05 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7490

Add support for the Analog Devices ADT7490 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 6 voltage inputs instead of 2.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Improve device detection
Jean Delvare [Wed, 9 Dec 2009 19:36:04 +0000 (20:36 +0100)]
hwmon: (adt7475) Improve device detection

Check the value of register 0x3f as part of the device detection, to
make it more robust.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Add missing static marker
Jean Delvare [Wed, 9 Dec 2009 19:36:03 +0000 (20:36 +0100)]
hwmon: (adt7475) Add missing static marker

adt7475_attr_group is used internally only and can thus be marked
static.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Rework voltage inputs handling
Jean Delvare [Wed, 9 Dec 2009 19:36:03 +0000 (20:36 +0100)]
hwmon: (adt7475) Rework voltage inputs handling

Rework the handling of voltage inputs to make it possible and easy to
support more inputs. This will be needed for the upcoming ADT7490
support.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Implement pwm_use_point2_pwm_at_crit
Jean Delvare [Wed, 9 Dec 2009 19:36:03 +0000 (20:36 +0100)]
hwmon: (adt7475) Implement pwm_use_point2_pwm_at_crit

Implement the non-standard pwm_use_point2_pwm_at_crit sysfs attribute
as the adt7473 driver did.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) New documentation
Jean Delvare [Wed, 9 Dec 2009 19:36:02 +0000 (20:36 +0100)]
hwmon: (adt7475) New documentation

New documentation for the adt7475 driver, based on the adt7473 driver
documentation. It is IMHO much more useful that the previous
documentation which was essentially redundant with sysfs-interface.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (adt7475) Add support for the ADT7473
Jean Delvare [Wed, 9 Dec 2009 19:36:02 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7473

Add support for the ADT7473 to the adt7475 driver, and mark the
adt7473 driver for removal. The ADT7473 and ADT7475 chips are almost
the same chip and essentially compatible, so there's no point in
having separate drivers for them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
14 years agohwmon: (f71882fg) Add support for the f71889fg (version 2)
Hans de Goede [Wed, 9 Dec 2009 19:36:01 +0000 (20:36 +0100)]
hwmon: (f71882fg) Add support for the f71889fg (version 2)

This adds support for the Fintek f71889fg to the f71882fg driver,
many thanks to Gerd v. Egidy for providing (remote) access to a
machine which such an ic.

Note that this bit of the patch:
- val = SENSORS_LIMIT(val, 0, 255);
+
+ if (data->type == f71889fg)
+ val = SENSORS_LIMIT(val, -128, 127);
+ else
+ val = SENSORS_LIMIT(val, 0, 127);

Changes behaviour for already supported models, the new behaviour is correct
as the already supported models have bit 7 of the involved registers fixed at
0, so the previous behaviour which allowed setting temp zone limits > 127
was not correct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (f71882fg) Fix sysfs file removal
Hans de Goede [Wed, 9 Dec 2009 19:36:01 +0000 (20:36 +0100)]
hwmon: (f71882fg) Fix sysfs file removal

There is a bug in the old sysfs file removal, as it uses fxxxx_in_temp_attr
to remove the in and temp sysfs attributes, but fxxxx_in_temp_attr has
temp#_alarm, where as f71858fg_in_temp_attr has temp#_max_alarm, so
the temp#_max_alarm attributes for the f71858fg never get removed.

This patch fixes this by doing the sysfs removal exactly the same way as
the creation instead of being (too) clever, this will also avoid similar
bugs in the future.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (f71882fg) Cleanup sysfs attr creation 2/2
Hans de Goede [Wed, 9 Dec 2009 19:36:00 +0000 (20:36 +0100)]
hwmon: (f71882fg) Cleanup sysfs attr creation 2/2

This patch merges the f71882fg_auto_pwm_attr array into the
fxxxx_fan_attr resp. fxxxx_auto_pwm_attr array, as the f71882fg_auto_pwm_attr
array was merely extending these 2 with entries for a 4th fan, it also makes
these 2 arrays 2 dimensional so that the rest of the code can choose to
add attr for 3 or 4 fans without needing to know the nr of attr per fan.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (f71882fg) Cleanup sysfs attr creation 1/2
Hans de Goede [Wed, 9 Dec 2009 19:35:59 +0000 (20:35 +0100)]
hwmon: (f71882fg) Cleanup sysfs attr creation 1/2

This patch makes a number of cleanups to the sysfs attr creation
in the f71882fg driver, this is a preparation patch for adding f71889fg
support:

* Add some comments to explain why some models need separate sysfs attr
  arrays for in / temp / fan / pwm
* Rename a number of sysfs attr arrays to make their function clearer
* Move the pwm#_auto_channels_temp attribute from the common to all
  models fan attr array to the per model auto mode pwm attr arrays, so
  that all the auto mode pwm attr are grouped together, and thus can be
  left out on models where we don't support auto pwm mode
* Put fan_beep attr in their own array, so that only auto mode pwm attr
  remain in the per model pwm sysfs attr arrays.
* Put the 4th special fan input for the f8000 in its own array, so that only
  auto mode pwm attr remain in the per model pwm sysfs attr arrays.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (thmc50) Stop using I2C_CLIENT_MODULE_PARM
Jean Delvare [Wed, 9 Dec 2009 19:35:59 +0000 (20:35 +0100)]
hwmon: (thmc50) Stop using I2C_CLIENT_MODULE_PARM

The thmc50 driver is the last user of I2C_CLIENT_MODULE_PARM, and I
would like to get rid of that macro.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Krzysztof Helt <krzysztof.h1@wp.pl>
14 years agohwmon: Add Freescale MC13783 ADC driver
Luotao Fu [Wed, 9 Dec 2009 19:35:58 +0000 (20:35 +0100)]
hwmon: Add Freescale MC13783 ADC driver

This driver provides support for the ADC integrated into the
Freescale MC13783 PMIC.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Cc: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (w83791d) Remove experimental dependency
Marc Hulsman [Wed, 9 Dec 2009 19:35:58 +0000 (20:35 +0100)]
hwmon: (w83791d) Remove experimental dependency

The w83791d driver has been in the kernel for a while now,
time to remove the EXPERIMENTAL dependency.

Signed-off-by: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: Clean up detect functions
Jean Delvare [Wed, 9 Dec 2009 19:35:57 +0000 (20:35 +0100)]
hwmon: Clean up detect functions

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Juerg Haefliger <juergh@gmail.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Acked-by: "Hans J. Koch" <hjk@linutronix.de>
Cc: Rudolf Marek <r.marek@assembler.cz>
14 years agohwmon: (w83l785ts) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:56 +0000 (20:35 +0100)]
hwmon: (w83l785ts) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (w83792d) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:56 +0000 (20:35 +0100)]
hwmon: (w83792d) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (w83791d) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:55 +0000 (20:35 +0100)]
hwmon: (w83791d) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Marc Hulsman <m.hulsman@tudelft.nl>
14 years agohwmon: (w83781d) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:54 +0000 (20:35 +0100)]
hwmon: (w83781d) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (tmp401/tmp421) Clean up detect functions
Jean Delvare [Wed, 9 Dec 2009 19:35:54 +0000 (20:35 +0100)]
hwmon: (tmp401/tmp421) Clean up detect functions

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Andre Prendel <andre.prendel@gmx.de>
14 years agohwmon: (lm90) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:53 +0000 (20:35 +0100)]
hwmon: (lm90) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (lm85) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:53 +0000 (20:35 +0100)]
hwmon: (lm85) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (lm83) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:52 +0000 (20:35 +0100)]
hwmon: (lm83) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (lm77) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:52 +0000 (20:35 +0100)]
hwmon: (lm77) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (adm1025) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:51 +0000 (20:35 +0100)]
hwmon: (adm1025) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (adm1021) Clean up detect function
Jean Delvare [Wed, 9 Dec 2009 19:35:51 +0000 (20:35 +0100)]
hwmon: (adm1021) Clean up detect function

As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: New driver for the National Semiconductor LM73
Adrien Demarez [Wed, 9 Dec 2009 19:35:50 +0000 (20:35 +0100)]
hwmon: New driver for the National Semiconductor LM73

The National Semiconductor LM73 is a single temperature sensor, much
like the famous LM75.

Signed-off-by: Adrien Demarez <adrien.demarez@bolloretelecom.eu>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (w83627hf) Stop using globals for I/O port numbers
Jean Delvare [Wed, 9 Dec 2009 19:35:49 +0000 (20:35 +0100)]
hwmon: (w83627hf) Stop using globals for I/O port numbers

Stop using global variables REG and VAL for I/O port numbers. This is
ugly and unsafe.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rodolfo Giometti <giometti@linux.it>
14 years agohwmon: (w83627hf) Drop the force_addr module parameter
Jean Delvare [Wed, 9 Dec 2009 19:35:48 +0000 (20:35 +0100)]
hwmon: (w83627hf) Drop the force_addr module parameter

This module parameter is there to workaround broken BIOS. I'm not even
sure if it was used in the past 5 years, and it gets in the way of
converting the driver to the MFD infrastructure. So tell the users how
they can do the same from user-space.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rodolfo Giometti <giometti@linux.it>
14 years agohwmon: (it87) Check for fan2 and fan3 availability
Jean Delvare [Wed, 9 Dec 2009 19:35:48 +0000 (20:35 +0100)]
hwmon: (it87) Check for fan2 and fan3 availability

The fan2 and fan3 input and output pins can be used as GPIOs. Check
their function before exposing their sysfs attributes and accessing
their registers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (it87) Verify the VID pin usage
Jean Delvare [Wed, 9 Dec 2009 19:35:47 +0000 (20:35 +0100)]
hwmon: (it87) Verify the VID pin usage

The VID input pins can alternatively be used as GPIOs. Make sure we
have at least 4 pins used for VID, otherwise don't bother reading and
exposing VID.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Adam Nielsen <a.nielsen@shikadi.net>
14 years agohwmon: Clarify autopwm trip points documentation
Jean Delvare [Wed, 9 Dec 2009 19:35:47 +0000 (20:35 +0100)]
hwmon: Clarify autopwm trip points documentation

Document the case of hybrid automatic fan speed control
implementations, where trip points are associated to both PWM output
channels and temperature input channels.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agoMAINTAINERS: Add missing hwmon files
Jean Delvare [Wed, 9 Dec 2009 19:35:46 +0000 (20:35 +0100)]
MAINTAINERS: Add missing hwmon files

Add missing documentation and header files to the hardware monitoring
subsystem section.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (s3c-hwmon) Fix build error
Ben Dooks [Wed, 9 Dec 2009 19:35:45 +0000 (20:35 +0100)]
hwmon: (s3c-hwmon) Fix build error

The previous patch, commit be4c23c93c4828d36ac9e1a88410618a61676426 was
from the wrong tree and thus broke the current build which had the
channel configuration name changed.

Fix the following build errors:

drivers/hwmon/s3c-hwmon.c: In function 's3c_hwmon_probe':
drivers/hwmon/s3c-hwmon.c:326: warning: initialization from incompatible pointer type
drivers/hwmon/s3c-hwmon.c:331: error: dereferencing pointer to incomplete type
drivers/hwmon/s3c-hwmon.c:336: error: dereferencing pointer to incomplete type

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agoMerge branch 'topic/asoc' into for-linus
Takashi Iwai [Wed, 9 Dec 2009 17:16:15 +0000 (18:16 +0100)]
Merge branch 'topic/asoc' into for-linus

14 years agoMerge branch 'topic/hda' into for-linus
Takashi Iwai [Wed, 9 Dec 2009 17:16:11 +0000 (18:16 +0100)]
Merge branch 'topic/hda' into for-linus

14 years agoMerge branch 'bkl-arch-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 9 Dec 2009 16:07:51 +0000 (08:07 -0800)]
Merge branch 'bkl-arch-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'bkl-arch-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  mn10300: Remove the BKL from sys_execve
  m68knommu: Remove the BKL from sys_execve
  m68k: Remove the BKL from sys_execve
  h83000: Remove BKL from sys_execve
  frv: Remove the BKL from sys_execve
  blackfin: Remove the BKL from sys_execve
  um: Remove BKL from mmapper
  um: Remove BKL from random
  s390: Remove BKL from prng

14 years agoMerge branch 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 9 Dec 2009 16:07:38 +0000 (08:07 -0800)]
Merge branch 'bkl-drivers-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  agp: Remove the BKL from agp_open
  inifiband: Remove BKL from ipath_open()
  mips: Remove BKL from tb0219
  drivers: Remove BKL from scx200_gpio
  drivers: Remove BKL from pc8736x_gpio
  parisc: Remove BKL from eisa_eeprom
  rtc: Remove BKL from efirtc
  input: Remove BKL from hp_sdc_rtc
  hw_random: Remove BKL from core
  macintosh: Remove BKL from ans-lcd
  nvram: Drop the bkl from non-generic nvram_llseek()
  nvram: Drop the bkl from nvram_llseek()
  mem_class: Drop the bkl from memory_open()
  spi: Remove BKL from spidev_open
  drivers: Remove BKL from cs5535_gpio
  drivers: Remove BKL from misc_open

14 years agoMerge branch 'bkl-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 9 Dec 2009 16:07:17 +0000 (08:07 -0800)]
Merge branch 'bkl-core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'bkl-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sys: Remove BKL from sys_reboot
  pm_qos: clean up racy global "name" variable
  pm_qos: remove BKL

14 years agoMerge branch 'reiserfs/kill-bkl' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 9 Dec 2009 15:58:15 +0000 (07:58 -0800)]
Merge branch 'reiserfs/kill-bkl' of git://git./linux/kernel/git/frederic/random-tracing

* 'reiserfs/kill-bkl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing: (31 commits)
  kill-the-bkl/reiserfs: turn GFP_ATOMIC flag to GFP_NOFS in reiserfs_get_block()
  kill-the-bkl/reiserfs: drop the fs race watchdog from _get_block_create_0()
  kill-the-bkl/reiserfs: definitely drop the bkl from reiserfs_ioctl()
  kill-the-bkl/reiserfs: always lock the ioctl path
  kill-the-bkl/reiserfs: fix reiserfs lock to cpu_add_remove_lock dependency
  kill-the-bkl/reiserfs: Fix induced mm->mmap_sem to sysfs_mutex dependency
  kill-the-bkl/reiserfs: panic in case of lock imbalance
  kill-the-bkl/reiserfs: fix recursive reiserfs write lock in reiserfs_commit_write()
  kill-the-bkl/reiserfs: fix recursive reiserfs lock in reiserfs_mkdir()
  kill-the-bkl/reiserfs: fix "reiserfs lock" / "inode mutex" lock inversion dependency
  kill-the-bkl/reiserfs: move the concurrent tree accesses checks per superblock
  kill-the-bkl/reiserfs: acquire the inode mutex safely
  kill-the-bkl/reiserfs: unlock only when needed in search_by_key
  kill-the-bkl/reiserfs: use mutex_lock in reiserfs_mutex_lock_safe
  kill-the-bkl/reiserfs: factorize the locking in reiserfs_write_end()
  kill-the-bkl/reiserfs: reduce number of contentions in search_by_key()
  kill-the-bkl/reiserfs: don't hold the write recursively in reiserfs_lookup()
  kill-the-bkl/reiserfs: lock only once on reiserfs_get_block()
  kill-the-bkl/reiserfs: conditionaly release the write lock on fs_changed()
  kill-the-BKL/reiserfs: add reiserfs_cond_resched()
  ...

14 years agoALSA: ice1724 - aureon - modify WM8770 Master & DAC volume
Jaroslav Kysela [Wed, 9 Dec 2009 11:43:44 +0000 (12:43 +0100)]
ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume

The volume levels in original implementation are incorrect and does
not match the dB scale. The real range is linear (in the sense of
the dB scale) from 0dB to -100dB. Remove logaritmic table and make
all volumes from range 0dB..100dB.

The tests are in RedHat's bugzilla #540817.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda/realtek: quirk for D945GCLF2 mainboard
David Santinoli [Wed, 9 Dec 2009 11:34:26 +0000 (12:34 +0100)]
ALSA: hda/realtek: quirk for D945GCLF2 mainboard

Quirk for the ALC662 found on the Intel D945GCLF2 (and possibly other)
mainboards.

Signed-off-by: David Santinoli <david@santinoli.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: hda - Terradici HDA controllers does not support 64-bit mode
Jaroslav Kysela [Wed, 9 Dec 2009 09:44:47 +0000 (10:44 +0100)]
ALSA: hda - Terradici HDA controllers does not support 64-bit mode

Confirmed from vendor and tests in RedHat bugzilla #536782 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: document: Add direct git link to grub hda-analyzer
Alexey Fisher [Wed, 9 Dec 2009 08:42:07 +0000 (09:42 +0100)]
ALSA: document: Add direct git link to grub hda-analyzer

Just to save some time, add direct git link to grub hda-analyzer

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoMerge branches 'timers-for-linus-ntp' and 'irq-core-for-linus' of git://git.kernel...
Linus Torvalds [Wed, 9 Dec 2009 03:30:19 +0000 (19:30 -0800)]
Merge branches 'timers-for-linus-ntp' and 'irq-core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-for-linus-ntp' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ntp: Provide compability defines (You say MOD_NANO, I say ADJ_NANO)

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: do not execute DEBUG_SHIRQ when irq setup failed

14 years agoMerge branch 'timers-for-linus-urgent' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 9 Dec 2009 03:28:09 +0000 (19:28 -0800)]
Merge branch 'timers-for-linus-urgent' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-for-linus-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimer: Fix /proc/timer_list regression
  itimers: Fix racy writes to cpu_itimer fields
  timekeeping: Fix clock_gettime vsyscall time warp

14 years agoMerge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 9 Dec 2009 03:27:08 +0000 (19:27 -0800)]
Merge branch 'timers-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  timers, init: Limit the number of per cpu calibration bootup messages
  posix-cpu-timers: optimize and document timer_create callback
  clockevents: Add missing include to pacify sparse
  x86: vmiclock: Fix printk format
  x86: Fix printk format due to variable type change
  sparc: fix printk for change of variable type
  clocksource/events: Fix fallout of generic code changes
  nohz: Allow 32-bit machines to sleep for more than 2.15 seconds
  nohz: Track last do_timer() cpu
  nohz: Prevent clocksource wrapping during idle
  nohz: Type cast printk argument
  mips: Use generic mult/shift factor calculation for clocks
  clocksource: Provide a generic mult/shift factor calculation
  clockevents: Use u32 for mult and shift factors
  nohz: Introduce arch_needs_cpu
  nohz: Reuse ktime in sub-functions of tick_check_idle.
  time: Remove xtime_cache
  time: Implement logarithmic time accumulation

14 years agoMerge branch 'timers-for-linus-hpet' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 9 Dec 2009 03:26:55 +0000 (19:26 -0800)]
Merge branch 'timers-for-linus-hpet' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-for-linus-hpet' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: hpet: Make WARN_ON understandable
  x86: arch specific support for remapping HPET MSIs
  intr-remap: generic support for remapping HPET MSIs
  x86, hpet: Simplify the HPET code
  x86, hpet: Disable per-cpu hpet timer if ARAT is supported

14 years agoi2c-pnx: Map I2C adapter number to platform ID number
Kevin Wells [Wed, 11 Nov 2009 23:34:17 +0000 (00:34 +0100)]
i2c-pnx: Map I2C adapter number to platform ID number

Map I2C adapter number to platform ID number

Signed-off-by: Kevin Wells <kevin.wells@nxp.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode
Rajendra Nayak [Mon, 23 Nov 2009 16:59:18 +0000 (08:59 -0800)]
i2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode

Because of OMAP off-mode, powerdomain can go off when I2C is idle.
Save enough state, and do a re-init for each transfer.

Additional save/restore state added by Jagadeesh Bhaskar Pakaravoor
(SYSC_REG) and Aaro Koskinen (wakeup sources.)

Also, The OMAP3430 TRM states:

"During active mode (I2Ci.I2C_CON[15] I2C_EN bit is set to 1), make no
changes to the I2Ci.I2C_SCLL and I2Ci.I2C_SCLH registers.  Changes may
result in unpredictable behavior."

Hence, the I2C_EN bit should be clearer when modifying these
registers. Please note that clearing the entire I2C_CON register to
disable the I2C module is safe, because the I2C_CON register is
re-configured for each transfer.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Jon Hunter <jon-hunter@ti.com>
Cc: Hu Tao <taohu@motorola.com>
Cc: Xiaolong Chen <A21785@motorola.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg() for NOACK cases
Shinya Kuribayashi [Mon, 16 Nov 2009 11:40:14 +0000 (20:40 +0900)]
i2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg() for NOACK cases

In the case of no-ACKs, we don't want to see dev_err() messages in the
console, because some utilities like i2c-tools are capable of printing
decorated console output.  This patch will ease such situations.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Cosmetic cleanups
Shinya Kuribayashi [Fri, 6 Nov 2009 12:52:22 +0000 (21:52 +0900)]
i2c-designware: Cosmetic cleanups

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Tx abort cleanups
Shinya Kuribayashi [Fri, 6 Nov 2009 12:51:57 +0000 (21:51 +0900)]
i2c-designware: Tx abort cleanups

* ABRT_MASTER_DIS: Fix a typo.

* i2c_dw_handle_tx_abort: Return an appropriate error number
  depending on abort_source.

* i2c_dw_xfer: Add a missing abort_source initialization.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Skip RX_FULL and TX_EMPTY bits on tx abort errors
Shinya Kuribayashi [Fri, 6 Nov 2009 12:51:36 +0000 (21:51 +0900)]
i2c-designware: Skip RX_FULL and TX_EMPTY bits on tx abort errors

Suppose TX_ABRT occurs in the middle of processing i2c_msg msgs[], and
a STOP condition has already been generated on the bus.  In this case,
subsequent i2c_dw_xfer_msg() might initiate a new and unnecessary I2C
transaction, which we'd have to avoid.

Furthermore, anytime TX_ABRT is set, the contents of tx/rx buffers are
flushed, so we don't have to process RX_FULL and TX_EMPTY.

Disable interrupts, and skip them.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_xfer_msg: Fix error handling procedures
Shinya Kuribayashi [Fri, 6 Nov 2009 12:51:18 +0000 (21:51 +0900)]
i2c-designware: i2c_dw_xfer_msg: Fix error handling procedures

Current error handling procedures are not good in two respects:

* Forgot to mark dev->cmd_complete as "completed" on errors

  Once an I2C transaction is initiated, wait_for_completion_
  interruptible_timeout() waits for dev->cmd_complete to be completed.
  We have to take care of it whenever an error is detected, otherwise
  we will have a needless HZ timeout.

* Forgot to disable interrupts

  In the previous patch, interrupt mask operations have been changed.
  We don't disable interrupts at the end of the interrupt handler any
  more, and try to keep RX_FULL (and TX_EMPTY if required) enabled
  during the transaction so that we can send longer data than the size
  of Tx/Rx FIFO.

  If an error is detected, we need to disable interrupts before
  quitting current transaction.

We can work around above points using dev->msg_err effectively.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Disable TX_EMPTY when all i2c_msg msgs has been processed
Shinya Kuribayashi [Fri, 6 Nov 2009 12:51:00 +0000 (21:51 +0900)]
i2c-designware: Disable TX_EMPTY when all i2c_msg msgs has been processed

Currently we disable TX_EMPTY interrupt when buf_len is zero, but this
is wrong.  (buf_len == 0) means that all transmit data in the current
i2c_msg message has been sent out, but that doesn't necessarily mean
all i2c_msg messages have been processed.

TX_EMPTY interrupt is used as the driving force of DW I2C transactions,
so we need to keep it enabled as long as i2c_msg messages are available.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Process all i2c_msg messages in the interrupt handler
Shinya Kuribayashi [Fri, 6 Nov 2009 12:50:40 +0000 (21:50 +0900)]
i2c-designware: Process all i2c_msg messages in the interrupt handler

Currently we process the first i2c_dw_xfer_msg() in i2c_dw_xfer(),
but in this case there is a possibility to be interrupted by certain
interrupts.  As described before in this patchset, we need to keep
providing new transmit data within a given time period, otherwise Tx
FIFO underrun takes place and STOP condition will be generated on the
bus, even if we have more bytes to be written.

In order to exclude all such possibilities, change TX_EMPTY interrupt
usage as below:

* DW_IC_INTR_DEFAULT_MASK: Define a default interrupt mask set, and
  put TX_EMPTY there.

* i2c_dw_xfer_init: Enable DW_IC_INTR_DEFAULT_MASK prior to initiating
  a new I2C transaction.  The first TX_EMPTY will be triggered shortly.
  With the help of it, we can make the first call to i2c_dw_xfer_msg()
  in the interrupt handler.

* i2c_dw_xfer_msg: Fixup intr_mask operation accordingly.  Make sure
  that TX_EMPTY operations need to be reversed.

* request_irq: Set IRQF_DISABLED so that we could load transmit data
  into Tx FIFO without being distracted by other interrupts.

* Remove i2c_dw_xfer_msg() in i2c_dw_xfer().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_read: Remove redundant target address checker
Shinya Kuribayashi [Fri, 6 Nov 2009 12:50:22 +0000 (21:50 +0900)]
i2c-designware: i2c_dw_read: Remove redundant target address checker

I2c_dw_xfer_msg() also has the same target address inconsistency check,
and furthermore it checks across all i2c_msg messages, while
i2c_dw_read() walks through i2c_msg messages only with_ I2C_M_RD flag.
That is, target address check in i2c_dw_read() is redundant and useless.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_func: Set I2C_FUNC_SMBUS_foo bits
Shinya Kuribayashi [Fri, 6 Nov 2009 12:50:02 +0000 (21:50 +0900)]
i2c-designware: i2c_dw_func: Set I2C_FUNC_SMBUS_foo bits

Set proper I2C_FUNC_SMBUS_* bits so that the driver could be used with
some utilities requiring SMBus functionalities, such as i2c-tools.

Note that DW I2C core doesn't support I2C_FUNC_SMBUS_QUICK, as it's not
capable of zero-length data transactions.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Initialize byte count variables just prior to being used
Shinya Kuribayashi [Fri, 6 Nov 2009 12:49:39 +0000 (21:49 +0900)]
i2c-designware: Initialize byte count variables just prior to being used

As the driver and hardware always process the given data in parallel,
then it would be better to initialize tx_limit, rx_limit and rx_valid
variables just prior to being used.

This will help us to send / receive as much data as possible.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_xfer_msg: Introduce a local "buf" pointer
Shinya Kuribayashi [Fri, 6 Nov 2009 12:49:14 +0000 (21:49 +0900)]
i2c-designware: i2c_dw_xfer_msg: Introduce a local "buf" pointer

While we have a local variable "buf_len" for dev->tx_buf_len, we don't
have such local variable for dev->tx_buf pointer.  While "buf_len" is
restored at first then updated when we start processing a new i2c_msg
(determined by STATUS_WRITE_IN_PROGRESS flag), ->tx_buf is different.

Such inconsistency makes the code slightly hard to follow.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Divide i2c_dw_xfer_msg into two functions
Shinya Kuribayashi [Fri, 6 Nov 2009 12:48:55 +0000 (21:48 +0900)]
i2c-designware: Divide i2c_dw_xfer_msg into two functions

We have some steps at the top of i2c_dw_xfer_msg() to set up a slave
address and enable DW I2C core.  And it's executed only when we don't
have STATUS_WRITE_IN_PROGRESS.

But we need to make sure that STATUS_WRITE_IN_PROGRESS only indicates
that we have a pending i2c_msg to process.  In other words, even if
STATUS_WRITE_IN_PROGRESS is not set, that doesn't mean we're at initial
state in the I2C transaction.

Since i2c_dw_xfer_msg() will be invoked again and again during a
transaction, those init steps have a possibility to be re-processed
needlessly.  For example, this issue easily takes place when processing
a combined transaction with a certain condition (the number of tx bytes
in the first i2c_msg, equals to the Tx FIFO depth).

Consequently we should not use STATUS_WRITE_IN_PROGRESS to determine
where we're at in an I2C transaction.  It would be better to separate
those initialization steps from i2c_dw_xfer_msg().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Enable RX_FULL interrupt
Shinya Kuribayashi [Fri, 6 Nov 2009 12:48:33 +0000 (21:48 +0900)]
i2c-designware: Enable RX_FULL interrupt

Enable RX_FULL interrupt mask by default, and hook it in the interrupt
handler.  If requested amount of rx data (defined by IC_RX_TL) is not
available, we don't have to process i2c_dw_read().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Set Tx/Rx FIFO threshold levels
Shinya Kuribayashi [Fri, 6 Nov 2009 12:48:12 +0000 (21:48 +0900)]
i2c-designware: Set Tx/Rx FIFO threshold levels

As a hardware feature, DW I2C core generates a STOP condition whenever
the Tx FIFO becomes empty (strictly speaking, whenever the last byte in
the Tx FIFO is sent out), even if we have more bytes to be written.

In other words, we must never make "Tx FIFO underrun" happen during
a transaction, except for the last byte.  For the safety's sake, we'd
make TX_EMPTY interrupt get triggered every time one byte is processed.

The Rx FIFO threshold needs to be set as well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Process i2c_msg messages in the interrupt handler
Shinya Kuribayashi [Fri, 6 Nov 2009 12:47:51 +0000 (21:47 +0900)]
i2c-designware: Process i2c_msg messages in the interrupt handler

Symptom:
--------
When we're going to send/receive the longer size of data than the Tx
FIFO length, the I2C transaction will be divided into several separated
transactions, limited by the Tx FIFO length.

Details:
--------
As a hardware feature, DW I2C core generates a STOP condition whenever
the Tx FIFO becomes empty (strictly speaking, whenever the last byte in
the Tx FIFO is sent out), even if we have more bytes to be written.
Then, once a new transmit data is written to the Tx FIFO, DW I2C core
will initiate a new transaction, which leads to another START condition.

This explains how the transaction in question goes, and implies that
current tasklet-based dw_i2c_pump_msg() strategy couldn't meet the
timing constraint required for avoiding Tx FIFO underrun.

To avoid this scenario, we must keep providing new transmit data within
a given time period.  In case of Fast-mode + 32-byte Tx FIFO, for
instance, it takes about 22.5[us] to process single byte, and 720[us] in
total.

This patch removes the existing tasklet-based "pump" system, and move
its jobs into the interrupt handler.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_xfer_msg: Fix i2c_msg search bug
Shinya Kuribayashi [Fri, 6 Nov 2009 12:47:30 +0000 (21:47 +0900)]
i2c-designware: i2c_dw_xfer_msg: Fix i2c_msg search bug

In case a work-in-progress i2c_msg has more bytes to be written, we
need to set STATUS_WRITE_IN_PROGRESS and exit from the msg_write_idx-
searching loop.  Otherwise, we will overtake the current msg_write_idx
without waiting for its transmission to be processed.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Improved _HCNT/_LCNT calculation
Shinya Kuribayashi [Fri, 6 Nov 2009 12:47:01 +0000 (21:47 +0900)]
i2c-designware: Improved _HCNT/_LCNT calculation

* Calculate with accurate conditional expressions from DW manuals.
* Round ic_clk by adding 0.5 as it's important at high ic_clk rate.
* Take into account "tHD;STA" issue for _HCNT calculation.
* Take into account "tf" for _LCNT calculation.
* Add "cond" and "offset" fot further correction requirements.

For _HCNT calculation, there's one issue needs to be carefully
considered; DesignWare I2C core doesn't seem to have solid strategy
to meet the tHD;STA timing spec.  If you configure _HCNT based on the
tHIGH timing spec, it easily results in violation of the tHD;STA spec.

After many trials, we came to the conclusion that the tHD;STA period
is proportional to (_HCNT + 3).  For the safety's sake, this should be
selected by default.

As for _LCNT calculation, DW I2C core has one characteristic behavior;
he starts counting the SCL CNTs for the LOW period of the SCL clock
(tLOW) as soon as it pulls the SCL line.  At that time, he doesn't take
into account the fall time of SCL signal (tf), IOW, he starts counting
CNTs without confirming the SCL input voltage has dropped to below VIL.

This characteristics becomes a problem on some platforms where tf is
considerably long, and results in violation of the tLOW timing spec.

To make the driver configurable as much as possible for various cases,
we'd have separated arguments "tf" and "offset", and for safety default
values should be 0.3 us and 0, respectively.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: Remove an useless local variable "num"
Shinya Kuribayashi [Fri, 6 Nov 2009 12:46:29 +0000 (21:46 +0900)]
i2c-designware: Remove an useless local variable "num"

We couldn't know the original intent for this variable, but at this
point it's useless.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-designware: i2c_dw_xfer_msg: Use "struct dw_i2c_dev" pointer
Shinya Kuribayashi [Fri, 6 Nov 2009 12:46:04 +0000 (21:46 +0900)]
i2c-designware: i2c_dw_xfer_msg: Use "struct dw_i2c_dev" pointer

We don't have to use "struct i2c_adapter" pointer here.
Let's use a local "struct dw_i2c_dev" pointer, instead.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>