summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorAzael Avalos <coproscefalo@gmail.com>2015-02-11 01:43:59 -0500
committerDarren Hart <dvhart@linux.intel.com>2015-02-12 00:17:18 -0500
commit9d3098481934a421ce8b1ce230d22e49f38a2a0b (patch)
treef29df1934d4b95271b4af6224e51b4d743f2d4a2 /drivers/platform
parent9bd1213b12debacd7db26108bd8b7bb0a5d772a9 (diff)
toshiba_acpi: Drop the toshiba_ prefix from sysfs function names
This patch removes the toshiba_ prefix from all the sysfs function names and adapted the code according to coding style. Also a few functions were renamed to match the sysfs entry, as this patch is a preparation for the next patch to switch to DEVICE_ATTR_{RO, RW, WO} macros. Signed-off-by: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c164
1 files changed, 75 insertions, 89 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index c4f9d812bbd0..f66e0aa63d84 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1676,15 +1676,15 @@ static const struct backlight_ops toshiba_backlight_data = {
1676/* 1676/*
1677 * Sysfs files 1677 * Sysfs files
1678 */ 1678 */
1679static ssize_t toshiba_version_show(struct device *dev, 1679static ssize_t version_show(struct device *dev,
1680 struct device_attribute *attr, char *buf) 1680 struct device_attribute *attr, char *buf)
1681{ 1681{
1682 return sprintf(buf, "%s\n", TOSHIBA_ACPI_VERSION); 1682 return sprintf(buf, "%s\n", TOSHIBA_ACPI_VERSION);
1683} 1683}
1684 1684
1685static ssize_t toshiba_fan_store(struct device *dev, 1685static ssize_t fan_store(struct device *dev,
1686 struct device_attribute *attr, 1686 struct device_attribute *attr,
1687 const char *buf, size_t count) 1687 const char *buf, size_t count)
1688{ 1688{
1689 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1689 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1690 u32 result; 1690 u32 result;
@@ -1707,8 +1707,8 @@ static ssize_t toshiba_fan_store(struct device *dev,
1707 return count; 1707 return count;
1708} 1708}
1709 1709
1710static ssize_t toshiba_fan_show(struct device *dev, 1710static ssize_t fan_show(struct device *dev,
1711 struct device_attribute *attr, char *buf) 1711 struct device_attribute *attr, char *buf)
1712{ 1712{
1713 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1713 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1714 u32 value; 1714 u32 value;
@@ -1721,9 +1721,9 @@ static ssize_t toshiba_fan_show(struct device *dev,
1721 return sprintf(buf, "%d\n", value); 1721 return sprintf(buf, "%d\n", value);
1722} 1722}
1723 1723
1724static ssize_t toshiba_kbd_bl_mode_store(struct device *dev, 1724static ssize_t kbd_backlight_mode_store(struct device *dev,
1725 struct device_attribute *attr, 1725 struct device_attribute *attr,
1726 const char *buf, size_t count) 1726 const char *buf, size_t count)
1727{ 1727{
1728 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1728 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1729 int mode; 1729 int mode;
@@ -1778,9 +1778,9 @@ static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
1778 return count; 1778 return count;
1779} 1779}
1780 1780
1781static ssize_t toshiba_kbd_bl_mode_show(struct device *dev, 1781static ssize_t kbd_backlight_mode_show(struct device *dev,
1782 struct device_attribute *attr, 1782 struct device_attribute *attr,
1783 char *buf) 1783 char *buf)
1784{ 1784{
1785 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1785 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1786 u32 time; 1786 u32 time;
@@ -1791,18 +1791,17 @@ static ssize_t toshiba_kbd_bl_mode_show(struct device *dev,
1791 return sprintf(buf, "%i\n", time & SCI_KBD_MODE_MASK); 1791 return sprintf(buf, "%i\n", time & SCI_KBD_MODE_MASK);
1792} 1792}
1793 1793
1794static ssize_t toshiba_kbd_type_show(struct device *dev, 1794static ssize_t kbd_type_show(struct device *dev,
1795 struct device_attribute *attr, 1795 struct device_attribute *attr, char *buf)
1796 char *buf)
1797{ 1796{
1798 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1797 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1799 1798
1800 return sprintf(buf, "%d\n", toshiba->kbd_type); 1799 return sprintf(buf, "%d\n", toshiba->kbd_type);
1801} 1800}
1802 1801
1803static ssize_t toshiba_available_kbd_modes_show(struct device *dev, 1802static ssize_t available_kbd_modes_show(struct device *dev,
1804 struct device_attribute *attr, 1803 struct device_attribute *attr,
1805 char *buf) 1804 char *buf)
1806{ 1805{
1807 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1806 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1808 1807
@@ -1814,9 +1813,9 @@ static ssize_t toshiba_available_kbd_modes_show(struct device *dev,
1814 SCI_KBD_MODE_AUTO, SCI_KBD_MODE_ON, SCI_KBD_MODE_OFF); 1813 SCI_KBD_MODE_AUTO, SCI_KBD_MODE_ON, SCI_KBD_MODE_OFF);
1815} 1814}
1816 1815
1817static ssize_t toshiba_kbd_bl_timeout_store(struct device *dev, 1816static ssize_t kbd_backlight_timeout_store(struct device *dev,
1818 struct device_attribute *attr, 1817 struct device_attribute *attr,
1819 const char *buf, size_t count) 1818 const char *buf, size_t count)
1820{ 1819{
1821 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1820 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1822 int time; 1821 int time;
@@ -1857,9 +1856,9 @@ static ssize_t toshiba_kbd_bl_timeout_store(struct device *dev,
1857 return count; 1856 return count;
1858} 1857}
1859 1858
1860static ssize_t toshiba_kbd_bl_timeout_show(struct device *dev, 1859static ssize_t kbd_backlight_timeout_show(struct device *dev,
1861 struct device_attribute *attr, 1860 struct device_attribute *attr,
1862 char *buf) 1861 char *buf)
1863{ 1862{
1864 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1863 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1865 u32 time; 1864 u32 time;
@@ -1870,9 +1869,9 @@ static ssize_t toshiba_kbd_bl_timeout_show(struct device *dev,
1870 return sprintf(buf, "%i\n", time >> HCI_MISC_SHIFT); 1869 return sprintf(buf, "%i\n", time >> HCI_MISC_SHIFT);
1871} 1870}
1872 1871
1873static ssize_t toshiba_touchpad_store(struct device *dev, 1872static ssize_t touchpad_store(struct device *dev,
1874 struct device_attribute *attr, 1873 struct device_attribute *attr,
1875 const char *buf, size_t count) 1874 const char *buf, size_t count)
1876{ 1875{
1877 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1876 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1878 int state; 1877 int state;
@@ -1892,8 +1891,8 @@ static ssize_t toshiba_touchpad_store(struct device *dev,
1892 return count; 1891 return count;
1893} 1892}
1894 1893
1895static ssize_t toshiba_touchpad_show(struct device *dev, 1894static ssize_t touchpad_show(struct device *dev,
1896 struct device_attribute *attr, char *buf) 1895 struct device_attribute *attr, char *buf)
1897{ 1896{
1898 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1897 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1899 u32 state; 1898 u32 state;
@@ -1906,8 +1905,8 @@ static ssize_t toshiba_touchpad_show(struct device *dev,
1906 return sprintf(buf, "%i\n", state); 1905 return sprintf(buf, "%i\n", state);
1907} 1906}
1908 1907
1909static ssize_t toshiba_position_show(struct device *dev, 1908static ssize_t position_show(struct device *dev,
1910 struct device_attribute *attr, char *buf) 1909 struct device_attribute *attr, char *buf)
1911{ 1910{
1912 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1911 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1913 u32 xyval, zval, tmp; 1912 u32 xyval, zval, tmp;
@@ -1927,9 +1926,8 @@ static ssize_t toshiba_position_show(struct device *dev,
1927 return sprintf(buf, "%d %d %d\n", x, y, z); 1926 return sprintf(buf, "%d %d %d\n", x, y, z);
1928} 1927}
1929 1928
1930static ssize_t toshiba_usb_sleep_charge_show(struct device *dev, 1929static ssize_t usb_sleep_charge_show(struct device *dev,
1931 struct device_attribute *attr, 1930 struct device_attribute *attr, char *buf)
1932 char *buf)
1933{ 1931{
1934 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1932 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1935 u32 mode; 1933 u32 mode;
@@ -1942,9 +1940,9 @@ static ssize_t toshiba_usb_sleep_charge_show(struct device *dev,
1942 return sprintf(buf, "%x\n", mode & SCI_USB_CHARGE_MODE_MASK); 1940 return sprintf(buf, "%x\n", mode & SCI_USB_CHARGE_MODE_MASK);
1943} 1941}
1944 1942
1945static ssize_t toshiba_usb_sleep_charge_store(struct device *dev, 1943static ssize_t usb_sleep_charge_store(struct device *dev,
1946 struct device_attribute *attr, 1944 struct device_attribute *attr,
1947 const char *buf, size_t count) 1945 const char *buf, size_t count)
1948{ 1946{
1949 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1947 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1950 u32 mode; 1948 u32 mode;
@@ -2038,9 +2036,8 @@ static ssize_t sleep_functions_on_battery_store(struct device *dev,
2038 return count; 2036 return count;
2039} 2037}
2040 2038
2041static ssize_t toshiba_usb_rapid_charge_show(struct device *dev, 2039static ssize_t usb_rapid_charge_show(struct device *dev,
2042 struct device_attribute *attr, 2040 struct device_attribute *attr, char *buf)
2043 char *buf)
2044{ 2041{
2045 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2042 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2046 u32 state; 2043 u32 state;
@@ -2053,9 +2050,9 @@ static ssize_t toshiba_usb_rapid_charge_show(struct device *dev,
2053 return sprintf(buf, "%d\n", state); 2050 return sprintf(buf, "%d\n", state);
2054} 2051}
2055 2052
2056static ssize_t toshiba_usb_rapid_charge_store(struct device *dev, 2053static ssize_t usb_rapid_charge_store(struct device *dev,
2057 struct device_attribute *attr, 2054 struct device_attribute *attr,
2058 const char *buf, size_t count) 2055 const char *buf, size_t count)
2059{ 2056{
2060 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2057 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2061 int state; 2058 int state;
@@ -2074,9 +2071,8 @@ static ssize_t toshiba_usb_rapid_charge_store(struct device *dev,
2074 return count; 2071 return count;
2075} 2072}
2076 2073
2077static ssize_t toshiba_usb_sleep_music_show(struct device *dev, 2074static ssize_t usb_sleep_music_show(struct device *dev,
2078 struct device_attribute *attr, 2075 struct device_attribute *attr, char *buf)
2079 char *buf)
2080{ 2076{
2081 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2077 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2082 u32 state; 2078 u32 state;
@@ -2089,9 +2085,9 @@ static ssize_t toshiba_usb_sleep_music_show(struct device *dev,
2089 return sprintf(buf, "%d\n", state); 2085 return sprintf(buf, "%d\n", state);
2090} 2086}
2091 2087
2092static ssize_t toshiba_usb_sleep_music_store(struct device *dev, 2088static ssize_t usb_sleep_music_store(struct device *dev,
2093 struct device_attribute *attr, 2089 struct device_attribute *attr,
2094 const char *buf, size_t count) 2090 const char *buf, size_t count)
2095{ 2091{
2096 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2092 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2097 int state; 2093 int state;
@@ -2110,9 +2106,8 @@ static ssize_t toshiba_usb_sleep_music_store(struct device *dev,
2110 return count; 2106 return count;
2111} 2107}
2112 2108
2113static ssize_t toshiba_kbd_function_keys_show(struct device *dev, 2109static ssize_t kbd_function_keys_show(struct device *dev,
2114 struct device_attribute *attr, 2110 struct device_attribute *attr, char *buf)
2115 char *buf)
2116{ 2111{
2117 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2112 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2118 int mode; 2113 int mode;
@@ -2125,9 +2120,9 @@ static ssize_t toshiba_kbd_function_keys_show(struct device *dev,
2125 return sprintf(buf, "%d\n", mode); 2120 return sprintf(buf, "%d\n", mode);
2126} 2121}
2127 2122
2128static ssize_t toshiba_kbd_function_keys_store(struct device *dev, 2123static ssize_t kbd_function_keys_store(struct device *dev,
2129 struct device_attribute *attr, 2124 struct device_attribute *attr,
2130 const char *buf, size_t count) 2125 const char *buf, size_t count)
2131{ 2126{
2132 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2127 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2133 int mode; 2128 int mode;
@@ -2152,9 +2147,8 @@ static ssize_t toshiba_kbd_function_keys_store(struct device *dev,
2152 return count; 2147 return count;
2153} 2148}
2154 2149
2155static ssize_t toshiba_panel_power_on_show(struct device *dev, 2150static ssize_t panel_power_on_show(struct device *dev,
2156 struct device_attribute *attr, 2151 struct device_attribute *attr, char *buf)
2157 char *buf)
2158{ 2152{
2159 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2153 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2160 u32 state; 2154 u32 state;
@@ -2167,9 +2161,9 @@ static ssize_t toshiba_panel_power_on_show(struct device *dev,
2167 return sprintf(buf, "%d\n", state); 2161 return sprintf(buf, "%d\n", state);
2168} 2162}
2169 2163
2170static ssize_t toshiba_panel_power_on_store(struct device *dev, 2164static ssize_t panel_power_on_store(struct device *dev,
2171 struct device_attribute *attr, 2165 struct device_attribute *attr,
2172 const char *buf, size_t count) 2166 const char *buf, size_t count)
2173{ 2167{
2174 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2168 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2175 int state; 2169 int state;
@@ -2190,9 +2184,8 @@ static ssize_t toshiba_panel_power_on_store(struct device *dev,
2190 return count; 2184 return count;
2191} 2185}
2192 2186
2193static ssize_t toshiba_usb_three_show(struct device *dev, 2187static ssize_t usb_three_show(struct device *dev,
2194 struct device_attribute *attr, 2188 struct device_attribute *attr, char *buf)
2195 char *buf)
2196{ 2189{
2197 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2190 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2198 u32 state; 2191 u32 state;
@@ -2205,9 +2198,9 @@ static ssize_t toshiba_usb_three_show(struct device *dev,
2205 return sprintf(buf, "%d\n", state); 2198 return sprintf(buf, "%d\n", state);
2206} 2199}
2207 2200
2208static ssize_t toshiba_usb_three_store(struct device *dev, 2201static ssize_t usb_three_store(struct device *dev,
2209 struct device_attribute *attr, 2202 struct device_attribute *attr,
2210 const char *buf, size_t count) 2203 const char *buf, size_t count)
2211{ 2204{
2212 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 2205 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
2213 int state; 2206 int state;
@@ -2232,39 +2225,32 @@ static ssize_t toshiba_usb_three_store(struct device *dev,
2232 return count; 2225 return count;
2233} 2226}
2234 2227
2235static DEVICE_ATTR(version, S_IRUGO, toshiba_version_show, NULL); 2228static DEVICE_ATTR(version, S_IRUGO, version_show, NULL);
2236static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR, 2229static DEVICE_ATTR(fan, S_IRUGO | S_IWUSR, fan_show, fan_store);
2237 toshiba_fan_show, toshiba_fan_store);
2238static DEVICE_ATTR(kbd_backlight_mode, S_IRUGO | S_IWUSR, 2230static DEVICE_ATTR(kbd_backlight_mode, S_IRUGO | S_IWUSR,
2239 toshiba_kbd_bl_mode_show, toshiba_kbd_bl_mode_store); 2231 kbd_backlight_mode_show, kbd_backlight_mode_store);
2240static DEVICE_ATTR(kbd_type, S_IRUGO, toshiba_kbd_type_show, NULL); 2232static DEVICE_ATTR(kbd_type, S_IRUGO, kbd_type_show, NULL);
2241static DEVICE_ATTR(available_kbd_modes, S_IRUGO, 2233static DEVICE_ATTR(available_kbd_modes, S_IRUGO,
2242 toshiba_available_kbd_modes_show, NULL); 2234 available_kbd_modes_show, NULL);
2243static DEVICE_ATTR(kbd_backlight_timeout, S_IRUGO | S_IWUSR, 2235static DEVICE_ATTR(kbd_backlight_timeout, S_IRUGO | S_IWUSR,
2244 toshiba_kbd_bl_timeout_show, toshiba_kbd_bl_timeout_store); 2236 kbd_backlight_timeout_show, kbd_backlight_timeout_store);
2245static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR, 2237static DEVICE_ATTR(touchpad, S_IRUGO | S_IWUSR, touchpad_show, touchpad_store);
2246 toshiba_touchpad_show, toshiba_touchpad_store); 2238static DEVICE_ATTR(position, S_IRUGO, position_show, NULL);
2247static DEVICE_ATTR(position, S_IRUGO, toshiba_position_show, NULL);
2248static DEVICE_ATTR(usb_sleep_charge, S_IRUGO | S_IWUSR, 2239static DEVICE_ATTR(usb_sleep_charge, S_IRUGO | S_IWUSR,
2249 toshiba_usb_sleep_charge_show, 2240 usb_sleep_charge_show, usb_sleep_charge_store);
2250 toshiba_usb_sleep_charge_store);
2251static DEVICE_ATTR(sleep_functions_on_battery, S_IRUGO | S_IWUSR, 2241static DEVICE_ATTR(sleep_functions_on_battery, S_IRUGO | S_IWUSR,
2252 sleep_functions_on_battery_show, 2242 sleep_functions_on_battery_show,
2253 sleep_functions_on_battery_store); 2243 sleep_functions_on_battery_store);
2254static DEVICE_ATTR(usb_rapid_charge, S_IRUGO | S_IWUSR, 2244static DEVICE_ATTR(usb_rapid_charge, S_IRUGO | S_IWUSR,
2255 toshiba_usb_rapid_charge_show, 2245 usb_rapid_charge_show, usb_rapid_charge_store);
2256 toshiba_usb_rapid_charge_store);
2257static DEVICE_ATTR(usb_sleep_music, S_IRUGO | S_IWUSR, 2246static DEVICE_ATTR(usb_sleep_music, S_IRUGO | S_IWUSR,
2258 toshiba_usb_sleep_music_show, 2247 usb_sleep_music_show, usb_sleep_music_store);
2259 toshiba_usb_sleep_music_store);
2260static DEVICE_ATTR(kbd_function_keys, S_IRUGO | S_IWUSR, 2248static DEVICE_ATTR(kbd_function_keys, S_IRUGO | S_IWUSR,
2261 toshiba_kbd_function_keys_show, 2249 kbd_function_keys_show, kbd_function_keys_store);
2262 toshiba_kbd_function_keys_store);
2263static DEVICE_ATTR(panel_power_on, S_IRUGO | S_IWUSR, 2250static DEVICE_ATTR(panel_power_on, S_IRUGO | S_IWUSR,
2264 toshiba_panel_power_on_show, 2251 panel_power_on_show, panel_power_on_store);
2265 toshiba_panel_power_on_store);
2266static DEVICE_ATTR(usb_three, S_IRUGO | S_IWUSR, 2252static DEVICE_ATTR(usb_three, S_IRUGO | S_IWUSR,
2267 toshiba_usb_three_show, toshiba_usb_three_store); 2253 usb_three_show, usb_three_store);
2268 2254
2269static struct attribute *toshiba_attributes[] = { 2255static struct attribute *toshiba_attributes[] = {
2270 &dev_attr_version.attr, 2256 &dev_attr_version.attr,