03 Jun, 2010
1 commit
-
I2C drivers can use the clientdata-pointer to point to private data. As I2C
devices are not really unregistered, but merely detached from their driver, it
used to be the drivers obligation to clear this pointer during remove() or a
failed probe(). As a couple of drivers forgot to do this, it was agreed that it
was cleaner if the i2c-core does this clearance when appropriate, as there is
no guarantee for the lifetime of the clientdata-pointer after remove() anyhow.
This feature was added to the core with commit
e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers.As there is no need anymore to clear the clientdata-pointer, remove all current
occurrences in the drivers to simplify the code and prevent confusion.Signed-off-by: Wolfram Sang
Acked-by: Mark Brown
Acked-by: Greg Kroah-Hartman
Acked-by: Richard Purdie
Acked-by: Dmitry Torokhov
Signed-off-by: Jean Delvare
28 May, 2010
2 commits
-
Fix a compile issue when openfirmware is enabled from commit
2146325df2c2640059a9e064890c30c6e259b458.Signed-off-by: Richard Purdie
-
Soekris net5501 is x86 only and cleanup some undeeded dependencies
Signed-off-by: Richard Purdie
26 May, 2010
7 commits
-
This add basic led support for Freescale MC13783 PMIC.
Signed-off-by: Philippe Rétornaz
Signed-off-by: Richard Purdie -
In current implementation, if device_create_file failed in register_nasgpio_led,
led_classdev_unregister will be executed twice.
( in register_nasgpio_led it calls led_classdev_unregister before return and in nas_gpio_init out_err )This patch fixes it by only unregistering those that were successfully registered in out_err.
( not including last failed register_nasgpio_led call )Signed-off-by: Axel Lin
Acked-by: Dave Hansen
Signed-off-by: Richard Purdie -
In current implementation, lp3944_probe return 0 even if lp3944_configure fail.
Therefore, led_classdev_unregister will be executed twice
( in error handling of lp3944_configure and lp3944_remove ).
This patch properly handles lp3944_configure fail in lp3944_probe.Signed-off-by: Axel Lin
Acked-by: Wolfram Sang
Acked-by: Antonio Ospite
Signed-off-by: Richard Purdie -
max_brightness is not writable, thus set permissions to 0444.
Signed-off-by: Axel Lin
Signed-off-by: Richard Purdie -
The leds-gpio blink_set() callback follows the same prototype as the
main leds subsystem blink_set() one.The problem is that to stop blink, normally, a leds driver does it
in the brightness_set() callback when asked to set a new fixed value.However, with leds-gpio, the platform has no hook to do so, as this
later callback results in a standard GPIO manipulation.This changes the leds-gpio specific callback to take a new argument
that indicates whether the LED should be blinking or not and in what
state it should be set if not. We also update the dns323 platform
which seems to be the only user of this so far.Signed-off-by: Benjamin Herrenschmidt
Signed-off-by: Richard Purdie -
It is based on the previously submitted code by Alessandro Zummo, but is
changed to use the new GPIO driver with 2.6.33, and the driver has been
moved to drivers/leds where it belongs.[akpm@linux-foundation.org: coding-style fixes]
[randy.dunlap@oracle.com: fix net5501 kconfig]
Signed-off-by: Bjarke Istrup Pedersen
Signed-off-by: Randy Dunlap
Signed-off-by: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Richard Purdie -
Improve device and platform data checks in probe function.
Signed-off-by: Haojian Zhuang
Signed-off-by: Christoph Fritz
Signed-off-by: Richard Purdie
22 May, 2010
1 commit
-
.name, .match_table and .owner are duplicated in both of_platform_driver
and device_driver. This patch is a removes the extra copies from struct
of_platform_driver and converts all users to the device_driver members.This patch is a pretty mechanical change. The usage model doesn't change
and if any drivers have been missed, or if anything has been fixed up
incorrectly, then it will fail with a compile time error, and the fixup
will be trivial. This patch looks big and scary because it touches so
many files, but it should be pretty safe.Signed-off-by: Grant Likely
Acked-by: Sean MacLennan
19 May, 2010
1 commit
-
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)Signed-off-by: Grant Likely
30 Mar, 2010
1 commit
-
…it slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
17 Mar, 2010
7 commits
-
If we were to dynamically register/unregister leds and have udev or other
daemons handle the leds class uevents, we would be notified of the adding of a
new LED and if the daemon immediately tries to open one of the attributes of
the led device, it would fail with a "no such file or directory" error since
this the attributes are not yet created. Fix this by switching attributes to be
class-wide, such that the driver core will register these attributes with
device_add_attrs and then emit the kobject_uevent ADD signal.Signed-off-by: Fainelli
Signed-off-by: Richard Purdie -
The driver wrongly sets default state for LEDs that don't specify
default-state property.Currently the driver handles default state this way:
memset(&led, 0, sizeof(led));
for_each_child_of_node(np, child) {
state = of_get_property(child, "default-state", NULL);
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
...
}
ret = create_gpio_led(&led, ...);
}Which means that all LEDs that do not specify default-state will inherit
the last value of the default-state property, which is wrong.This patch fixes the issue by moving LED's template initialization into
the loop body.Signed-off-by: Anton Vorontsov
Signed-off-by: Andrew Morton
Signed-off-by: Richard Purdie -
This patch adds an LED driver to support the Dell Activity LED on the
Dell Latitude 2100 netbook and future products to come. The Activity LED
is visible externally in the lid so classroom instructors can observe it
from a distance. The driver uses the sysfs led_class and provides a
standard LED interface.Signed-off by: Bob Rodgers
Signed-off-by: Louis Davis
Signed-off-by: Jim Dailey , Developers
Acked-by: Matthew Garrett
Acked-by: Dmitry Torokhov
Signed-off-by: Richard Purdie -
Remove the need for "depends on LEDS_CLASS" by wrapping the affected
config options in an if/endif block. Similar for "depends on LEDS_TRIGGERS".LEDS_COBALT_RAQ still has a "depends on LEDS_CLASS=y" since it cannot
be selected to build as a module.Signed-off-by: H Hartley Sweeten
Signed-off-by: Richard Purdie -
As each led device gets registered a kernel message gets printed. In
an embedded system with a number of leds this can produce a lot
of output that just looks like noise.Change the message type to KERN_DEBUG since it might be useful
in the dmesg output "after" booting.Signed-off-by: H Hartley Sweeten
Signed-off-by: Richard Purdie -
The id_table field of the struct pci_driver is constant in
so it is worth to make pci_device_id also constant.The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)//
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
...
const struct I2 *x;
...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
.x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
//Signed-off-by: Márton Németh
Signed-off-by: Richard Purdie -
The ALIX2 LED driver and the CS5535 GPIO drivers share the same I/O
range which causes a conflict if they're both enabled. Fix this for now
by adding Kconfig dependencies. While at it, also drop the EXPERIMENTAL
flag, as the code has been around for awhile already.Note that this is a hack. At some point, a real platform support for
this board should be added which handles the LEDs via the leds-gpio
driver.Signed-off-by: Daniel Mack
Signed-off-by: Richard Purdie
08 Mar, 2010
1 commit
-
Enable led sub device in Marvell 88PM860x. Two LED arrays can be supported.
Each LED array can be used for R,G,B leds.Signed-off-by: Haojian Zhuang
Signed-off-by: Samuel Ortiz
17 Dec, 2009
6 commits
-
Currently the driver leds-pwm doesn't set max_brightness for the led device
although it's platform data proides a maximum brightness. Instead it stores its
own private driver struct. The max_brightness defaults to 255 for led device if
it has not been set.
As a result any leds-pwm device with a different maximum brightness will show
incorrect behavior, as it is posible to either set a longer then period duty
time or not be able to switch the led to full brightness.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Richard Purdie -
This patch changes the default trigger from "ide-disk"
to "default-on". Users updating from kernels not having this
LED driver will prefer having the same LED behavior as they
used to.Signed-off-by: Florian Fainelli
Signed-off-by: Richard Purdie -
drivers/leds/leds-ss4200.c: In function 'ich7_lpc_probe':
drivers/leds/leds-ss4200.c:353: warning: 'return' with no value, in function returning non-voidSigned-off-by: Andrew Morton
Signed-off-by: Richard Purdie -
This driver provides an interface for controlling LEDs (or vibrators)
connected to PMICs for which there is a regulator framework driver.This driver can be used, for instance, to control vibrator on all Motorola EZX
phones using the pcap-regulator driver services.Signed-off-by: Antonio Ospite
Reviewed-by: Mark Brown
Signed-off-by: Richard Purdie -
Use resource_size() for ioremap.
Signed-off-by: H Hartley Sweeten
Signed-off-by: Richard Purdie -
Use resource_size() for ioremap.
Signed-off-by: H Hartley Sweeten
Signed-off-by: Richard Purdie
16 Dec, 2009
6 commits
-
Signed-off-by: Michael Hennerich
Signed-off-by: Bryan Wu
Signed-off-by: Mike Frysinger
Signed-off-by: Richard Purdie -
The LT3593 is a step-up DC/DC converter designed to drive up to ten
white LEDs in series. The current flow can be set with a control pin.This driver controls any number of such devices connected on generic
GPIOs and exports the function as as platform_driver.The gpio_led platform data struct definition is reused for this purpose.
Successfully tested on a PXA embedded board.
Signed-off-by: Daniel Mack
Signed-off-by: Richard Purdie -
pci_enable_result is defined using the __must_check macro but
leds-ss4200 is not checking the return value.Signed-off-by: Javier Martinez Canillas
Signed-off-by: Dave Hansen
Signed-off-by: Richard Purdie -
This makes the LEDs driver for ALIX2.C boards work with Coreboot by
looking up the port address in the MSR rather than hard-coding it.The BIOS scan also needed some tweaks as the string in Coreboot differs
from the one in the legacy BIOS.Successfully tested with both the legacy tinyBIOS as well as Coreboot
v3.Signed-off-by: Daniel Mack
Signed-off-by: Richard Purdie -
This code is based on a driver that came in the "Open-source
and GPL components" download here:http://downloadcenter.intel.com/SearchResult.aspx?lang=eng&ProductFamily=Server+Products&ProductLine=Intel%C2%AE+Storage+Systems&ProductProduct=Intel%C2%AE+Entry+Storage+System+SS4200-E&OSVersion=OS+Independent
It was in a file called nasgpio.c inside of a second zip file
called SS4200-E_Linux_SIO_Driver-v1.4.zip and is based on this
updated to use the LED subsystem with the ioctl and hardware
monitor support removed.I don't have any need for brightness
control, and its code is *completely* separate from the on/off
controls implemented here. If anyone else wants it, I'd be
happy to look into adding it, but I don't care enough for now.Except for the probe routines, I rewrote most of it. I also
Note that I don't have any hardware documentation except for
the original driver.Thanks go to Arjan for his help in getting the original source
for this released and for chasing down some licensing issues.Signed-off-by: Dave Hansen
Signed-off-by: Richard Purdie -
Makes use of skip_spaces() defined in lib/string.c for removing leading
spaces from strings all over the tree.It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
text data bss dec hex filename
64688 584 592 65864 10148 (TOTALS-BEFORE)
64641 584 592 65817 10119 (TOTALS-AFTER)Also, while at it, if we see (*str && isspace(*str)), we can be sure to
remove the first condition (*str) as the second one (isspace(*str)) also
evaluates to 0 whenever *str == 0, making it redundant. In other words,
"a char equals zero is never a space".Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
and found occurrences of this pattern on 3 more files:
drivers/leds/led-class.c
drivers/leds/ledtrig-timer.c
drivers/video/output.c@@
expression str;
@@( // ignore skip_spaces cases
while (*str && isspace(*str)) { \(str++;\|++str;\) }
|
- *str &&
isspace(*str)
)Signed-off-by: André Goddard Rosa
Cc: Julia Lawall
Cc: Martin Schwidefsky
Cc: Jeff Dike
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: "H. Peter Anvin"
Cc: Richard Purdie
Cc: Neil Brown
Cc: Kyle McMartin
Cc: Henrique de Moraes Holschuh
Cc: David Howells
Cc:
Cc: Samuel Ortiz
Cc: Patrick McHardy
Cc: Takashi Iwai
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Dec, 2009
1 commit
-
* 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6:
IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four.
IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files.
IXP4xx: move Gemtek GTWX5715 platform macros to the platform code.
IXP4xx: Remove unused Motorola PrPMC1100 platform macros.
IXP4xx: move FSG platform macros to the platform code.
IXP4xx: move DSM G600 platform macros to the platform code.
IXP4xx: move NAS100D platform macros to the platform code.
IXP4xx: move NSLU2 platform macros to the platform code.
IXP4xx: move Coyote platform macros to the platform code.
IXP4xx: move AVILA platform macros to the platform code.
IXP4xx: move IXDP425 platform macros to the platform code.
IXP4xx: Extend PCI MMIO indirect address space to 1 GB.
IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI.
IXP4xx: Drop "__ixp4xx_" prefix from in/out/ioread/iowrite functions for clarity.
IXP4xx: Rename indirect MMIO primitives from __ixp4xx_* to __indirect_*.
IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request().
ARM: fix insl() and outsl() endianness on IXP4xx architecture.
IXP4xx: Fix normally-disabled debugging text in drivers/net/arm/ixp4xx_eth.c.
IXP4xx: change the timer base frequency to 66.666000 MHz.
09 Dec, 2009
1 commit
-
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (149 commits)
arm: omap: Add omap3_defconfig
AM35xx: Defconfig for AM3517 EVM board
AM35xx: Add support for AM3517 EVM board
omap: 3630sdp: defconfig creation
omap: 3630sdp: introduce 3630 sdp board support
omap3: Add defconfig for IGEP v2 board
omap3: Add minimal IGEP v2 support
omap3: Add CompuLab CM-T35 defconfig
omap3: Add CompuLab CM-T35 board support
omap3: rx51: Add wl1251 wlan driver support
omap3: rx51: Add SDRAM init
omap1: Add default kernel configuration for Herald
omap1: Add board support and LCD for HTC Herald
omap: zoom2: update defconfig for LL_DEBUG_NONE
omap: zoom3: defconfig creation
omap3: zoom: Introduce zoom3 board support
omap3: zoom: Drop i2c-1 speed to 2400
omap3: zoom: rename zoom2 name to generic zoom
omap3: zoom: split board file for software reuse
omap3evm: MIgrate to smsc911x ethernet driver
...Fix trivial conflict (two unrelated config options added next to each
other) in arch/arm/mach-omap2/Makefile
05 Dec, 2009
1 commit
-
Signed-off-by: Krzysztof Hałasa
28 Nov, 2009
1 commit
-
Collie uses now the powersupply framework. Change the
default led-trigger of locomo-led to reflect that.
23 Nov, 2009
1 commit
-
Merge branch '7xx-iosplit-plat-merge' into omap-for-linus
16 Nov, 2009
1 commit
-
If there are leds present in the OF tree, but the GPIOs for (some) of
them are unavailable, led_data doesn't get populated with correct
devices. Then, on device unbinding, one can crash the kernel.Workaround this by setting led->gpio to invalid value early.
Signed-off-by: Dmitry Eremin-Solenikov
Signed-off-by: Richard Purdie
21 Oct, 2009
1 commit
-
Move the remaining headers under plat-omap/include/mach
to plat-omap/include/plat. Also search and replace the
files using these headers to include using the right path.This was done with:
#!/bin/bash
mach_dir_old="arch/arm/plat-omap/include/mach"
plat_dir_new="arch/arm/plat-omap/include/plat"
headers=$(cd $mach_dir_old && ls *.h)
omap_dirs="arch/arm/*omap*/ \
drivers/video/omap \
sound/soc/omap"
other_files="drivers/leds/leds-ams-delta.c \
drivers/mfd/menelaus.c \
drivers/mfd/twl4030-core.c \
drivers/mtd/nand/ams-delta.c"for header in $headers; do
old="#include