platform/kernel/linux-rpi.git
13 years agostaging:iio:adc:ad7152: Fix differential channel return value and increase delay.
Michael Hennerich [Fri, 2 Sep 2011 16:25:31 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: Fix differential channel return value and increase delay.

In differential mode zero scale equals to 0x8000.
Increase readout delay by 1ms.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152: Update sample rate, conversion time, digital filter handling
Michael Hennerich [Fri, 2 Sep 2011 16:25:30 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: Update sample rate, conversion time, digital filter handling

Rename attribute, use sampling_frequency instead.
Attribute now accepts values in Hz.
Delay readout accordingly.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152: Add proper locking
Michael Hennerich [Fri, 2 Sep 2011 16:25:29 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: Add proper locking

Add proper locking.
Consistently use indio_dev.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152: update scale handling
Michael Hennerich [Fri, 2 Sep 2011 16:25:28 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: update scale handling

Add scale_available attribute.
fix ad7152_scale_table, values are not sorted descending.
Use IIO_VAL_INT_PLUS_NANO, to increase granularity.
Update scale handling accordingly.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152: Miscellaneous fixes and touch-up
Michael Hennerich [Fri, 2 Sep 2011 16:25:27 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: Miscellaneous fixes and touch-up

Remove unused define.
Introduce cached SETUP variables.
Wait until calibration finished. (Device returns to idle state)
IIO_CHAN_INFO_CALIBSCALE_SEPARATE use proper scales. (range 1.0 to 1.99999)
i2c_smbus word transactions expect low byte first, therefore swap bytes.
CAPDIFF is bit in SETUP not CFG.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152: increase readability by introducing proper bit defines
Michael Hennerich [Fri, 2 Sep 2011 16:25:26 +0000 (17:25 +0100)]
staging:iio:adc:ad7152: increase readability by introducing proper bit defines

Some other miscellaneous cleanup.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152 bring more into line with abi.
Jonathan Cameron [Fri, 2 Sep 2011 16:25:25 +0000 (17:25 +0100)]
staging:iio:adc:ad7152 bring more into line with abi.

Get rid of explicit writes to registers and conversion mode
control.

Couple of bits I'm unsure about.
* Do calibration modes self reset when done?  How do you tell they are
done?

* Should we poll the status register just to be sure we have a new conversion?

All done sans hardware.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152 set correct number of channels for ad7153.
Jonathan Cameron [Fri, 2 Sep 2011 16:25:24 +0000 (17:25 +0100)]
staging:iio:adc:ad7152 set correct number of channels for ad7153.

Has been broken for some time.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7152 use smbus read / write functions + checkpatch fixes
Jonathan Cameron [Fri, 2 Sep 2011 16:25:23 +0000 (17:25 +0100)]
staging:iio:adc:ad7152 use smbus read / write functions + checkpatch fixes

This is fine IF I  have read the data sheet correctly.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7150: Add support for the second interrupt strobe.
Michael Hennerich [Fri, 2 Sep 2011 16:25:22 +0000 (17:25 +0100)]
staging:iio:adc:ad7150: Add support for the second interrupt strobe.

The AD7150 features two outputs that can be used as interrupt strobes
to the host processor. In order to receive all events independently,
both need to utilized.

Update copyright notice.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7150: remove conversion mode handling.
Michael Hennerich [Fri, 2 Sep 2011 16:25:21 +0000 (17:25 +0100)]
staging:iio:adc:ad7150: remove conversion mode handling.

The AD7150 family of devices power up in continues conversion mode.
We can stay in this mode, unless power consumption becomes a real issue.
Actually the event generation as well as the running average
relies on continues conversion mode, so we better stay there.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:adc:ad7150: chan_spec conv + i2c_smbus commands + drop unused poweroff...
Jonathan Cameron [Fri, 2 Sep 2011 16:25:20 +0000 (17:25 +0100)]
staging:iio:adc:ad7150: chan_spec conv + i2c_smbus commands + drop unused poweroff timeout control.

Minimal changes to code layout as going to do chan spec conversion shortly.
Otherwise, there are numerous code sharing opportunities in here and abi
elements that are uterly non compliant.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:dac:ad5791 chan spec conversion.
Jonathan Cameron [Fri, 2 Sep 2011 16:25:19 +0000 (17:25 +0100)]
staging:iio:dac:ad5791 chan spec conversion.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: Differential channel handling - use explicit flag rather than types.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:45 +0000 (17:14 +0100)]
staging:iio: Differential channel handling - use explicit flag rather than types.

Straight forward change in the core, but required some drivers to not use
the IIO_CHAN macro as that doesn't allow setting this bit (and is
going away anyway). Hence the churn.

Tested on max1363 with a couple of supported parts.

V2: differential bit in code got 7 bits and direction 1. Reversed that.
Issue spotted by Michael - thanks!

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:add adaptive event types and missing extract_type macro.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:44 +0000 (17:14 +0100)]
staging:iio:add adaptive event types and missing extract_type macro.

I'm not entirely sure this is the right way to go. Suggestions of other
options welcome!

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: Add capacitance type and average_raw chan info.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:43 +0000 (17:14 +0100)]
staging:iio: Add capacitance type and average_raw chan info.

These are both needed for CAPADCs

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:naming in the EV_BIT macro fix.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:42 +0000 (17:14 +0100)]
staging:iio:naming in the EV_BIT macro fix.

