aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-11-09platform/chrome: Fix i2c-designware adapter nameJarkko Nikula1-2/+2
Commit d80d134182ba ("i2c: designware: Move common probe code into i2c_dw_probe()") caused the I2C adapter lookup code here to fail for PCI enumerated i2c-designware because commit changed the adapter name but didn't update it here. Fix the I2C adapter lookup by using the "Synopsys DesignWare I2C adapter" name. Reported-by: Jeremiah Mahler <jmmahler@gmail.com> Fixes: d80d134182ba ("i2c: designware: Move common probe code into i2c_dw_probe()") Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Jeremiah Mahler <jmmahler@gmail.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: Support reading/writing the vboot contextEmilio López3-1/+140
Some EC implementations include a small nvram space used to store verified boot context data. This patch offers a way to expose this data to userspace. Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: cros_ec: Fix possible leak in led_rgb_store()Christian Engelmayer1-5/+3
Function led_rgb_store() contains some direct returns in error cases that leak the already allocated cros_ec_command message structure. Make sure that 'msg' is freed in all exit paths. Detected by Coverity CID 1309666. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: cros_ec: Fix leak in sequence_store()Christian Engelmayer1-9/+14
The allocated cros_ec_command message structure is not freed in function sequence_store(). Make sure that 'msg' is freed in all exit paths. Detected by Coverity CID 1309667. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: Enable Chrome platforms on 64-bit ARMThierry Reding1-1/+1
With Chrome running on 64-bit ARM devices, add ARM64 to the list of supported architectures. Signed-off-by: Thierry Reding <treding@nvidia.com> [olof; Fixed up due to addition of COMPILE_TEST] Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: cros_ec_dev - Add a platform device ID tableJavier Martinez Canillas1-0/+6
If the cros_ec_dev driver is built as a module, modalias information is not filled so the module is not autoloaded. Add a platform device table and use the MODULE_DEVICE_TABLE() macro to export that information in the module so user-space can match the modalias uevent and autoload it. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: cros_ec_lpc - Add support for Google Pixel 2Javier Martinez Canillas1-0/+7
Since the verion of ACPI in Google BIOS does not enumerate the devices in the LPC bus, the cros_ec_lpc driver resorts to DMI data to check if a system is supported by the driver and autoload if built as a module. Add information about the Google Pixel 2 to the DMI device table. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: cros_ec_lpc - Use existing function to check EC resultJavier Martinez Canillas1-12/+2
Commit 6db07b633658 ("mfd: cros_ec: Check result code from EC messages") added a common cros_ec_check_result() function that can be used to check the ec_msg->result for errors and warns about them. Use the existing function instead of duplicating same check in the driver. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTOJavier Martinez Canillas1-2/+2
The ChromeOS EC LPC and chardev drivers depend on CROS_EC_PROTO but MFD_CROS_EC select CROS_EC_PROTO instead. Mixing select and depends on is bad practice as it may lead to circular Kconfig dependencies. Since the platform devices that are matched with these drivers are registered by the ChromeOS EC mfd driver, they really depend on MFD_CROS_EC. And because this config option selects CROS_EC_PROTO, that dependency is met as well. So make the drivers to depend on MFD_CROS_EC instead of CROS_EC_PROTO. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-10-07Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"Javier Martinez Canillas1-0/+1
This reverts commit d12bbcd3ea44 ("platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM") since it was found to not be the correct fix for the MFD_CROS_EC config unmet direct dependencies warning. The correct solution was to add the needed dependencies to the MFD_CROS_EC symbol. Besides the revert, this patch extends the CHROME_PLATFORMS symbol dependencies and adds || COMPILE_TEST to allow drivers to have build coverage on other architectures. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-09-04Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-1/+3
Pull input subsystem updates from Dmitry Torokhov: "Drivers, drivers, drivers... No interesting input core changes this time" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (74 commits) Input: elan_i2c - use iap_version to get firmware information Input: max8997_haptic - fix module alias Input: elan_i2c - fix typos for validpage_count Input: psmouse - add small delay for IBM trackpoint pass-through mode Input: synaptics - fix handling of disabling gesture mode Input: elan_i2c - enable ELAN0100 acpi panels Input: gpio-keys - report error when disabling unsupported key Input: sur40 - fix error return code Input: sentelic - silence some underflow warnings Input: zhenhua - switch to using bitrev8() Input: cros_ec_keyb - replace KEYBOARD_CROS_EC dependency Input: cap11xx - add LED support Input: elants_i2c - fix for devm_gpiod_get API change Input: elan_i2c - enable asynchronous probing Input: elants_i2c - enable asynchronous probing Input: elants_i2c - wire up regulator support Input: do not emit unneeded EV_SYN when suspending Input: elants_i2c - disable idle mode before updating firmware MAINTAINERS: Add maintainer for atmel_mxt_ts Input: atmel_mxt_ts - remove warning on zero T44 count ...
2015-08-04Input: atmel_mxt_ts - use deep sleep mode when stoppedNick Dyer1-1/+3
The hardcoded 0x83 CTRL setting overrides other settings in that byte, enabling extra reporting that may not be useful on a particular platform. Implement improved suspend mechanism via deep sleep. By writing zero to both the active and idle cycle times the maXTouch device can be put into a deep sleep mode, using minimal power. It is necessary to issue a calibrate command after the chip has spent any time in deep sleep, however a soft reset is unnecessary. Use the old method on Chromebook Pixel via platform data option. This patch also deals with the situation where the power configuration is zero on probe, which would mean that the device never wakes up to execute commands. After a config download, the T7 power configuration may have changed so it is necessary to re-read it. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-24platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARMJavier Martinez Canillas1-1/+0
The Chrome platform support depends on X86 || ARM because there are only Chromebooks using those architectures. But only some drivers depend on a given architecture, and the ones that do already have a dependency on their specific Kconfig symbol entries. An option is to also make CHROME_PLATFORMS depends on || COMPILE_TEST but is more future proof to remove the dependency and let the drivers be built in all architectures if possible to have more build coverage. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: Support multiple EC in a systemGwendal Grignou5-110/+151
Chromebooks can have more than one Embedded Controller so the cros_ec device id has to be incremented for each EC registered. Add a new structure to represent multiple EC as different char devices (e.g: /dev/cros_ec, /dev/cros_pd). It connects to cros_ec_device and allows sysfs inferface for cros_pd. Also reduce number of allocated objects, make chromeos sysfs class object a static and add refcounting to prevent object deletion while command is in progress. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: add bus-specific proto v3 codeStephen Barber1-1/+72
Add proto v3 support to the SPI, I2C, and LPC. Signed-off-by: Stephen Barber <smbarber@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: add proto v3 skeletonStephen Barber2-36/+307
Add support in cros_ec.c to handle EC host command protocol v3. For v3+, probe for maximum shared protocol version and max request, response, and passthrough sizes. For now, this will always fall back to v2, since there is no bus-specific code for handling proto v3 packets. Signed-off-by: Stephen Barber <smbarber@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: Move protocol helpers out of the MFD driverJavier Martinez Canillas3-2/+123
The MFD driver should only have the logic to instantiate its child devices and setup any shared resources that will be used by the subdevices drivers. The cros_ec MFD is more complex than expected since it also has helpers to communicate with the EC. So the driver will only get more bigger as other protocols are supported in the future. So move the communication protocol helpers to its own driver as drivers/platform/chrome/cros_ec_proto.c. Suggested-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: rev cros_ec_commands.hStephen Barber1-7/+7
Update cros_ec_commands.h to the latest version in the EC firmware sources and add power domain and passthru commands. Also, update lightbar to use new command names. Signed-off-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: Use a zero-length array for command dataJavier Martinez Canillas4-135/+244
Commit 1b84f2a4cd4a ("mfd: cros_ec: Use fixed size arrays to transfer data with the EC") modified the struct cros_ec_command fields to not use pointers for the input and output buffers and use fixed length arrays instead. This change was made because the cros_ec ioctl API uses that struct cros_ec_command to allow user-space to send commands to the EC and to get data from the EC. So using pointers made the API not 64-bit safe. Unfortunately this approach was not flexible enough for all the use-cases since there may be a need to send larger commands on newer versions of the EC command protocol. So to avoid to choose a constant length that it may be too big for most commands and thus wasting memory and CPU cycles on copy from and to user-space or having a size that is too small for some big commands, use a zero-length array that is both 64-bit safe and flexible. The same buffer is used for both output and input data so the maximum of these values should be used to allocate it. Suggested-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15mfd: cros_ec: Remove parent fieldGwendal Grignou1-1/+0
Parent and device were pointing to the same device structure. Parent is unused, removed. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-04-24platform/chrome: chromeos_laptop - instantiate Atmel at primary addressDmitry Torokhov1-9/+26
The new Atmel MXT driver expects i2c client's address contain the primary (main address) of the chip, and calculates the expected bootloader address form the primary address. Unfortunately chrome_laptop does probe the devices and if touchpad (or touchscreen, or both) comes up in bootloader mode the i2c device gets instantiated with the bootloader address which confuses the driver. To work around this issue let's probe the primary address first. If the device is not detected at the primary address we'll probe alternative addresses as "dummy" devices. If any of them are found, destroy the dummy client and instantiate client with proper name at primary address still. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-03-04platform/chrome: cros_ec_lpc - Depend on X86 || COMPILE_TESTJavier Martinez Canillas1-1/+1
The ChromeOS EC is connected by LPC only on x86 platforms and no others, so add a dependency describing that. But also build the driver if the COMPILE_TEST option is enabled to have build coverage in other architectures. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> [olof: reworded commit message] Signed-off-by: Olof Johansson <olof@lixom.net>
2015-03-04platform/chrome: cros_ec_lpc - Include linux/io.h header fileJavier Martinez Canillas1-0/+1
The driver uses the inb() and outb() I/O functions so should include the header file that has these functions definitions. This patch fixes the following error when the header is not explicitly included: drivers/platform/chrome//cros_ec_lpc.c: In function ‘ec_response_timed_out’: drivers/platform/chrome//cros_ec_lpc.c:40:3: error: implicit declaration of function ‘inb’ [-Werror=implicit-function-declaration] drivers/platform/chrome//cros_ec_lpc.c: In function ‘cros_ec_cmd_xfer_lpc’: drivers/platform/chrome//cros_ec_lpc.c:75:3: error: implicit declaration of function ‘outb’ [-Werror=implicit-function-declaration] Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-03-04platform/chrome: fix platform_no_drv_owner.cocci warningskbuild test robot1-1/+0
drivers/platform/chrome/cros_ec_lpc.c:272:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-03-04platform/chrome: cros_ec_lightbar - fix duplicate const warningOlof Johansson1-1/+1
Fix the following sparse warning: drivers/platform/chrome/cros_ec_lightbar.c:254:25: sparse: duplicate const Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Olof Johansson <olofj@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-03-04platform/chrome: cros_ec_dev - fix Unknown escape '%' warningOlof Johansson1-1/+1
Fix the following sparse warning: drivers/platform/chrome/cros_ec_dev.c:64:45: sparse: Unknown escape '%' Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Olof Johansson <olofj@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-02-26platform/chrome: Expose Chrome OS Lightbar to usersBill Richardson4-1/+373
This adds some sysfs entries to provide userspace control of the four-element LED "lightbar" on the Chromebook Pixel. This only instantiates the lightbar controls if the device actually exists. To prevent DoS attacks, this interface is limited to 20 accesses/second, although that rate can be adjusted by a privileged user. On Chromebooks without a lightbar, this should have no effect. On the Chromebook Pixel, you should be able to do things like this: $ cd /sys/devices/virtual/chromeos/cros_ec/lightbar $ echo 0x80 > brightness $ echo 255 > brightness $ $ cat sequence S0 $ echo konami > sequence $ cat sequence KONAMI $ $ cat sequence S0 And $ cd /sys/devices/virtual/chromeos/cros_ec/lightbar $ echo stop > sequence $ echo "4 255 255 255" > led_rgb $ echo "0 255 0 0 1 0 255 0 2 0 0 255 3 255 255 0" > led_rgb $ echo run > sequence Test the DoS prevention with this: $ cd /sys/devices/virtual/chromeos/cros_ec/lightbar $ echo 500 > interval_msec $ time (cat version version version version version version version) Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Olof Johansson <olofj@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-02-26platform/chrome: Create sysfs attributes for the ChromeOS ECBill Richardson4-1/+280
This adds the first few sysfs attributes for the Chrome OS EC. These controls are made available under /sys/devices/virtual/chromeos/cros_ec flashinfo - display current flash info reboot - tell the EC to reboot in various ways version - information about the EC software and hardware Future changes will build on this to add additional controls. From a root shell, you should be able to do things like this: cd /sys/devices/virtual/chromeos/cros_ec cat flashinfo cat version echo rw > reboot cat version echo ro > reboot cat version echo rw > reboot cat version echo cold > reboot That last command will reboot the AP too. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Olof Johansson <olofj@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-02-26platform/chrome: Add Chrome OS EC userspace device interfaceBill Richardson4-3/+327
This patch adds a device interface to access the Chrome OS Embedded Controller from user-space. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Simon Glass <sjg@google.com> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-02-26platform/chrome: Add cros_ec_lpc driver for x86 devicesBill Richardson3-0/+332
Chromebooks have an Embedded Controller (EC) that is used to implement various functions such as keyboard, power and battery. The AP can communicate with the EC through different bus types such as I2C, SPI or LPC. The cros_ec mfd driver is then composed of a core driver that register the sub-devices as mfd cells and provide a high level communication interface that is used by the rest of the kernel and bus specific interfaces modules. Each connection method then has its own driver, which register with the EC driver interface-agnostic interface. Currently, there are drivers to communicate with the EC over I2C and SPI and this driver adds support for LPC. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-10-20platform: chrome: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-08-10Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platformLinus Torvalds2-22/+132
Pull chrome platform updates from Olof Johansson: "Updates to the Chromebook/box platform drivers: - a bugfix to pstore registration that makes it also work on non-Google systems - addition of new shipped Chromebooks (later models have more probing through ACPI so the need for these updates will be less over time). - A couple of minor coding style updates" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform: platform/chrome: chromeos_laptop - Add a limit for deferred retries platform/chrome: Add support for the acer c720p touchscreen. platform/chrome: pstore: fix dmi table to match all chrome systems platform/chrome: coding style fixes platform/chrome: chromeos_laptop - Add Toshiba CB35 Touch platform/chrome: chromeos_laptop - Add Dell Chromebook 11 touch platform/chrome: chromeos_laptop - Add HP Chromebook 14 platform/chrome: chromeos_laptop - Add support for Acer C720
2014-07-23Input: atmel_mxt_ts - download device config using firmware loaderNick Dyer1-4/+0
The existing implementation which encodes the configuration as a binary blob in platform data is unsatisfactory since it requires a kernel recompile for the configuration to be changed, and it doesn't deal well with firmware changes that move values around on the chip. Atmel define an ASCII format for the configuration which can be exported from their tools. This patch implements a parser for that format which loads the configuration via the firmware loader and sends it to the MXT chip. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-15platform/chrome: chromeos_laptop - Add a limit for deferred retriesBenson Leung1-4/+41
Limit the number of times we allow deferred probing to attempt to add i2c devices. This will help with some device flakiness at probe time. For example, some touchpads and touchscreens may be in transition between bootloader and operational mode and may appear at neither address briefly. Adapters, however, have no limit as it depends on when the i2c adapter driver module is loaded. The module may even be loaded manually by the user using modprobe or insmod. By default, set MAX_I2C_DEVICE_DEFERALS to 5. Based on this patch from the chromeos-kernel : https://chromium-review.googlesource.com/168130 Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-15platform/chrome: Add support for the acer c720p touchscreen.Michael Mullin1-0/+2
Add support for the acer c720p touchscreen. Tested manually by using the touchscreen on the acer c720p-2664 Based on the following patch by Dave Parker <dparker@chromium.org>: https://chromium-review.googlesource.com/#/c/167136/ Signed-off-by: Michael Mullin <masmullin@gmail.com> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-10platform/chrome: pstore: fix dmi table to match all chrome systemsOlof Johansson1-12/+2
Turns out that DMI_SYSTEM_VENDOR is actually the native vendor of each Chromebook/box. I tested the original patch on a Pixel that -- surprise, has Google as vendor. *facepalm*. The only other data I can think of to probe on is Google_* in the version string. Checking with our firmware team, all systems should have this and nothing else than Chrome hardware should have the coreboot + Google_* combination to date. So, we'll switch to this. For future platforms we are going to move to using an ACPI device to configure this instead of a DMI table (yay!), so longer-term that will sort itself out. Signed-off-by: Olof Johansson <olof@lixom.net> Reviewed-by: Benson Leung <bleung@chromium.org>
2014-07-10platform/chrome: coding style fixesRobin Schroer1-0/+3
added blank lines after declarations in some places Signed-off-by: Robin Schroer <sulamiification@gmail.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-10platform/chrome: chromeos_laptop - Add Toshiba CB35 TouchGene Chen1-0/+15
Add support for Leon touch devices, which is the same as falco/peppy/wolf on the same buses using the LynxPoint-LP I2C via the i2c-designware-pci driver. Based on these patches from the chromeos-3.8 kernel: https://chromium-review.googlesource.com/168351 https://chromium-review.googlesource.com/173445 Signed-off-by: Gene Chen <gene.chen@intel.com> Signed-off-by: Benson Leung <bleung@chromium.org> Tested-by: Scot Doyle <lkml14@scotdoyle.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-10platform/chrome: chromeos_laptop - Add Dell Chromebook 11 touchMohammed Habibulla1-0/+15
Add support for Dell Chromebook 11's touch device, which is the same as falco/peppy on the same bus using the LynxPoint-LP I2C via the i2c-designware-pci driver. Based on these patches from the chromeos-3.8 kernel: https://chromium-review.googlesource.com/#/c/65320/ https://chromium-review.googlesource.com/#/c/174664/ Signed-off-by: Mohammed Habibulla <moch@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-10platform/chrome: chromeos_laptop - Add HP Chromebook 14Benson Leung1-0/+15
Add support for the trackpad on HP Chromebook 14. Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-10platform/chrome: chromeos_laptop - Add support for Acer C720Mika Westerberg1-6/+39
Acer C720 has touchpad and light sensor connected to a separate I2C buses. Since the designware I2C host controller driver has two instances on this particular machine we need a way to match the correct instance. Add support for this and then register both C720 touchpad and light sensor. This code is based on following patch from Benson Leung: https://patchwork.kernel.org/patch/3074411/ Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2014-05-26Input: atmel_mxt_ts - read screen config from chipNick Dyer1-6/+0
By reading the touchscreen configuration from the settings that the maXTouch chip is actually using, we can remove some platform data. The matrix size is not used for anything, and results in some rather confusing code to re-read it because it may change when configuration is downloaded, so don't print it out. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18Input: atmel_mxt_ts - improve T19 GPIO keys handlingNick Dyer1-6/+11
* The mapping of the GPIO numbers into the T19 status byte varies between different maXTouch chips. Some have up to 7 GPIOs. Allowing a keycode array of up to 8 items is simpler and more generic. So replace #define with configurable number of keys which also allows the removal of is_tp. * Rename platform data parameters to include "t19" to prevent confusion with T15 key array. * Probe aborts early on when pdata is NULL, so no need to check. * Move "int i" to beginning of function (mixed declarations and code) * Use API calls rather than __set_bit() * Remove unused dev variable. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Yufeng Shen <miletus@chromium.org> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18Input: atmel_mxt_ts - remove unnecessary platform dataNick Dyer1-10/+0
It is not necessary to download these values to the maXTouch chip on every probe, since they are stored in NVRAM. It makes life difficult when tuning the device to keep them in sync with the config array/file, and requires a new kernel build for minor tweaks. These parameters only represent a tiny subset of the available configuration options, tracking all of these options in platform data would be a endless task. In addition, different versions of maXTouch chips may have these values in different places or may not even have them at all. Having these values also makes life more complex for device tree and other platforms where having to define a static configuration isn't helpful. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-11-26platform/chrome: unregister platform driver/device when module exitWei Yongjun1-0/+3
We have registered platform driver and device when module init, and need unregister them when module exit. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-11-25platform/chrome: Make i2c_adapter_names staticOlof Johansson1-1/+1
Not used outside of the file, so declaration should be static. Picked up by sparse: drivers/platform/chrome/chromeos_laptop.c:44:12: warning: symbol 'i2c_adapter_names' was not declared. Should it be static? Signed-off-by: Olof Johansson <olof@lixom.net> Reviewed-by: Benson Leung <bleung@chromium.org>
2013-11-25platform/chrome: chromeos_laptop - fix incorrect placement of __initdata tagBenson Leung1-1/+1
__initdata tag should be placed between the variable name and equal sign for the variable to be placed in the intended .init.data section. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-11-25platform/chrome: chromeos_laptop - Use deferred probingBenson Leung1-43/+101
Further refactor chromeos_laptop, adding a probe function. Init will call dmi_check_system, but will only use the match to select a chromeos_laptop structure of the current board. Probe will add the devices, and on errors return -EPROBE_DEFER. If i2c adapters are loaded after chromeos_laptop inits, the deferred probe will instantiate the peripherals when the bus appears. Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-11-25platform/chrome: chromeos_laptop - Restructure device associationsAaron Durbin1-71/+126
The previous code had a single DMI matching entry for each device on a board. Instead provide a single DMI entry for each board which references a structure about each board that lists the associated peripherals. This allows for a lower number of DMI matching sequences as well making it easier to add new boards. Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-11-25platform/chrome: Add pstore platform_deviceOlof Johansson3-0/+116
Add the ramoops pstore device so that we get logs of panics across reboots. Signed-off-by: Olof Johansson <olof@lixom.net>