#include <linux/platform_device.h>
#include <linux/acpi.h>
+#include "../chromeos.h"
+
#define CHNV_DEBUG_RESET_FLAG 0x40 /* flag for S3 reboot */
#define CHNV_RECOVERY_FLAG 0x80 /* flag for recovery reboot */
*
* retrun number of bytes copied, or -1 on any error.
*/
-ssize_t chromeos_vbc_read(void *buf, size_t count)
+static ssize_t chromeos_vbc_nvram_read(void *buf, size_t count)
{
int base, size, i;
return size;
}
-ssize_t chromeos_vbc_write(const void *buf, size_t count)
+static ssize_t chromeos_vbc_nvram_write(const void *buf, size_t count)
{
unsigned base, size, i;
case ACPI_TYPE_STRING:
copy_size = min(element->string.length,
- sizeof(attr_value) - 1);
+ (u32)(sizeof(attr_value)) - 1);
memcpy(attr_value, element->string.pointer, copy_size);
attr_value[copy_size] = '\0';
paa = create_sysfs_attribute(attr_value, pm, count, i);
case ACPI_TYPE_STRING:
copy_size = min(element->string.length,
- sizeof(attr_value) - 1);
+ (u32)(sizeof(attr_value)) - 1);
memcpy(attr_value, element->string.pointer, copy_size);
attr_value[copy_size] = '\0';
add_sysfs_attribute(attr_value, pm, count, j);
return 0;
}
+static struct chromeos_vbc chromeos_vbc_nvram = {
+ .name = "chromeos_vbc_nvram",
+ .read = chromeos_vbc_nvram_read,
+ .write = chromeos_vbc_nvram_write,
+};
+
static int __init chromeos_acpi_init(void)
{
int ret = 0;
+ acpi_status status;
if (acpi_disabled)
return -ENODEV;
+ ret = chromeos_vbc_register(&chromeos_vbc_nvram);
+ if (ret)
+ return ret;
+
chromeos_acpi.p_dev = platform_device_register_simple("chromeos_acpi",
-1, NULL, 0);
if (IS_ERR(chromeos_acpi.p_dev)) {
}
printk(MY_INFO "installed%s\n",
chromeos_on_legacy_firmware() ? " (legacy mode)" : "");
+
+ printk(MY_INFO "chromeos_acpi: enabling S3 USB wake\n");
+ status = acpi_evaluate_object(NULL, "\\S3UE", NULL, NULL);
+ if (!ACPI_SUCCESS(status))
+ printk(MY_INFO "chromeos_acpi: failed to enable S3 USB wake\n");
+
return 0;
}