Should always have been IIO_EV_DIR_MAX as that's what it actually controls.
Also reduced the number to 4 as not yet seen a case needing more and this
is not userspace visible anyway.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:attrs - make address a u64 to allow event codes to be used.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:41 +0000 (17:14 +0100)]
staging:iio:attrs - make address a u64 to allow event codes to be used.

Makes unusual event related attributes look a lot more like the core ones.

V2: Make sure the utils that set these up can handle the codes.
V3: rebase

Reported-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: rework of attribute registration.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:40 +0000 (17:14 +0100)]
staging:iio: rework of attribute registration.

This set also includes quite a number of bug fixes of particularly
remove functions.

Necessary due to issue pointed out in Bart Van Assche's patch:
docs/driver-model: Document device.groups

V2: Rebase due to patch reordering.
V3: Pull various error fixes and cleanups out into their own patches.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:events - new 64 bit code structure and push out drivers.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:39 +0000 (17:14 +0100)]
staging:iio:events - new 64 bit code structure and push out drivers.

This costs us nothing in event storage (as we are carrying a 64 bit
timestamp in the structure) and gives us lots more room to play with.

Also allows for more channels which some parts need.

V2: Cleanup some loose ends (such as the switch with only one option now).

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: Switch the channel masks to bitmaps so as to allow for more channels.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:38 +0000 (17:14 +0100)]
staging:iio: Switch the channel masks to bitmaps so as to allow for more channels.

This is as light as possible on changes to current drivers.
Some drivers make assumptions that their masks fit in a single
long.  Given they were previously working this is clearly valid if
not tidy.

The max1363 is an example where there should be no such assumptions.

V2: Add the new ad5933

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:various move default scan mask setting after ring register or remove
Jonathan Cameron [Fri, 2 Sep 2011 16:14:37 +0000 (17:14 +0100)]
staging:iio:various move default scan mask setting after ring register or remove

The scan mask will be dynamically assigned in register, so don't
use it before that.

In adis16260 I've moved it as I know this driver has userspace code.
Same for sca3000 where it is cost free due to hardware buffer.
Can do that for the others, but in theory userspace code should always
have been checking these and setting them appropriately anyway!

V2: Clear default mask out of adis16400 as reported by Michael

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reported-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:scan element types: introduce endian description to the data format.
Jonathan Cameron [Fri, 2 Sep 2011 16:14:36 +0000 (17:14 +0100)]
staging:iio:scan element types: introduce endian description to the data format.

If not set in chan_spec, cpu endianness used.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:Documentation sysfs-bus-iio add in and out prefixes
Jonathan Cameron [Fri, 2 Sep 2011 16:14:35 +0000 (17:14 +0100)]
staging:iio:Documentation sysfs-bus-iio add in and out prefixes

