#include <asm/uaccess.h>
#include <linux/sonypi.h>
#include <linux/sony-laptop.h>
-#ifdef CONFIG_SONY_LAPTOP_OLD
+#ifdef CONFIG_SONYPI_COMPAT
#include <linux/poll.h>
#include <linux/miscdevice.h>
#endif
"set this to 1 to enable Motion Eye camera controls "
"(only use it if you have a C1VE or C1VN model)");
-#ifdef CONFIG_SONY_LAPTOP_OLD
+#ifdef CONFIG_SONYPI_COMPAT
static int minor = -1;
module_param(minor, int, 0);
MODULE_PARM_DESC(minor,
return 0;
}
-static ssize_t sony_pic_camerapower_store(struct device *dev,
- struct device_attribute *attr,
- const char *buffer, size_t count)
-{
- unsigned long value;
- int result;
- if (count > 31)
- return -EINVAL;
-
- value = simple_strtoul(buffer, NULL, 10);
-
- mutex_lock(&spic_dev.lock);
- if (value)
- result = __sony_pic_camera_on();
- else
- result = __sony_pic_camera_off();
- mutex_unlock(&spic_dev.lock);
-
- if (result)
- return result;
-
- return count;
-}
-
-static ssize_t sony_pic_camerapower_show(struct device *dev,
- struct device_attribute *attr, char *buffer)
-{
- ssize_t count;
- mutex_lock(&spic_dev.lock);
- count = snprintf(buffer, PAGE_SIZE, "%d\n", spic_dev.camera_power);
- mutex_unlock(&spic_dev.lock);
- return count;
-}
-
/* External camera command (exported to the motion eye v4l driver) */
int sony_pic_camera_command(int command, u8 value)
{
_mode, sony_pic_## _name ##_show, \
sony_pic_## _name ##_store)
-static SPIC_ATTR(camerapower, 0644);
static SPIC_ATTR(bluetoothpower, 0644);
static SPIC_ATTR(wwanpower, 0644);
static SPIC_ATTR(fanspeed, 0644);
static struct attribute *spic_attributes[] = {
- &spic_attr_camerapower.attr,
&spic_attr_bluetoothpower.attr,
&spic_attr_wwanpower.attr,
&spic_attr_fanspeed.attr,
};
/******** SONYPI compatibility **********/
-#ifdef CONFIG_SONY_LAPTOP_OLD
+#ifdef CONFIG_SONYPI_COMPAT
/* battery / brightness / temperature addresses */
#define SONYPI_BAT_FLAGS 0x81
static int sonypi_compat_init(void) { return 0; }
static void sonypi_compat_exit(void) { }
static void sonypi_compat_report_event(u8 event) { }
-#endif /* CONFIG_SONY_LAPTOP_OLD */
+#endif /* CONFIG_SONYPI_COMPAT */
/*
* ACPI callbacks
*/
static int sony_pic_disable(struct acpi_device *device)
{
- if (ACPI_FAILURE(acpi_evaluate_object(device->handle, "_DIS", 0, NULL)))
+ if (ACPI_FAILURE(acpi_evaluate_object(device->handle,
+ "_DIS", NULL, NULL)))
return -ENXIO;
dprintk("Device disabled\n");