aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorAzael Avalos <coproscefalo@gmail.com>2015-02-11 01:43:58 -0500
committerDarren Hart <dvhart@linux.intel.com>2015-02-12 00:16:27 -0500
commit9bd1213b12debacd7db26108bd8b7bb0a5d772a9 (patch)
tree1af6c79549f2bb739ca7940fd5dfdbe1f3234a16 /drivers/platform/x86
parent15667b2c1d0dcd554c515ebcf04e7f1733891cc9 (diff)
toshiba_acpi: Move sysfs function and struct declarations further down
Commit 93f8c16d635e ("toshiba_acpi: Support new keyboard backlight type") moved all the sysfs structs and function declarations further up in order to make use of sysfs_update_group, however, commit 805469053ba9 ("toshiba_acpi: Add keyboard backlight mode change event") made use of that function unnecesary. This patch moves all the sysfs structs and function declarations further down, making the file shorther in lines and more readable. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c196
1 files changed, 58 insertions, 138 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 734c98f9d493..c4f9d812bbd0 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1677,144 +1677,6 @@ static const struct backlight_ops toshiba_backlight_data = {
1677 * Sysfs files 1677 * Sysfs files
1678 */ 1678 */
1679static ssize_t toshiba_version_show(struct device *dev, 1679static ssize_t toshiba_version_show(struct device *dev,
1680 struct device_attribute *attr, char *buf);
1681static ssize_t toshiba_fan_store(struct device *dev,
1682 struct device_attribute *attr,
1683 const char *buf, size_t count);
1684static ssize_t toshiba_fan_show(struct device *dev,
1685 struct device_attribute *attr, char *buf);
1686static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
1687 struct device_attribute *attr,
1688 const char *buf, size_t count);
1689static ssize_t toshiba_kbd_bl_mode_show(struct device *dev,
1690 struct device_attribute *attr,
1691 char *buf);
1692static ssize_t toshiba_kbd_type_show(struct device *dev,
1693 struct device_attribute *attr,
1694 char *buf);
1695static ssize_t toshiba_available_kbd_modes_show(struct device *dev,
1696 struct device_attribute *attr,
1697 char *buf);
1698static ssize_t toshiba_kbd_bl_timeout_store(struct device *dev,
1699 struct device_attribute *attr,
1700 const char *buf, size_t count);
1701static ssize_t toshiba_kbd_bl_timeout_show(struct device *dev,
1702 struct device_attribute *attr,
1703 char *buf);
1704static ssize_t toshiba_touchpad_store(struct device *dev,
1705 struct device_attribute *attr,
1706 const char *buf, size_t count);
1707static ssize_t toshiba_touchpad_show(struct device *dev,
1708 struct device_attribute *attr,
1709 char *buf);
1710static ssize_t toshiba_position_show(struct device *dev,
1711 struct device_attribute *attr,
1712 char *buf);
1713static ssize_t toshiba_usb_sleep_charge_show(struct device *dev,
1714 struct device_attribute *attr,
1715 char *buf);
1716static ssize_t toshiba_usb_sleep_charge_store(struct device *dev,
1717 struct device_attribute *attr,
1718 const char *buf, size_t count);
1719static ssize_t sleep_functions_on_battery_show(struct device *dev,
1720 struct device_attribute *attr,
1721 char *buf);
1722static ssize_t sleep_functions_on_battery_store(struct device *dev,
1723 struct device_attribute *attr,
1724 const char *buf, size_t count);
1725static ssize_t toshiba_usb_rapid_charge_show(struct device *dev,
1726 struct device_attribute *attr,
1727 char *buf);
1728static ssize_t toshiba_usb_rapid_charge_store(struct device *dev,
1729 struct device_attribute *attr,
1730 const char *buf, size_t count);
1731static ssize_t toshiba_usb_sleep_music_show(struct device *dev,
1732 struct device_attribute *attr,
1733 char *buf);
1734static ssize_t toshiba_usb_sleep_music_store(struct device *dev,
1735 struct device_attribute *attr,
1736 const char *buf, size_t count);
1737static ssize_t toshiba_kbd_function_keys_show(struct device *dev,
1738 struct device_attribute *attr,
1739 char *buf);
1740static ssize_t toshiba_kbd_function_keys_store(struct device *dev,
1741 struct device_attribute *attr,
1742 const char *buf, size_t count);
1743static ssize_t toshiba_panel_power_on_show(struct device *dev,
1744 struct device_attribute *attr,
1745 char *buf);
1746static ssize_t toshiba_panel_power_on_store(struct device *dev,
1747 struct device_attribute *attr,
1748 const char *buf, size_t count);
1749static ssize_t toshiba_usb_three_show(struct device *dev,
1750 struct device_attribute *attr,
1751 char *buf);
1752static ssize_t toshiba_usb_three_store(struct device *dev,
1753 struct device_attribute *attr,
1754 const char *buf, size_t count);
1755
1756static DEVICE_ATTR(version, S_IRUGO, toshiba_version_show, NULL);
1757static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR,
1758 toshiba_fan_show, toshiba_fan_store);
1759static DEVICE_ATTR(kbd_backlight_mode, S_IRUGO | S_IWUSR,
1760 toshiba_kbd_bl_mode_show, toshiba_kbd_bl_mode_store);
1761static DEVICE_ATTR(kbd_type, S_IRUGO, toshiba_kbd_type_show, NULL);
1762static DEVICE_ATTR(available_kbd_modes, S_IRUGO,
1763 toshiba_available_kbd_modes_show, NULL);
1764static DEVICE_ATTR(kbd_backlight_timeout, S_IRUGO | S_IWUSR,
1765 toshiba_kbd_bl_timeout_show, toshiba_kbd_bl_timeout_store);
1766static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR,
1767 toshiba_touchpad_show, toshiba_touchpad_store);
1768static DEVICE_ATTR(position, S_IRUGO, toshiba_position_show, NULL);
1769static DEVICE_ATTR(usb_sleep_charge, S_IRUGO | S_IWUSR,
1770 toshiba_usb_sleep_charge_show,
1771 toshiba_usb_sleep_charge_store);
1772static DEVICE_ATTR(sleep_functions_on_battery, S_IRUGO | S_IWUSR,
1773 sleep_functions_on_battery_show,
1774 sleep_functions_on_battery_store);
1775static DEVICE_ATTR(usb_rapid_charge, S_IRUGO | S_IWUSR,
1776 toshiba_usb_rapid_charge_show,
1777 toshiba_usb_rapid_charge_store);
1778static DEVICE_ATTR(usb_sleep_music, S_IRUGO | S_IWUSR,
1779 toshiba_usb_sleep_music_show,
1780 toshiba_usb_sleep_music_store);
1781static DEVICE_ATTR(kbd_function_keys, S_IRUGO | S_IWUSR,
1782 toshiba_kbd_function_keys_show,
1783 toshiba_kbd_function_keys_store);
1784static DEVICE_ATTR(panel_power_on, S_IRUGO | S_IWUSR,
1785 toshiba_panel_power_on_show,
1786 toshiba_panel_power_on_store);
1787static DEVICE_ATTR(usb_three, S_IRUGO | S_IWUSR,
1788 toshiba_usb_three_show, toshiba_usb_three_store);
1789
1790static struct attribute *toshiba_attributes[] = {
1791 &dev_attr_version.attr,
1792 &dev_attr_fan.attr,
1793 &dev_attr_kbd_backlight_mode.attr,
1794 &dev_attr_kbd_type.attr,
1795 &dev_attr_available_kbd_modes.attr,
1796 &dev_attr_kbd_backlight_timeout.attr,
1797 &dev_attr_touchpad.attr,
1798 &dev_attr_position.attr,
1799 &dev_attr_usb_sleep_charge.attr,
1800 &dev_attr_sleep_functions_on_battery.attr,
1801 &dev_attr_usb_rapid_charge.attr,
1802 &dev_attr_usb_sleep_music.attr,
1803 &dev_attr_kbd_function_keys.attr,
1804 &dev_attr_panel_power_on.attr,
1805 &dev_attr_usb_three.attr,
1806 NULL,
1807};
1808
1809static umode_t toshiba_sysfs_is_visible(struct kobject *,
1810 struct attribute *, int);
1811
1812static struct attribute_group toshiba_attr_group = {
1813 .is_visible = toshiba_sysfs_is_visible,
1814 .attrs = toshiba_attributes,
1815};
1816
1817static ssize_t toshiba_version_show(struct device *dev,
1818 struct device_attribute *attr, char *buf) 1680 struct device_attribute *attr, char *buf)
1819{ 1681{
1820 return sprintf(buf, "%s\n", TOSHIBA_ACPI_VERSION); 1682 return sprintf(buf, "%s\n", TOSHIBA_ACPI_VERSION);
@@ -2370,6 +2232,59 @@ static ssize_t toshiba_usb_three_store(struct device *dev,
2370 return count; 2232 return count;
2371} 2233}
2372 2234
2235static DEVICE_ATTR(version, S_IRUGO, toshiba_version_show, NULL);
2236static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR,
2237 toshiba_fan_show, toshiba_fan_store);
2238static DEVICE_ATTR(kbd_backlight_mode, S_IRUGO | S_IWUSR,
2239 toshiba_kbd_bl_mode_show, toshiba_kbd_bl_mode_store);
2240static DEVICE_ATTR(kbd_type, S_IRUGO, toshiba_kbd_type_show, NULL);
2241static DEVICE_ATTR(available_kbd_modes, S_IRUGO,
2242 toshiba_available_kbd_modes_show, NULL);
2243static DEVICE_ATTR(kbd_backlight_timeout, S_IRUGO | S_IWUSR,
2244 toshiba_kbd_bl_timeout_show, toshiba_kbd_bl_timeout_store);
2245static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR,
2246 toshiba_touchpad_show, toshiba_touchpad_store);
2247static DEVICE_ATTR(position, S_IRUGO, toshiba_position_show, NULL);
2248static DEVICE_ATTR(usb_sleep_charge, S_IRUGO | S_IWUSR,
2249 toshiba_usb_sleep_charge_show,
2250 toshiba_usb_sleep_charge_store);
2251static DEVICE_ATTR(sleep_functions_on_battery, S_IRUGO | S_IWUSR,
2252 sleep_functions_on_battery_show,
2253 sleep_functions_on_battery_store);
2254static DEVICE_ATTR(usb_rapid_charge, S_IRUGO | S_IWUSR,
2255 toshiba_usb_rapid_charge_show,
2256 toshiba_usb_rapid_charge_store);
2257static DEVICE_ATTR(usb_sleep_music, S_IRUGO | S_IWUSR,
2258 toshiba_usb_sleep_music_show,
2259 toshiba_usb_sleep_music_store);
2260static DEVICE_ATTR(kbd_function_keys, S_IRUGO | S_IWUSR,
2261 toshiba_kbd_function_keys_show,
2262 toshiba_kbd_function_keys_store);
2263static DEVICE_ATTR(panel_power_on, S_IRUGO | S_IWUSR,
2264 toshiba_panel_power_on_show,
2265 toshiba_panel_power_on_store);
2266static DEVICE_ATTR(usb_three, S_IRUGO | S_IWUSR,
2267 toshiba_usb_three_show, toshiba_usb_three_store);
2268
2269static struct attribute *toshiba_attributes[] = {
2270 &dev_attr_version.attr,
2271 &dev_attr_fan.attr,
2272 &dev_attr_kbd_backlight_mode.attr,
2273 &dev_attr_kbd_type.attr,
2274 &dev_attr_available_kbd_modes.attr,
2275 &dev_attr_kbd_backlight_timeout.attr,
2276 &dev_attr_touchpad.attr,
2277 &dev_attr_position.attr,
2278 &dev_attr_usb_sleep_charge.attr,
2279 &dev_attr_sleep_functions_on_battery.attr,
2280 &dev_attr_usb_rapid_charge.attr,
2281 &dev_attr_usb_sleep_music.attr,
2282 &dev_attr_kbd_function_keys.attr,
2283 &dev_attr_panel_power_on.attr,
2284 &dev_attr_usb_three.attr,
2285 NULL,
2286};
2287
2373static umode_t toshiba_sysfs_is_visible(struct kobject *kobj, 2288static umode_t toshiba_sysfs_is_visible(struct kobject *kobj,
2374 struct attribute *attr, int idx) 2289 struct attribute *attr, int idx)
2375{ 2290{
@@ -2405,6 +2320,11 @@ static umode_t toshiba_sysfs_is_visible(struct kobject *kobj,
2405 return exists ? attr->mode : 0; 2320 return exists ? attr->mode : 0;
2406} 2321}
2407 2322
2323static struct attribute_group toshiba_attr_group = {
2324 .is_visible = toshiba_sysfs_is_visible,
2325 .attrs = toshiba_attributes,
2326};
2327
2408/* 2328/*
2409 * Hotkeys 2329 * Hotkeys
2410 */ 2330 */