Also includes the inX -> in_voltageX and outX -> out_voltageX conversions.
To keep lines short quite a lot of supressing of directories was needed.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: ABI rework - add in_ or out_ prefix to channnels
Jonathan Cameron [Fri, 2 Sep 2011 16:14:34 +0000 (17:14 +0100)]
staging:iio: ABI rework - add in_ or out_ prefix to channnels

Also involves changing current inX outX to in_voltageX and out_voltageX

V2: squash users of the IIO_CHAN_OUT macro and get rid of it.
There are very few of these, so it is easier to fix them.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:various cleanup regulator use paths.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:19 +0000 (12:41 +0100)]
staging:iio:various cleanup regulator use paths.

No way iio_device_allocate or iio_device_unregister effected
by regulators so copying tricks not needed.

This is really about regularizing the layout of drivers.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:fix using iio_priv or iio_dev after iio_unregister_device
Jonathan Cameron [Tue, 30 Aug 2011 11:41:18 +0000 (12:41 +0100)]
staging:iio:fix using iio_priv or iio_dev after iio_unregister_device

This includes calling iio_free_device as that should only be called
before the device has been registered.

Also one case of iio_free_device being called on a registered device.

This has been pulled out of the reworking attributes patch.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:light:tsl2563 remove unused headers.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:17 +0000 (12:41 +0100)]
staging:iio:light:tsl2563 remove unused headers.

Guessing this is some ancient cut and paste issue.

Signed-off-by: Jonathan Cammeron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:light:tsl2563 remove use of IIO_CHAN macro and make use modifier defines.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:16 +0000 (12:41 +0100)]
staging:iio:light:tsl2563 remove use of IIO_CHAN macro and make use modifier defines.

This avoids issues in the new event code introduced shortly + makes
moving this one out of staging easier.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: push "sysfs.h" and linux/irq.h out of iio.h
Jonathan Cameron [Tue, 30 Aug 2011 11:41:15 +0000 (12:41 +0100)]
staging:iio: push "sysfs.h" and linux/irq.h out of iio.h

These are no longer needed.
Requires a few driver updates for places "sysfs.h" should have been
present but wasn't.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:buffering cleanup ring_buffer_register_ex naming.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:14 +0000 (12:41 +0100)]
staging:iio:buffering cleanup ring_buffer_register_ex naming.

Now the old method is long gone, lets get rid of the _ex and whilst
here remove the unused id parameter.

Trivial mechanical change, but will break any out of tree drivers
using this.

V2: rebase
V3: rebase

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:buffering drag some stray docs back to correct place.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:13 +0000 (12:41 +0100)]
staging:iio:buffering drag some stray docs back to correct place.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: struct iio_dev formatting cleanup and documentation fixes.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:12 +0000 (12:41 +0100)]
staging:iio: struct iio_dev formatting cleanup and documentation fixes.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio:trivial add a string array for IIO_RAW and IIO_PROCESSED.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:11 +0000 (12:41 +0100)]
staging:iio:trivial add a string array for IIO_RAW and IIO_PROCESSED.

Introduce IIO_RAW and IIO_PROCESSED and an array for their strings.
Also move one function to just above where it is called.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: fix typo
Michael Hennerich [Tue, 30 Aug 2011 11:41:10 +0000 (12:41 +0100)]
staging:iio: fix typo

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: remove orphaned function definition.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:09 +0000 (12:41 +0100)]
staging:iio: remove orphaned function definition.

I have no idea what this was, or what it did, but it doesn't
do it any more.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: remove defunct iio_put and iio_get.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:08 +0000 (12:41 +0100)]
staging:iio: remove defunct iio_put and iio_get.

All iio dependent modules statically depend on industrialio
so these aren't needed. Not sure why they originally existed,
but they aren't now.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: use ida_simple_get and ida_simple_remove + merge ids
Jonathan Cameron [Tue, 30 Aug 2011 11:41:07 +0000 (12:41 +0100)]
staging:iio: use ida_simple_get and ida_simple_remove + merge ids

Use new simple ida allocation functions to remove some boilerplate
code.

Also, now we only have one chdev per device we don't need to maintain
a separate ida for minor numbers. Just use the devices id.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging:iio: remove broken support for multiple event interfaces.
Jonathan Cameron [Tue, 30 Aug 2011 11:41:06 +0000 (12:41 +0100)]
staging:iio: remove broken support for multiple event interfaces.

