25 Aug, 2007

1 commit


24 Aug, 2007

2 commits

  • The asus laptop driver conditionnaly registers leds in asus_led_register()
    depending on their availability, but unconditionnaly unregisters them all at
    exit time or when the module fails to load. Unregistering not registered leds
    result in the following Oops. So we should check before unregistering.

    [] do_page_fault+0x511/0x5e9
    [] error_code+0x6a/0x70
    [] device_unregister+0x26/0x32
    [] led_classdev_unregister+0x58/0x94 [led_class]
    [] asus_led_exit+0x17/0x41 [asus_laptop]
    [] asus_laptop_exit+0xd/0x3f [asus_laptop]
    [] sys_delete_module+0x17b/0x1a2
    [] sysenter_past_esp+0x6b/0xa1

    EIP: [] device_del+0xb/0x23a SS:ESP 0068:f594ef0c

    Signed-off-by: Guillaume Chazarain
    Signed-off-by: Len Brown

    Guillaume Chazarain
     
  • Schedule /proc/acpi/event for removal in 6 months.

    Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event()
    to make sure there is no confusion that it is for /proc/acpi/event only.

    Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event.
    There is no functional change if CONFIG_ACPI_PROC_EVENT=y

    Signed-off-by: Len Brown

    Len Brown
     

25 Jul, 2007

1 commit


24 Jul, 2007

2 commits

  • modpost is going to use these to create e.g. acpi:ACPI0001
    in modules.alias.

    Signed-off-by: Thomas Renninger
    Signed-off-by: Len Brown

    Thomas Renninger
     
  • > Subject : drivers/misc/asus-laptop.c:*: error: 'struct led_classdev' has no member named 'class_dev'
    > References : http://lkml.org/lkml/2007/7/22/299
    > Submitter : Gabriel C

    Fallout from f8a7c6fe14f556ca8eeddce258cb21392d0c3a2f. However, looking
    at it shows that checks done in ASUS_LED_UNREGISTER() can't trigger
    at all (we never get to asus_led_exit() if registration fails) and
    if that registration fails, we actually leak stuff. IOW, it's worse
    than just replacing class_dev with dev in there - the tests themselves
    had been papering over the lousy cleanup logics.

    Signed-off-by: Al Viro
    Signed-off-by: Len Brown

    Al Viro
     

20 Jul, 2007

1 commit

  • Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).

    Here is a short excerpt of the semantic patch performing
    this transformation:

    @@
    type T2;
    expression x;
    identifier f,fld;
    expression E;
    expression E1,E2;
    expression e1,e2,e3,y;
    statement S;
    @@

    x =
    - kmalloc
    + kzalloc
    (E1,E2)
    ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
    - memset((T2)x,0,E1);

    @@
    expression E1,E2,E3;
    @@

    - kzalloc(E1 * E2,E3)
    + kcalloc(E1,E2,E3)

    [akpm@linux-foundation.org: get kcalloc args the right way around]
    Signed-off-by: Yoann Padioleau
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Acked-by: Russell King
    Cc: Bryan Wu
    Acked-by: Jiri Slaby
    Cc: Dave Airlie
    Acked-by: Roland Dreier
    Cc: Jiri Kosina
    Acked-by: Dmitry Torokhov
    Cc: Benjamin Herrenschmidt
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Pierre Ossman
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Acked-by: Greg KH
    Cc: James Bottomley
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yoann Padioleau
     

12 Jul, 2007

1 commit

  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

10 May, 2007

4 commits


12 Mar, 2007

5 commits


10 Mar, 2007

1 commit


20 Feb, 2007

3 commits

  • Per device data such as brightness belongs to the indivdual device
    and should therefore be separate from the the backlight operation
    function pointers. This patch splits the two types of data and
    allows simplifcation of some code.

    Signed-off-by: Richard Purdie

    Richard Purdie
     
  • backlight_device->sem has a very specific use as documented in the
    header file. The external users of this are using it for a different
    reason, to serialise access to the update_status() method.

    backlight users were supposed to implement their own internal
    serialisation of update_status() if needed but everyone is doing
    things differently and incorrectly. Therefore add a global mutex to
    take care of serialisation for everyone, once and for all.

    Locking for get_brightness remains optional since most users don't
    need it.

    Also update the lcd class in a similar way.

    Signed-off-by: Richard Purdie

    Richard Purdie
     
  • Remove uneeded owner field from backlight_properties structure.

    Nothing uses it and it is unlikely that it will ever be used. The
    backlight class uses other means to ensure that nothing references
    unloaded code.

    Based on a patch from Dmitry Torokhov

    Signed-off-by: Richard Purdie

    Richard Purdie
     

17 Feb, 2007

1 commit


03 Feb, 2007

1 commit


30 Jan, 2007

8 commits

  • Signed-off-by: Len Brown

    Len Brown
     
  • /proc/acpi/asus/lslvl is now /sys/.../asus-laptop/ls_level
    /proc/acpi/asus/lssw is now /sys/.../asus-laptop/ls_switch nothing
    else ..

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • Ledd is a special led ... /sys/.../asus-laptop/ledd works like
    /proc/acpi/asus/ledd

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • /sys/.../asus-laptop/display can now be used to switch displays
    like the old /proc/acpi/asus/disp does

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • Adds backlight support using backlight class. We now
    change the brightness *and toggle the backlight !* via
    /sys/class/backlight/asus-laptop/.

    If the user switchs the backlight using the keyboard,
    asus_hotk_notify looks for ATKD_LCD_OFF and ATKD_LCD_ON events,
    and stores the right state into hotk->status and bd->props->power .

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • WLED and BLED are not handled like other leds (MLED, etc ..),
    because sometime they also control the wlan/bluetooth device.
    If the method for wireless_status is found, it's used to get the
    status, otherwise hotk->status is used. We also use the HWRS
    method, which tell if the bluetooth/wlan device is present or not.
    This patch show why we need a ASUS_SET_DEVICE_ATTR macro : if
    there is a bluetooth device, /sys/dev.../asus-laptop/bluetooth
    is usable, else it's not but it's clean.

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • Add led support, using generic led class. Thomas Tuttle's patch
    was very usefull. We use
    hotk->status to store led status because it's very hard to find
    acpi method to get the right status... To reduce the code,
    I use a lot of macro (ASUS_LED, ASUS_LED_REGISTER, etc ...),
    because the code is the same for all leds ...

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary
     
  • Adds the new driver and make ASUS_LAPTOP and ACPI_ASUS
    incompatible. It may be strange to use ASUS_CREATE_DEVICE_ATTR
    and ASUS_SET_DEVICE_ATTR now, but these macro will be very
    usefull in next patchs. ASUS_HANDLE and ASUS_HANDLE_INIT comes
    from IBM_HANDLE and IBM_HANDLE_INIT, with some modification,
    and will also be used in next patchs.

    Signed-off-by: Corentin Chary
    Signed-off-by: Len Brown

    Corentin Chary