summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/chromeos_laptop.c
AgeCommit message (Collapse)Author
2017-12-15platform/chrome: chromeos_laptop: make chromeos_laptop constBhumika Goyal
Declare chromeos_laptop structures as const as they are only used during a copy operation. As their value is never modified during runtime, they can be made const. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
2017-09-14dmi: Mark all struct dmi_system_id instances constChristoph Hellwig
... and __initconst if applicable. Based on similar work for an older kernel in the Grsecurity patch. [JD: fix toshiba-wmi build] [JD: add htcpen] [JD: move __initconst where checkscript wants it] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jean Delvare <jdelvare@suse.de>
2016-05-28Revert "platform/chrome: chromeos_laptop: Add Leon Touch"Benson Leung
This reverts commit bff3c624dc7261a084a4d25a0b09c3fb0fec872a. Board "Leon" is otherwise known as "Toshiba CB35" and we already have the entry that supports that board as of this commit : 963cb6f platform/chrome: chromeos_laptop - Add Toshiba CB35 Touch Remove this duplicate. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11platform/chrome: chromeos_laptop - Add Elan touchpad for WolfCharlie Mooney
The upcoming Elan Wolf (Dell Chromebook 11) devices need to know to look for Elan touchpads on the i2c bus so that they will be functional. Based on the chromeos-kernel commit : https://chromium-review.googlesource.com/198283 Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11platform/chrome: chromeos_laptop - Add elan trackpad option for C720Benson Leung
Add the elan trackpad to the Acer C720 (peppy) list, as it is an alternate trackpad option. It may exist at i2c address 0x15. Based on this change from the chromeos kernel : https://chromium-review.googlesource.com/186253 Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
2016-05-11platform/chrome: chromeos_laptop: Add Leon TouchGene Chen
Add support for Leon touch devices, which is the same as slippy/falco/peppy/wolf on the same buses using the LynxPoint-LP I2C via the i2c-designware-pci driver. Based on the following patch: https://chromium-review.googlesource.com/#/c/168351/ Signed-off-by: Gene Chen <gene.chen@intel.com> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2015-11-09platform/chrome: Fix i2c-designware adapter nameJarkko Nikula
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-08-04Input: atmel_mxt_ts - use deep sleep mode when stoppedNick Dyer
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-04-24platform/chrome: chromeos_laptop - instantiate Atmel at primary addressDmitry Torokhov
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>
2014-10-20platform: chrome: drop owner assignment from platform_driversWolfram Sang
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 ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform 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 Dyer
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 Leung
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 Mullin
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: coding style fixesRobin Schroer
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 Chen
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 Habibulla
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 Leung
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 Westerberg
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 Dyer
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 Dyer
* 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 Dyer
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 Yongjun
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 Johansson
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 Leung
__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 Leung
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 Durbin
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-20platform: add chrome platform directoryOlof Johansson
It makes sense to split out the Chromebook/Chromebox hardware platform drivers to a separate subdirectory, since some of it will be shared between ARM and x86. This moves over the existing chromeos_laptop driver without making any other changes, and adds appropriate Kconfig entries for the new directory. It also adds a MAINTAINERS entry for the new subdir. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>