We don't have a use case for these.  Two drivers appeared to use them
but both report all events on the first.

V2: Remove now irrelevant comment.
V3: Include fixup for adc/ad7280a.c

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: Documentation sysfs-bus-iio update for chrdev merge.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:49 +0000 (12:32 +0100)]
staging: iio: Documentation sysfs-bus-iio update for chrdev merge.

A few element in here have been wrong for some time so cleaned them
up whilst here.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: remove now defunct header definitions and add some statics
Jonathan Cameron [Tue, 30 Aug 2011 11:32:48 +0000 (12:32 +0100)]
staging: iio: remove now defunct header definitions and add some statics

Now we have combined all chrdevs into one, some bits and bobs are only
needed in industrialio-core.c and don't need to be in the core header.

Also remove some unused defines.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: push the main buffer chrdev down to the top level.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:47 +0000 (12:32 +0100)]
staging: iio: push the main buffer chrdev down to the top level.

Sorry all, this one is very invasive, though the driver changes are
just trivial interface fixes. Not all done yet.

V2 - bring the sca3000 with us.
V3 - fix ade7758 bugs in conversion.
V4 - add ad5933

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: squash chrdev handler remains into users.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:46 +0000 (12:32 +0100)]
staging: iio: squash chrdev handler remains into users.

This no longer has any purpose given all chrdevs are pretty much the same
now the event interfaces are done via anon fds

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: remove specific chrdev for event reading. Get fd from ioctl on buffer.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:45 +0000 (12:32 +0100)]
staging: iio: remove specific chrdev for event reading. Get fd from ioctl on buffer.

Change suggested by Arnd Bergmann.

No real reason to have two chrdevs per device. This step merges them into one.
Currently this means that events will only work on devices with buffers. THat will
be remedied shortly.

V2: set name for event attribute groups.  Otherwise they all sorts of fun occurs on
dynamic channel event attribute creation.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: chrdev.h rationalization.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:44 +0000 (12:32 +0100)]
staging: iio: chrdev.h rationalization.

Push some functions out of header and include this where it is needed
in other headers only.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: iio: kfifo buffer - push structure definition down into implementation.
Jonathan Cameron [Tue, 30 Aug 2011 11:32:43 +0000 (12:32 +0100)]
staging: iio: kfifo buffer - push structure definition down into implementation.

Nothing other than the implementation needs to know about this.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
Olaf Hering [Fri, 2 Sep 2011 16:25:56 +0000 (18:25 +0200)]
Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/

