linux/drivers/platform/x86/sony-laptop.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ACPI Sony Notebook Control Driver (SNC and SPIC)
 *
 * Copyright (C) 2004-2005 Stelian Pop <[email protected]>
 * Copyright (C) 2007-2009 Mattia Dongili <[email protected]>
 *
 * Parts of this driver inspired from asus_acpi.c and ibm_acpi.c
 * which are copyrighted by their respective authors.
 *
 * The SNY6001 driver part is based on the sonypi driver which includes
 * material from:
 *
 * Copyright (C) 2001-2005 Stelian Pop <[email protected]>
 *
 * Copyright (C) 2005 Narayanan R S <[email protected]>
 *
 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
 *
 * Copyright (C) 2001 Michael Ashley <[email protected]>
 *
 * Copyright (C) 2001 Junichi Morita <[email protected]>
 *
 * Copyright (C) 2000 Takaya Kinjo <[email protected]>
 *
 * Copyright (C) 2000 Andrew Tridgell <[email protected]>
 *
 * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
 */

#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;		/* = 0 */
module_param(no_spic, int, 0444);
MODULE_PARM_DESC();

static int compat;		/* = 0 */
module_param(compat, int, 0444);
MODULE_PARM_DESC();

static unsigned long mask =;
module_param(mask, ulong, 0644);
MODULE_PARM_DESC();

static int camera;		/* = 0 */
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);

/*********** Input Devices ***********/

#define SONY_LAPTOP_BUF_SIZE
struct sony_laptop_input_s {};

static struct sony_laptop_input_s sony_laptop_input =;

struct sony_laptop_keypress {};

/* Correspondance table between sonypi events
 * and input layer indexes in the keymap
 */
static const int sony_laptop_input_index[] =;

static int sony_laptop_input_keycode_map[] =;

/* release buttons after a short delay if pressed */
static void do_sony_laptop_release_key(struct timer_list *unused)
{}

/* forward event to the input subsystem */
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)
{}

/*********** Platform Device ***********/

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)
{}

/*********** SNC (SNY5001) Device ***********/

/* the device uses 1-based values, while the backlight subsystem uses
   0-based values */
#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 =;

/*
 * acpi_evaluate_object wrappers
 * all useful calls into SNC methods take one or zero parameters and return
 * integers or arrays.
 */
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)
{}

/*
 * sony_nc_values input/output validate functions
 */

/* brightness_default_validate:
 *
 * manipulate input output values to keep consistency with the
 * backlight framework for which brightness values are 0-based.
 */
static int brightness_default_validate(const int direction, const int value)
{}

/* boolean_validate:
 *
 * on input validate boolean values 0/1, on output just pass the
 * received value.
 */
static int boolean_validate(const int direction, const int value)
{}

/*
 * Sysfs show/store common to all sony_nc_values
 */
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)
{}


/*
 * Backlight device
 */
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 =;

/*
 * New SNC-only Vaios event mapping to driver known keys
 */
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)
{}

/*
 * ACPI callbacks
 */
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)
{}

/*
 * ACPI device
 */
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)
{}

/* Keyboard backlight feature */
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

/* resume on LID open */
#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)
{}

/* GFX Switch position */
enum gfx_switch {};
struct snc_gfx_switch_control {};
static struct snc_gfx_switch_control *gfxs_ctl;

/* returns 0 for speed, 1 for stamina */
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)
{}

/* High speed charging function */
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)
{}

/* low battery function */
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)
{}

/* fan speed function */
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)
{}

/* USB charge function */
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)
{}

/* Panel ID function */
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)
{}

/* smart connect function */
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)
{}

/* Touchpad enable/disable */
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 =;

/*********** SPIC (SNY6001) Device ***********/

#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;

/* Event masks */
#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 {};

/* The set of possible button release events */
static struct sonypi_event sonypi_releaseev[] =;

/* The set of possible jogger events  */
static struct sonypi_event sonypi_joggerev[] =;

/* The set of possible capture button events */
static struct sonypi_event sonypi_captureev[] =;

/* The set of possible fnkeys events */
static struct sonypi_event sonypi_fnkeyev[] =;

/* The set of possible program key events */
static struct sonypi_event sonypi_pkeyev[] =;

/* The set of possible bluetooth events */
static struct sonypi_event sonypi_blueev[] =;

/* The set of possible wireless events */
static struct sonypi_event sonypi_wlessev[] =;

/* The set of possible back button events */
static struct sonypi_event sonypi_backev[] =;

/* The set of possible help button events */
static struct sonypi_event sonypi_helpev[] =;


/* The set of possible lid events */
static struct sonypi_event sonypi_lidev[] =;

/* The set of possible zoom events */
static struct sonypi_event sonypi_zoomev[] =;

/* The set of possible thumbphrase events */
static struct sonypi_event sonypi_thumbphraseev[] =;

/* The set of possible motioneye camera events */
static struct sonypi_event sonypi_meyeev[] =;

/* The set of possible memorystick events */
static struct sonypi_event sonypi_memorystickev[] =;

/* The set of possible battery events */
static struct sonypi_event sonypi_batteryev[] =;

/* The set of possible volume events */
static struct sonypi_event sonypi_volumeev[] =;

/* The set of possible brightness events */
static struct sonypi_event sonypi_brightnessev[] =;

static struct sonypi_eventtypes type1_events[] =;
static struct sonypi_eventtypes type2_events[] =;
static struct sonypi_eventtypes type3_events[] =;

/* low level spic calls */
#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)
{}

/*
 * minidrivers for SPIC models
 */
static int type3_handle_irq(const u8 data_mask, const u8 ev)
{}

static void sony_pic_detect_device_type(struct sony_pic_dev *dev)
{}

/* camera tests and poweron/poweroff */
#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

/* the rest don't need a loop until not 0xff */
#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)
{}

/* External camera command (exported to the motion eye v4l driver) */
int sony_pic_camera_command(int command, u8 value)
{}
EXPORT_SYMBOL();

/* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
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)
{}

/* bluetooth subsystem power state */
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)
{}

/* fan speed */
/* FAN0 information (reverse engineered from ACPI tables) */
#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 =;

/******** SONYPI compatibility **********/
#ifdef CONFIG_SONYPI_COMPAT

/* battery / brightness / temperature  addresses */
#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 /* CONFIG_SONYPI_COMPAT */

/*
 * ACPI callbacks
 */
static acpi_status
sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
{}

static int sony_pic_possible_resources(struct acpi_device *device)
{}

/*
 *  Disable the spic device by calling its _DIS method
 */
static int sony_pic_disable(struct acpi_device *device)
{}


/*
 *  Based on drivers/acpi/pci_link.c:acpi_pci_link_set
 *
 *  Call _SRS to set current resources
 */
static int sony_pic_enable(struct acpi_device *device,
		struct sony_pic_ioport *ioport, struct sony_pic_irq *irq)
{}

/*****************
 *
 * ISR: some event is available
 *
 *****************/
static irqreturn_t sony_pic_irq(int irq, void *dev_id)
{}

/*****************
 *
 *  ACPI driver
 *
 *****************/
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);