aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/slippy/mainboard.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-05-24 11:27:12 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-11-25 23:45:44 +0100
commitd67c5dbf06f009b705bc0c2b7278504bb538d36e (patch)
treefe910094ccb42e0f275489d34704e68f12233cbc /src/mainboard/google/slippy/mainboard.c
parent14031db21f3a41966a30bfc27bc97ddf03f40458 (diff)
slippy: Add on-board devices and configure GPIO irq/wake
Add the onboard I2C devices for Slippy trackpad/lightsensor and generate SMBIOS Type41 tables for them. Add ACPI device for the trackpad to expose the interrupt map to the OS so it can be used. Configure interrupt GPIOs as PIRQ type and wake GPIOs as just standard input type. The wake GPIO is reconfigured as ACPI SCI in the specific device _DSW method. This prevents the wake GPIO from generating a flood of SCI at runtime. LTE_WAKE_L_Q and WLAN_WAKE_L_Q are left as ACPI SCI as these are not repurposed interrupt pins so they are not generated at runtime. SIM_DET and ALS_INT_L are set as input since we don't have an interrupt handler for them. tested on slippy with trackpad with additional kernel changes to chromeos_laptop.c to initialize devices. 1) Ensure trackpad interrupt is functional and that there is not a flood of ACPI SCI when trackpad does interrupt: 9: 1 0 0 0 IO-APIC-fasteoi acpi 37: 421 0 0 0 IO-APIC-fasteoi cyapa 2) Ensure that devices are exposed as wake capable: Device S-state Status Sysfs node TPAD S3 *enabled pnp:00:00 TSCR S3 *disabled pnp:00:01 3) Ensure that trackpad can wake from S3 by default, but that it does not cause an immediate wake when entering suspend. 4) Ensure that trackpad can be disabled as a wake source with echo TPAD > /proc/acpi/wakeup Change-Id: Id562d20b54eeefec56040b8f70ef238911312628 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/56622 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/4190 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google/slippy/mainboard.c')
-rw-r--r--src/mainboard/google/slippy/mainboard.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mainboard/google/slippy/mainboard.c b/src/mainboard/google/slippy/mainboard.c
index 0159bd0b6c..3bf26e3f21 100644
--- a/src/mainboard/google/slippy/mainboard.c
+++ b/src/mainboard/google/slippy/mainboard.c
@@ -20,6 +20,7 @@
#include <types.h>
#include <string.h>
+#include <smbios.h>
#include <device/device.h>
#include <device/device.h>
#include <device/pci_def.h>
@@ -36,6 +37,7 @@
#include "hda_verb.h"
#include <southbridge/intel/lynxpoint/pch.h>
#include "ec.h"
+#include "onboard.h"
void mainboard_suspend_resume(void)
{
@@ -145,12 +147,48 @@ static void mainboard_init(device_t dev)
mainboard_ec_init();
}
+static int mainboard_smbios_data(device_t dev, int *handle,
+ unsigned long *current)
+{
+ int len = 0;
+
+ len += smbios_write_type41(
+ current, handle,
+ BOARD_LIGHTSENSOR_NAME, /* name */
+ BOARD_LIGHTSENSOR_IRQ, /* instance */
+ BOARD_LIGHTSENSOR_I2C_BUS, /* segment */
+ BOARD_LIGHTSENSOR_I2C_ADDR, /* bus */
+ 0, /* device */
+ 0); /* function */
+
+ len += smbios_write_type41(
+ current, handle,
+ BOARD_TRACKPAD_NAME, /* name */
+ BOARD_TRACKPAD_IRQ, /* instance */
+ BOARD_TRACKPAD_I2C_BUS, /* segment */
+ BOARD_TRACKPAD_I2C_ADDR, /* bus */
+ 0, /* device */
+ 0); /* function */
+
+ len += smbios_write_type41(
+ current, handle,
+ BOARD_TOUCHSCREEN_NAME, /* name */
+ BOARD_TOUCHSCREEN_IRQ, /* instance */
+ BOARD_TOUCHSCREEN_I2C_BUS, /* segment */
+ BOARD_TOUCHSCREEN_I2C_ADDR, /* bus */
+ 0, /* device */
+ 0); /* function */
+
+ return len;
+}
+
// mainboard_enable is executed as first thing after
// enumerate_buses().
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
+ dev->ops->get_smbios_data = mainboard_smbios_data;
#if CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN
/* Install custom int15 handler for VGA OPROM */
mainboard_interrupt_handlers(0x15, &int15_handler);