Show a modalias file in /sys/bus/vmbus/devices/*/
Add a helper function to print the same content in modalias and uevent.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: Update TODO file
K. Y. Srinivasan [Fri, 2 Sep 2011 15:55:41 +0000 (08:55 -0700)]
Staging: hv: Update TODO file

Based on input from Greg, update the TODO file.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix some typos in netvsc.c
Haiyang Zhang [Thu, 1 Sep 2011 19:19:48 +0000 (12:19 -0700)]
staging: hv: fix some typos in netvsc.c

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix the page buffer when rndis data go across page boundary
Haiyang Zhang [Thu, 1 Sep 2011 19:19:47 +0000 (12:19 -0700)]
staging: hv: fix the page buffer when rndis data go across page boundary

In rndis_filter_receive_data(), we need to drop the 0th page and move the
rest of pages forward if the rndis data go across page boundary, otherwise
the page offset will overflow.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix the return status of netvsc_start_xmit()
Haiyang Zhang [Thu, 1 Sep 2011 19:19:46 +0000 (12:19 -0700)]
staging: hv: fix the return status of netvsc_start_xmit()

Fix the return status, so the upper layer will retry if transmission
fails.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix counting of available buffer slots when send fails
Haiyang Zhang [Thu, 1 Sep 2011 19:19:45 +0000 (12:19 -0700)]
staging: hv: fix counting of available buffer slots when send fails

Because the number of available buffer slots doesn't decrease for failed
sends, we should not call netvsc_xmit_completion(), which increase the
count of available slots. In this failed case, just free the memory is
enough.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix counting of #outstanding-sends in failed sends
Haiyang Zhang [Thu, 1 Sep 2011 19:19:44 +0000 (12:19 -0700)]
staging: hv: fix counting of #outstanding-sends in failed sends

If the packet failed to be sent, we shouldn't count it as the
number of outstanding sends.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: re-order the code in netvsc_probe()
Haiyang Zhang [Thu, 1 Sep 2011 19:19:43 +0000 (12:19 -0700)]
staging: hv: re-order the code in netvsc_probe()

Re-order the code in netvsc_probe() to prevent a guest crash caused by
packets possibly received from NetVSP before call to register_netdev().

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: fix a kernel warning in netvsc_linkstatus_callback()
Haiyang Zhang [Thu, 1 Sep 2011 19:19:42 +0000 (12:19 -0700)]
staging: hv: fix a kernel warning in netvsc_linkstatus_callback()

netif_notify_peers() caused a kernel warning in netvsc_linkstatus_callback(),
because netvsc_linkstatus_callback() is within IRQ context. So we move
the first call to netif_notify_peers() into queued work as well, but with
zero delay.

In addition to "staging-next", this should also be back-ported to stable
kernels 2.6.32 and later.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc
Haiyang Zhang [Thu, 1 Sep 2011 19:19:41 +0000 (12:19 -0700)]
staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: add newline to log messages in netvsc
Haiyang Zhang [Thu, 1 Sep 2011 19:19:40 +0000 (12:19 -0700)]
staging: hv: add newline to log messages in netvsc

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: hv: remove unnecessary includes in netvsc
Haiyang Zhang [Thu, 1 Sep 2011 19:19:39 +0000 (12:19 -0700)]
staging: hv: remove unnecessary includes in netvsc

hyperv.h is included by hyperv_net.h already, so no need to include it
again in these C files.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: vmbus: Cleanup the code in process_chn_event()
K. Y. Srinivasan [Wed, 31 Aug 2011 21:35:57 +0000 (14:35 -0700)]
Staging: hv: vmbus: Cleanup the code in process_chn_event()

A channel in Hyper-V is equivalent to a device. Thus, a channel is
persistent once it is presented to the guest, even if the driver
managing this device is unloaded. By checking and invoking the driver
specific callback function under the protection of the channel
inbound_lock, we can properly deal with racing driver unloads since an
unloading driver sets the callback to NULL under the protection of this
inbound_lock.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: vmbus: Check for events before messages
K. Y. Srinivasan [Wed, 31 Aug 2011 21:35:56 +0000 (14:35 -0700)]
Staging: hv: vmbus: Check for events before messages

The Windows team has informed us that on Windows guests on Hyper-V,
they check for events before messages. They also recommended that we do
the same. This patch addresses this.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init()
K. Y. Srinivasan [Wed, 31 Aug 2011 21:35:55 +0000 (14:35 -0700)]
Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init()

Fix a bug in error handling in vmbus_bus_init().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoStaging: hv: util: Deal with driver register failures
K. Y. Srinivasan [Wed, 31 Aug 2011 21:35:54 +0000 (14:35 -0700)]
Staging: hv: util: Deal with driver register failures

Properly deal with vmbus_driver_register() failures.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: lirc_sasem: fix NULL pointer dereference in sasem_probe
Alexey Khoroshilov [Mon, 29 Aug 2011 20:54:21 +0000 (00:54 +0400)]
staging: lirc_sasem: fix NULL pointer dereference in sasem_probe

If any memory allocation failed, goto alloc_status_switch
leads to mutex_unlock(&context->ctx_lock) while context is NULL.
The patch moves alloc_status_switch to handle error conditions
in correct way.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: lirc: fix mismatch in mutex lock-unlock in imon_probe
Alexey Khoroshilov [Mon, 29 Aug 2011 20:17:56 +0000 (00:17 +0400)]
staging: lirc: fix mismatch in mutex lock-unlock in imon_probe

If kzalloc failed for allocation of context, goto alloc_status_switch
leads to unlock of unacquired driver_lock. The patch moves
mutex_lock(&driver_lock) before allocation of context.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: fix rtl8192e build errors
Randy Dunlap [Mon, 29 Aug 2011 20:54:59 +0000 (13:54 -0700)]
staging: fix rtl8192e build errors

drivers/staging/rtl8192e/rtllib.h:2329: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192e/rtllib.h:2330: error: field 'scan_sem' has incomplete type
drivers/staging/rtl8192e/rtllib.h:2331: error: field 'ips_sem' has incomplete type
drivers/staging/rtl8192e/rtllib_wx.c:267: error: implicit declaration of function 'down'
drivers/staging/rtl8192e/rtllib_wx.c:290: error: implicit declaration of function 'up'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete IF_DEF_ScaleLCD
Aaro Koskinen [Wed, 31 Aug 2011 18:46:15 +0000 (21:46 +0300)]
staging: xgifb: delete IF_DEF_ScaleLCD

Delete one more disabled feature.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete IF_DEF_PWD
Aaro Koskinen [Wed, 31 Aug 2011 18:46:14 +0000 (21:46 +0300)]
staging: xgifb: delete IF_DEF_PWD

Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete IF_DEF_OEMUtil
Aaro Koskinen [Wed, 31 Aug 2011 18:46:13 +0000 (21:46 +0300)]
staging: xgifb: delete IF_DEF_OEMUtil

Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete Win9xDOSMode
Aaro Koskinen [Wed, 31 Aug 2011 18:46:12 +0000 (21:46 +0300)]
staging: xgifb: delete Win9xDOSMode

Delete another useless flag.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete IF_DEF_VideoCapture
Aaro Koskinen [Wed, 31 Aug 2011 18:46:11 +0000 (21:46 +0300)]
staging: xgifb: delete IF_DEF_VideoCapture

Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated timing data
Aaro Koskinen [Wed, 31 Aug 2011 18:46:10 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated timing data

Delete redundant timing data tables. Replace as follows:

EnlargeTap4Timing ==> xgifb_tap4_timing
NoScaleTap4Timing ==> xgifb_tap4_timing
NTSCTap4Timing ==> xgifb_ntsc_525_tap4_timing
YPbPr525iTap4Timing ==> xgifb_ntsc_525_tap4_timing
YPbPr525pTap4Timing ==> xgifb_ntsc_525_tap4_timing

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated TV data tables
Aaro Koskinen [Wed, 31 Aug 2011 18:46:09 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated TV data tables

Delete redundant TV data tables. Replace as follows:

XGI_EPLCHTVDataPtr ==> xgifb_chrontel_tv
XGI_EPLCHTVRegPtr ==> xgifb_chrontel_tv

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated LCD table
Aaro Koskinen [Wed, 31 Aug 2011 18:46:08 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated LCD table

XGI_EPLLCDCRT1Ptr_H and XGI_EPLLCDCRT1Ptr_V tables are identical. Replace
as follows:

XGI_EPLLCDCRT1Ptr_H ==> xgifb_epllcd_crt1
XGI_EPLLCDCRT1Ptr_V ==> xgifb_epllcd_crt1

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated LCD data
Aaro Koskinen [Wed, 31 Aug 2011 18:46:07 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated LCD data

Delete duplicated LCD data tables. Replace as follows:

XGI_ExtLCD1400x1050Data ==> xgifb_lcd_1400x1050
XGI_StLCD1400x1050Data ==> xgifb_lcd_1400x1050
XGI_ExtLCD1280x1024x75Data ==> xgifb_lcd_1280x1024x75
XGI_StLCD1280x1024x75Data ==> xgifb_lcd_1280x1024x75
XGI_ExtLCDDes1400x1050Data ==> xgifb_lcddes_1400x1050
XGI_StLCDDes1400x1050Data ==> xgifb_lcddes_1400x1050
XGI_ExtLCDDLDes1400x1050Data ==> xgifb_lcddldes_1400x1050
XGI_StLCDDLDes1400x1050Data ==> xgifb_lcddldes_1400x1050
XGI_ExtLCDDes1024x768x75Data ==> xgifb_lcddes_1024x768x75
XGI_StLCDDes1024x768x75Data ==> xgifb_lcddes_1024x768x75
XGI_ExtLCDDes1280x1024x75Data ==> xgifb_lcddes_1280x1024x75
XGI_StLCDDes1280x1024x75Data ==> xgifb_lcddes_1280x1024x75
XGI_ExtLCDDLDes1280x1024x75Data ==> xgifb_lcddldes_1280x1024x75
XGI_StLCDDLDes1280x1024x75Data ==> xgifb_lcddldes_1280x1024x75

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated YFilter1 data
Aaro Koskinen [Wed, 31 Aug 2011 18:46:06 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated YFilter1 data

PAL-M and PAL-N "YFilter1" tables are identical. Replace as follows:

PALMYFilter1 ==> xgifb_palmn_yfilter1
PALNYFilter1 ==> xgifb_palmn_yfilter1

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated YFilter2 data
Aaro Koskinen [Wed, 31 Aug 2011 18:46:05 +0000 (21:46 +0300)]
staging: xgifb: delete duplicated YFilter2 data

All four "YFilter2" tables are identical. Replace as follows:

NTSCYFilter2 ==> xgifb_yfilter2;
PALMYFilter2 ==> xgifb_yfilter2;
PALNYFilter2 ==> xgifb_yfilter2;
PALYFilter2 ==> xgifb_yfilter2;

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: do not initialize static data to 0
Aaro Koskinen [Wed, 31 Aug 2011 18:46:04 +0000 (21:46 +0300)]
staging: xgifb: do not initialize static data to 0

Remove redundant initializations.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: eliminate #ifdef Tap4
Aaro Koskinen [Wed, 31 Aug 2011 18:46:03 +0000 (21:46 +0300)]
staging: xgifb: eliminate #ifdef Tap4

Eliminate #define Tap4 and related checks.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete commented-out routines
Aaro Koskinen [Wed, 31 Aug 2011 18:46:02 +0000 (21:46 +0300)]
staging: xgifb: delete commented-out routines

Delete routines which have been commented out.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: refactor XGI_SetXG21LVDSPara() and XGI_SetXG27LVDSPara()
Aaro Koskinen [Wed, 31 Aug 2011 18:46:01 +0000 (21:46 +0300)]
staging: xgifb: refactor XGI_SetXG21LVDSPara() and XGI_SetXG27LVDSPara()

The code is almost the same for XG21 and XG27, a single routine can
cover both.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: refactor XGI_SetXG21LCD() and XGI_SetXG27LCD()
Aaro Koskinen [Wed, 31 Aug 2011 18:46:00 +0000 (21:46 +0300)]
staging: xgifb: refactor XGI_SetXG21LCD() and XGI_SetXG27LCD()

The code is almost the same for XG21 and XG27, a single routine can
cover both.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete redundant Chrontel TV data
Aaro Koskinen [Wed, 31 Aug 2011 18:45:59 +0000 (21:45 +0300)]
staging: xgifb: delete redundant Chrontel TV data

Delete redundant Chrontel TV data.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete support for Chrontel 7007 TV output
Aaro Koskinen [Wed, 31 Aug 2011 18:45:58 +0000 (21:45 +0300)]
staging: xgifb: delete support for Chrontel 7007 TV output

IF_DEF_CH7007 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete support for Chrontel 7005 TV output
Aaro Koskinen [Wed, 31 Aug 2011 18:45:57 +0000 (21:45 +0300)]
staging: xgifb: delete support for Chrontel 7005 TV output

IF_DEF_CH7005 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete support for Chrontel 7017 TV output
Aaro Koskinen [Wed, 31 Aug 2011 18:45:56 +0000 (21:45 +0300)]
staging: xgifb: delete support for Chrontel 7017 TV output

IF_DEF_CH7017 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete XGI_OpenCRTC()
Aaro Koskinen [Wed, 31 Aug 2011 18:45:55 +0000 (21:45 +0300)]
staging: xgifb: delete XGI_OpenCRTC()

Delete redundant function. Also eliminates the following sparse warning:

drivers/staging/xgifb/vb_setmode.c:8033:6: warning: symbol 'XGI_OpenCRTC' was not declared. Should it be static?

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: use common init for module and built-in
Aaro Koskinen [Mon, 29 Aug 2011 20:14:34 +0000 (23:14 +0300)]
staging: xgifb: use common init for module and built-in

Use a common init function for module and built-in driver.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostating: xgifb: update module parameter descriptions
Aaro Koskinen [Mon, 29 Aug 2011 20:14:33 +0000 (23:14 +0300)]
stating: xgifb: update module parameter descriptions

Remove incorrect/misleading text from parameter descriptions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete all references to mode "none"
Aaro Koskinen [Mon, 29 Aug 2011 20:14:32 +0000 (23:14 +0300)]
staging: xgifb: delete all references to mode "none"

Delete all references to mode "none". It should be handled like any
other invalid mode.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: correct the default mode comment
Aaro Koskinen [Mon, 29 Aug 2011 20:14:31 +0000 (23:14 +0300)]
staging: xgifb: correct the default mode comment

According to the comment, the default mode should be 800x600x8 while
the index points actually to 800x600x16. Change the comment and move
the definition instead of changing the current behaviour.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: simplify default mode setup
Aaro Koskinen [Mon, 29 Aug 2011 20:14:30 +0000 (23:14 +0300)]
staging: xgifb: simplify default mode setup

The default mode is the same regardless of the display type, except for
XG21/LCD which is determined dynamically.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: fail the probe if no supported LCD video mode found
Aaro Koskinen [Mon, 29 Aug 2011 20:14:29 +0000 (23:14 +0300)]
staging: xgifb: fail the probe if no supported LCD video mode found

Fail the probe if the LCD resolution described in card firmware does
not match any of the supported modes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: delete duplicated default video mode setup code
Aaro Koskinen [Mon, 29 Aug 2011 20:14:28 +0000 (23:14 +0300)]
staging: xgifb: delete duplicated default video mode setup code

The code for determining the default video mode is unnecessarily
duplicated in XGIfb_search_mode() and XGIfb_search_vesamode() functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: assume the default video mode also when module
Aaro Koskinen [Mon, 29 Aug 2011 20:14:27 +0000 (23:14 +0300)]
staging: xgifb: assume the default video mode also when module

The same default video mode should be assumed regardless if the driver
is a module or not. This won't change the current behaviour, but it will
simplify further changes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: XGIfb_search_mode(): delete unreachable code
Aaro Koskinen [Mon, 29 Aug 2011 20:14:26 +0000 (23:14 +0300)]
staging: xgifb: XGIfb_search_mode(): delete unreachable code

XGIfb_search_mode() is always called with a valid string pointer.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: search video mode later in probe
Aaro Koskinen [Mon, 29 Aug 2011 20:14:25 +0000 (23:14 +0300)]
staging: xgifb: search video mode later in probe

When searching the video mode, some HW details needs to be
known. Therefore it's not possible to do that reliably before probe().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: fix LVDS LCD resolution data setup
Aaro Koskinen [Mon, 29 Aug 2011 20:14:24 +0000 (23:14 +0300)]
staging: xgifb: fix LVDS LCD resolution data setup

If the driver fails to get LVDS LCD data from the firmware, it falls
back to using driver's hardcoded values. However, this is done too
early in the probe. The selected video mode index is not yet known,
and also in some cases it could be defaulting to -1 resulting in a read
outside the array. Fix this by moving the array lookup after the video
mode validation.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: check and report invalid option values
Aaro Koskinen [Mon, 29 Aug 2011 20:14:23 +0000 (23:14 +0300)]
staging: xgifb: check and report invalid option values

Check option values with kstrtoul(). This will also eliminate some
checkpatch warnings about simple_strtoul() usage.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: XGIfb_setup(): delete redundant assignment
Aaro Koskinen [Mon, 29 Aug 2011 20:14:22 +0000 (23:14 +0300)]
staging: xgifb: XGIfb_setup(): delete redundant assignment

The global data is already initialized to zero.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agostaging: xgifb: XGIfb_setup(): clean up driver messages
Aaro Koskinen [Mon, 29 Aug 2011 20:14:21 +0000 (23:14 +0300)]
staging: xgifb: XGIfb_setup(): clean up driver messages

Print options only if they are given. Delete other messages.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>