#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/backlight.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <linux/dmi.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/kfifo.h>
#include <linux/workqueue.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <linux/sonypi.h>
#include <linux/sony-laptop.h>
#include <linux/rfkill.h>
#ifdef CONFIG_SONYPI_COMPAT
#include <linux/poll.h>
#include <linux/miscdevice.h>
#endif
#include <linux/uaccess.h>
#include <acpi/video.h>
#define dprintk(fmt, ...) …
#define SONY_NC_CLASS …
#define SONY_NC_HID …
#define SONY_NC_DRIVER_NAME …
#define SONY_PIC_CLASS …
#define SONY_PIC_HID …
#define SONY_PIC_DRIVER_NAME …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int debug;
module_param(debug, int, 0);
MODULE_PARM_DESC(…) …;
static int no_spic;
module_param(no_spic, int, 0444);
MODULE_PARM_DESC(…) …;
static int compat;
module_param(compat, int, 0444);
MODULE_PARM_DESC(…) …;
static unsigned long mask = …;
module_param(mask, ulong, 0644);
MODULE_PARM_DESC(…) …;
static int camera;
module_param(camera, int, 0444);
MODULE_PARM_DESC(…) …;
#ifdef CONFIG_SONYPI_COMPAT
static int minor = …;
module_param(minor, int, 0);
MODULE_PARM_DESC(…) …;
#endif
static int kbd_backlight = …;
module_param(kbd_backlight, int, 0444);
MODULE_PARM_DESC(…) …;
static int kbd_backlight_timeout = …;
module_param(kbd_backlight_timeout, int, 0444);
MODULE_PARM_DESC(…) …;
#ifdef CONFIG_PM_SLEEP
static void sony_nc_thermal_resume(void);
#endif
static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
unsigned int handle);
static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd,
unsigned int handle);
static int sony_nc_battery_care_setup(struct platform_device *pd,
unsigned int handle);
static void sony_nc_battery_care_cleanup(struct platform_device *pd);
static int sony_nc_thermal_setup(struct platform_device *pd);
static void sony_nc_thermal_cleanup(struct platform_device *pd);
static int sony_nc_lid_resume_setup(struct platform_device *pd,
unsigned int handle);
static void sony_nc_lid_resume_cleanup(struct platform_device *pd);
static int sony_nc_gfx_switch_setup(struct platform_device *pd,
unsigned int handle);
static void sony_nc_gfx_switch_cleanup(struct platform_device *pd);
static int __sony_nc_gfx_switch_status_get(void);
static int sony_nc_highspeed_charging_setup(struct platform_device *pd);
static void sony_nc_highspeed_charging_cleanup(struct platform_device *pd);
static int sony_nc_lowbatt_setup(struct platform_device *pd);
static void sony_nc_lowbatt_cleanup(struct platform_device *pd);
static int sony_nc_fanspeed_setup(struct platform_device *pd);
static void sony_nc_fanspeed_cleanup(struct platform_device *pd);
static int sony_nc_usb_charge_setup(struct platform_device *pd);
static void sony_nc_usb_charge_cleanup(struct platform_device *pd);
static int sony_nc_panelid_setup(struct platform_device *pd);
static void sony_nc_panelid_cleanup(struct platform_device *pd);
static int sony_nc_smart_conn_setup(struct platform_device *pd);
static void sony_nc_smart_conn_cleanup(struct platform_device *pd);
static int sony_nc_touchpad_setup(struct platform_device *pd,
unsigned int handle);
static void sony_nc_touchpad_cleanup(struct platform_device *pd);
enum sony_nc_rfkill { … };
static int sony_rfkill_handle;
static struct rfkill *sony_rfkill_devices[N_SONY_RFKILL];
static int sony_rfkill_address[N_SONY_RFKILL] = …;
static int sony_nc_rfkill_setup(struct acpi_device *device,
unsigned int handle);
static void sony_nc_rfkill_cleanup(void);
static void sony_nc_rfkill_update(void);
#define SONY_LAPTOP_BUF_SIZE …
struct sony_laptop_input_s { … };
static struct sony_laptop_input_s sony_laptop_input = …;
struct sony_laptop_keypress { … };
static const int sony_laptop_input_index[] = …;
static int sony_laptop_input_keycode_map[] = …;
static void do_sony_laptop_release_key(struct timer_list *unused)
{ … }
static void sony_laptop_report_input_event(u8 event)
{ … }
static int sony_laptop_setup_input(struct acpi_device *acpi_device)
{ … }
static void sony_laptop_remove_input(void)
{ … }
static atomic_t sony_pf_users = …;
static struct platform_driver sony_pf_driver = …;
static struct platform_device *sony_pf_device;
static int sony_pf_add(void)
{ … }
static void sony_pf_remove(void)
{ … }
#define SONY_MAX_BRIGHTNESS …
#define SNC_VALIDATE_IN …
#define SNC_VALIDATE_OUT …
static ssize_t sony_nc_sysfs_show(struct device *, struct device_attribute *,
char *);
static ssize_t sony_nc_sysfs_store(struct device *, struct device_attribute *,
const char *, size_t);
static int boolean_validate(const int, const int);
static int brightness_default_validate(const int, const int);
struct sony_nc_value { … };
#define SNC_HANDLE_NAMES(_name, _values...) …
#define SNC_HANDLE(_name, _getters, _setters, _validate, _debug) …
#define SNC_HANDLE_NULL …
SNC_HANDLE_NAMES(fnkey_get, "GHKE");
SNC_HANDLE_NAMES(brightness_def_get, "GPBR");
SNC_HANDLE_NAMES(brightness_def_set, "SPBR");
SNC_HANDLE_NAMES(cdpower_get, "GCDP");
SNC_HANDLE_NAMES(…);
SNC_HANDLE_NAMES(audiopower_get, "GAZP");
SNC_HANDLE_NAMES(audiopower_set, "AZPW");
SNC_HANDLE_NAMES(lanpower_get, "GLNP");
SNC_HANDLE_NAMES(lanpower_set, "LNPW");
SNC_HANDLE_NAMES(lidstate_get, "GLID");
SNC_HANDLE_NAMES(indicatorlamp_get, "GILS");
SNC_HANDLE_NAMES(indicatorlamp_set, "SILS");
SNC_HANDLE_NAMES(gainbass_get, "GMGB");
SNC_HANDLE_NAMES(gainbass_set, "CMGB");
SNC_HANDLE_NAMES(PID_get, "GPID");
SNC_HANDLE_NAMES(CTR_get, "GCTR");
SNC_HANDLE_NAMES(CTR_set, "SCTR");
SNC_HANDLE_NAMES(PCR_get, "GPCR");
SNC_HANDLE_NAMES(PCR_set, "SPCR");
SNC_HANDLE_NAMES(CMI_get, "GCMI");
SNC_HANDLE_NAMES(CMI_set, "SCMI");
static struct sony_nc_value sony_nc_values[] = …;
static acpi_handle sony_nc_acpi_handle;
static struct acpi_device *sony_nc_acpi_device = …;
static union acpi_object *__call_snc_method(acpi_handle handle, char *method,
u64 *value)
{ … }
static int sony_nc_buffer_call(acpi_handle handle, char *name, u64 *value,
void *buffer, size_t buflen)
{ … }
static int sony_nc_int_call(acpi_handle handle, char *name, int *value, int
*result)
{ … }
struct sony_nc_handles { … };
static struct sony_nc_handles *handles;
static ssize_t sony_nc_handles_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_handles_setup(struct platform_device *pd)
{ … }
static int sony_nc_handles_cleanup(struct platform_device *pd)
{ … }
static int sony_find_snc_handle(int handle)
{ … }
static int sony_call_snc_handle(int handle, int argument, int *result)
{ … }
static int brightness_default_validate(const int direction, const int value)
{ … }
static int boolean_validate(const int direction, const int value)
{ … }
static ssize_t sony_nc_sysfs_show(struct device *dev, struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t sony_nc_sysfs_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
struct sony_backlight_props { … };
static struct sony_backlight_props sony_bl_props;
static int sony_backlight_update_status(struct backlight_device *bd)
{ … }
static int sony_backlight_get_brightness(struct backlight_device *bd)
{ … }
static int sony_nc_get_brightness_ng(struct backlight_device *bd)
{ … }
static int sony_nc_update_status_ng(struct backlight_device *bd)
{ … }
static const struct backlight_ops sony_backlight_ops = …;
static const struct backlight_ops sony_backlight_ng_ops = …;
struct sony_nc_event { … };
static struct sony_nc_event sony_100_events[] = …;
static struct sony_nc_event sony_127_events[] = …;
static int sony_nc_hotkeys_decode(u32 event, unsigned int handle)
{ … }
enum event_types { … };
static void sony_nc_notify(struct acpi_device *device, u32 event)
{ … }
static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
void *context, void **return_value)
{ … }
static void sony_nc_function_setup(struct acpi_device *device,
struct platform_device *pf_device)
{ … }
static void sony_nc_function_cleanup(struct platform_device *pd)
{ … }
#ifdef CONFIG_PM_SLEEP
static void sony_nc_function_resume(void)
{ … }
static int sony_nc_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(sony_nc_pm, NULL, sony_nc_resume);
static void sony_nc_rfkill_cleanup(void)
{ … }
static int sony_nc_rfkill_set(void *data, bool blocked)
{ … }
static const struct rfkill_ops sony_rfkill_ops = …;
static int sony_nc_setup_rfkill(struct acpi_device *device,
enum sony_nc_rfkill nc_type)
{ … }
static void sony_nc_rfkill_update(void)
{ … }
static int sony_nc_rfkill_setup(struct acpi_device *device,
unsigned int handle)
{ … }
struct kbd_backlight { … };
static struct kbd_backlight *kbdbl_ctl;
static ssize_t __sony_nc_kbd_backlight_mode_set(u8 value)
{ … }
static ssize_t sony_nc_kbd_backlight_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_kbd_backlight_mode_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int __sony_nc_kbd_backlight_timeout_set(u8 value)
{ … }
static ssize_t sony_nc_kbd_backlight_timeout_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_kbd_backlight_timeout_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_kbd_backlight_setup(struct platform_device *pd,
unsigned int handle)
{ … }
static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd,
unsigned int handle)
{ … }
struct battery_care_control { … };
static struct battery_care_control *bcare_ctl;
static ssize_t sony_nc_battery_care_limit_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_battery_care_limit_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static ssize_t sony_nc_battery_care_health_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_battery_care_setup(struct platform_device *pd,
unsigned int handle)
{ … }
static void sony_nc_battery_care_cleanup(struct platform_device *pd)
{ … }
struct snc_thermal_ctrl { … };
static struct snc_thermal_ctrl *th_handle;
#define THM_PROFILE_MAX …
static const char * const snc_thermal_profiles[] = …;
static int sony_nc_thermal_mode_set(unsigned short mode)
{ … }
static int sony_nc_thermal_mode_get(void)
{ … }
static ssize_t sony_nc_thermal_profiles_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static ssize_t sony_nc_thermal_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_thermal_mode_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_thermal_setup(struct platform_device *pd)
{ … }
static void sony_nc_thermal_cleanup(struct platform_device *pd)
{ … }
#ifdef CONFIG_PM_SLEEP
static void sony_nc_thermal_resume(void)
{ … }
#endif
#define LID_RESUME_S5 …
#define LID_RESUME_S4 …
#define LID_RESUME_S3 …
#define LID_RESUME_MAX …
struct snc_lid_resume_control { … };
static struct snc_lid_resume_control *lid_ctl;
static ssize_t sony_nc_lid_resume_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_lid_resume_show(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static int sony_nc_lid_resume_setup(struct platform_device *pd,
unsigned int handle)
{ … }
static void sony_nc_lid_resume_cleanup(struct platform_device *pd)
{ … }
enum gfx_switch { … };
struct snc_gfx_switch_control { … };
static struct snc_gfx_switch_control *gfxs_ctl;
static int __sony_nc_gfx_switch_status_get(void)
{ … }
static ssize_t sony_nc_gfx_switch_status_show(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static int sony_nc_gfx_switch_setup(struct platform_device *pd,
unsigned int handle)
{ … }
static void sony_nc_gfx_switch_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *hsc_handle;
static ssize_t sony_nc_highspeed_charging_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_highspeed_charging_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_highspeed_charging_setup(struct platform_device *pd)
{ … }
static void sony_nc_highspeed_charging_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *lowbatt_handle;
static ssize_t sony_nc_lowbatt_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_lowbatt_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_lowbatt_setup(struct platform_device *pd)
{ … }
static void sony_nc_lowbatt_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *fan_handle, *hsf_handle;
static ssize_t sony_nc_hsfan_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_hsfan_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static ssize_t sony_nc_fanspeed_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_fanspeed_setup(struct platform_device *pd)
{ … }
static void sony_nc_fanspeed_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *uc_handle;
static ssize_t sony_nc_usb_charge_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_usb_charge_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_usb_charge_setup(struct platform_device *pd)
{ … }
static void sony_nc_usb_charge_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *panel_handle;
static ssize_t sony_nc_panelid_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_panelid_setup(struct platform_device *pd)
{ … }
static void sony_nc_panelid_cleanup(struct platform_device *pd)
{ … }
static struct device_attribute *sc_handle;
static ssize_t sony_nc_smart_conn_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static int sony_nc_smart_conn_setup(struct platform_device *pd)
{ … }
static void sony_nc_smart_conn_cleanup(struct platform_device *pd)
{ … }
struct touchpad_control { … };
static struct touchpad_control *tp_ctl;
static ssize_t sony_nc_touchpad_store(struct device *dev,
struct device_attribute *attr, const char *buffer, size_t count)
{ … }
static ssize_t sony_nc_touchpad_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static int sony_nc_touchpad_setup(struct platform_device *pd,
unsigned int handle)
{ … }
static void sony_nc_touchpad_cleanup(struct platform_device *pd)
{ … }
static void sony_nc_backlight_ng_read_limits(int handle,
struct sony_backlight_props *props)
{ … }
static void sony_nc_backlight_setup(void)
{ … }
static void sony_nc_backlight_cleanup(void)
{ … }
static int sony_nc_add(struct acpi_device *device)
{ … }
static void sony_nc_remove(struct acpi_device *device)
{ … }
static const struct acpi_device_id sony_device_ids[] __maybe_unused = …;
MODULE_DEVICE_TABLE(acpi, sony_device_ids);
static const struct acpi_device_id sony_nc_device_ids[] = …;
static struct acpi_driver sony_nc_driver = …;
#define SONYPI_DEVICE_TYPE1 …
#define SONYPI_DEVICE_TYPE2 …
#define SONYPI_DEVICE_TYPE3 …
#define SONYPI_TYPE1_OFFSET …
#define SONYPI_TYPE2_OFFSET …
#define SONYPI_TYPE3_OFFSET …
struct sony_pic_ioport { … };
struct sony_pic_irq { … };
struct sonypi_eventtypes { … };
struct sony_pic_dev { … };
static struct sony_pic_dev spic_dev = …;
static int spic_drv_registered;
#define SONYPI_JOGGER_MASK …
#define SONYPI_CAPTURE_MASK …
#define SONYPI_FNKEY_MASK …
#define SONYPI_BLUETOOTH_MASK …
#define SONYPI_PKEY_MASK …
#define SONYPI_BACK_MASK …
#define SONYPI_HELP_MASK …
#define SONYPI_LID_MASK …
#define SONYPI_ZOOM_MASK …
#define SONYPI_THUMBPHRASE_MASK …
#define SONYPI_MEYE_MASK …
#define SONYPI_MEMORYSTICK_MASK …
#define SONYPI_BATTERY_MASK …
#define SONYPI_WIRELESS_MASK …
struct sonypi_event { … };
static struct sonypi_event sonypi_releaseev[] = …;
static struct sonypi_event sonypi_joggerev[] = …;
static struct sonypi_event sonypi_captureev[] = …;
static struct sonypi_event sonypi_fnkeyev[] = …;
static struct sonypi_event sonypi_pkeyev[] = …;
static struct sonypi_event sonypi_blueev[] = …;
static struct sonypi_event sonypi_wlessev[] = …;
static struct sonypi_event sonypi_backev[] = …;
static struct sonypi_event sonypi_helpev[] = …;
static struct sonypi_event sonypi_lidev[] = …;
static struct sonypi_event sonypi_zoomev[] = …;
static struct sonypi_event sonypi_thumbphraseev[] = …;
static struct sonypi_event sonypi_meyeev[] = …;
static struct sonypi_event sonypi_memorystickev[] = …;
static struct sonypi_event sonypi_batteryev[] = …;
static struct sonypi_event sonypi_volumeev[] = …;
static struct sonypi_event sonypi_brightnessev[] = …;
static struct sonypi_eventtypes type1_events[] = …;
static struct sonypi_eventtypes type2_events[] = …;
static struct sonypi_eventtypes type3_events[] = …;
#define ITERATIONS_LONG …
#define ITERATIONS_SHORT …
#define wait_on_command(command, iterations) …
static u8 sony_pic_call1(u8 dev)
{ … }
static u8 sony_pic_call2(u8 dev, u8 fn)
{ … }
static u8 sony_pic_call3(u8 dev, u8 fn, u8 v)
{ … }
static int type3_handle_irq(const u8 data_mask, const u8 ev)
{ … }
static void sony_pic_detect_device_type(struct sony_pic_dev *dev)
{ … }
#define SONYPI_CAMERA_PICTURE …
#define SONYPI_CAMERA_CONTROL …
#define SONYPI_CAMERA_BRIGHTNESS …
#define SONYPI_CAMERA_CONTRAST …
#define SONYPI_CAMERA_HUE …
#define SONYPI_CAMERA_COLOR …
#define SONYPI_CAMERA_SHARPNESS …
#define SONYPI_CAMERA_EXPOSURE_MASK …
#define SONYPI_CAMERA_WHITE_BALANCE_MASK …
#define SONYPI_CAMERA_PICTURE_MODE_MASK …
#define SONYPI_CAMERA_MUTE_MASK …
#define SONYPI_CAMERA_AGC …
#define SONYPI_CAMERA_AGC_MASK …
#define SONYPI_CAMERA_SHUTTER_MASK …
#define SONYPI_CAMERA_SHUTDOWN_REQUEST …
#define SONYPI_CAMERA_CONTROL …
#define SONYPI_CAMERA_STATUS …
#define SONYPI_CAMERA_STATUS_READY …
#define SONYPI_CAMERA_STATUS_POSITION …
#define SONYPI_DIRECTION_BACKWARDS …
#define SONYPI_CAMERA_REVISION …
#define SONYPI_CAMERA_ROMVERSION …
static int __sony_pic_camera_ready(void)
{ … }
static int __sony_pic_camera_off(void)
{ … }
static int __sony_pic_camera_on(void)
{ … }
int sony_pic_camera_command(int command, u8 value)
{ … }
EXPORT_SYMBOL(…);
static void __sony_pic_set_wwanpower(u8 state)
{ … }
static ssize_t sony_pic_wwanpower_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_pic_wwanpower_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
static void __sony_pic_set_bluetoothpower(u8 state)
{ … }
static ssize_t sony_pic_bluetoothpower_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_pic_bluetoothpower_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
#define SONY_PIC_FAN0_STATUS …
static int sony_pic_set_fanspeed(unsigned long value)
{ … }
static int sony_pic_get_fanspeed(u8 *value)
{ … }
static ssize_t sony_pic_fanspeed_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{ … }
static ssize_t sony_pic_fanspeed_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{ … }
#define SPIC_ATTR(_name, _mode) …
static SPIC_ATTR(bluetoothpower, 0644);
static SPIC_ATTR(wwanpower, 0644);
static SPIC_ATTR(fanspeed, 0644);
static struct attribute *spic_attributes[] = …;
static const struct attribute_group spic_attribute_group = …;
#ifdef CONFIG_SONYPI_COMPAT
#define SONYPI_BAT_FLAGS …
#define SONYPI_LCD_LIGHT …
#define SONYPI_BAT1_PCTRM …
#define SONYPI_BAT1_LEFT …
#define SONYPI_BAT1_MAXRT …
#define SONYPI_BAT2_PCTRM …
#define SONYPI_BAT2_LEFT …
#define SONYPI_BAT2_MAXRT …
#define SONYPI_BAT1_MAXTK …
#define SONYPI_BAT1_FULL …
#define SONYPI_BAT2_MAXTK …
#define SONYPI_BAT2_FULL …
#define SONYPI_TEMP_STATUS …
struct sonypi_compat_s { … };
static struct sonypi_compat_s sonypi_compat = …;
static int sonypi_misc_fasync(int fd, struct file *filp, int on)
{ … }
static int sonypi_misc_release(struct inode *inode, struct file *file)
{ … }
static int sonypi_misc_open(struct inode *inode, struct file *file)
{ … }
static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
size_t count, loff_t *pos)
{ … }
static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
{ … }
static int ec_read16(u8 addr, u16 *value)
{ … }
static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd,
unsigned long arg)
{ … }
static const struct file_operations sonypi_misc_fops = …;
static struct miscdevice sonypi_misc_device = …;
static void sonypi_compat_report_event(u8 event)
{ … }
static int sonypi_compat_init(void)
{ … }
static void sonypi_compat_exit(void)
{ … }
#else
static int sonypi_compat_init(void) { return 0; }
static void sonypi_compat_exit(void) { }
static void sonypi_compat_report_event(u8 event) { }
#endif
static acpi_status
sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
{ … }
static int sony_pic_possible_resources(struct acpi_device *device)
{ … }
static int sony_pic_disable(struct acpi_device *device)
{ … }
static int sony_pic_enable(struct acpi_device *device,
struct sony_pic_ioport *ioport, struct sony_pic_irq *irq)
{ … }
static irqreturn_t sony_pic_irq(int irq, void *dev_id)
{ … }
static void sony_pic_remove(struct acpi_device *device)
{ … }
static int sony_pic_add(struct acpi_device *device)
{ … }
#ifdef CONFIG_PM_SLEEP
static int sony_pic_suspend(struct device *dev)
{ … }
static int sony_pic_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(sony_pic_pm, sony_pic_suspend, sony_pic_resume);
static const struct acpi_device_id sony_pic_device_ids[] = …;
static struct acpi_driver sony_pic_driver = …;
static const struct dmi_system_id sonypi_dmi_table[] __initconst = …;
static int __init sony_laptop_init(void)
{ … }
static void __exit sony_laptop_exit(void)
{ … }
module_init(…) …;
module_exit(sony_laptop_exit);