History log of /linux-master/drivers/platform/x86/toshiba_haps.c
Revision Date Author Comments
# 6c0eb5ba 13-Nov-2022 Dawei Li <set_pte_at@outlook.com>

ACPI: make remove callback of ACPI driver void

For bus-based driver, device removal is implemented as:
1 device_remove()->
2 bus->remove()->
3 driver->remove()

Driver core needs no inform from callee(bus driver) about the
result of remove callback. In that case, commit fc7a6209d571
("bus: Make remove callback return void") forces bus_type::remove
be void-returned.

Now we have the situation that both 1 & 2 of calling chain are
void-returned, so it does not make much sense for 3(driver->remove)
to return non-void to its caller.

So the basic idea behind this change is making remove() callback of
any bus-based driver to be void-returned.

This change, for itself, is for device drivers based on acpi-bus.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for drivers/platform/surface/*
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 7dc4a18d 19-May-2021 Hans de Goede <hdegoede@redhat.com>

platform/x86: toshiba_haps: Fix missing newline in pr_debug call in toshiba_haps_notify

The pr_debug() call in toshiba_haps_notify() is missing a newline at the
end of the string, add this.

BugLink: https://bugs.debian.org/799193
Reported-by: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210519135618.139701-1-hdegoede@redhat.com


# c942fddf 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157

Based on 3 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] this program is distributed in the hope that
it will be useful but without any warranty without even the implied
warranty of merchantability or fitness for a particular purpose see
the gnu general public license for more details

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] this program is distributed in the hope
that it will be useful but without any warranty without even the
implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 36a1f2c6 23-Jun-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

platform/x86: toshiba_haps: constify haps_attr_group

File size before:
text data bss dec hex filename
1471 528 8 2007 7d7 drivers/platform/x86/toshiba_haps.o

File size After adding 'const':
text data bss dec hex filename
1519 464 8 1991 7c7 drivers/platform/x86/toshiba_haps.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


# baae5f91 07-Sep-2016 Azael Avalos <coproscefalo@gmail.com>

platform/x86: toshiba_haps: Change logging level from info to debug

Two of the internal functions are printing an info message, one
whenever the HDD protection level changes, and another when the
driver receives an ACPI event.

This patch changes those two prints to debug, as that information
is more pertaining to debuging purposes.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 55455449 07-Sep-2016 Azael Avalos <coproscefalo@gmail.com>

platform/x86: toshiba_haps: Split ACPI and HDD protection error handling

Currently the code checking for the ACPI status is mixed along with
the actual HDD protection status check.

This patch splits those two checks as they are not related, printing
an error string in case the ACPI call failed, and then check for
actual HDD protection status.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 7dd62c01 26-Feb-2015 Azael Avalos <coproscefalo@gmail.com>

toshiba_haps: Make use of DEVICE_ATTR_{RW, WO} macros

This patch makes use of DEVICE_ATTR_{RW, WO} macros, simplifying
device attributes creation.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# a8820037 26-Feb-2015 Azael Avalos <coproscefalo@gmail.com>

toshiba_haps: Replace sscanf with kstrtoint

This patch simply replaces the use of sscanf with kstrtoint returning
the error code in case that something went bad.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>


# 23d0ba0c 14-Aug-2014 Azael Avalos <coproscefalo@gmail.com>

platform/x86: Toshiba HDD Active Protection Sensor

This driver adds support for the built-in accelereometer found
on recent Toshiba laptops with HID TOS620A.

This driver receives ACPI notify events 0x80 when the sensor
detects a sudden move or a harsh vibration, as well as an
ACPI notify event 0x81 whenever the movement or vibration has
been stabilized.

Also provides sysfs entries to get/set the desired protection
level and reseting the HDD protection interface.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>