04 Jan, 2021

1 commit

  • This is the 5.10.4 stable release

    * tag 'v5.10.4': (717 commits)
    Linux 5.10.4
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    drm/edid: fix objtool warning in drm_cvt_modes()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/gpu/drm/imx/dcss/dcss-plane.c
    drivers/media/i2c/ov5640.c

    Jason Liu
     

30 Dec, 2020

5 commits

  • commit f051ae4f6c732c231046945b36234e977f8467c6 upstream.

    gcc -Warray-bounds warns about a serious bug in
    cyapa_pip_retrieve_data_structure:

    drivers/input/mouse/cyapa_gen6.c: In function 'cyapa_pip_retrieve_data_structure.constprop':
    include/linux/unaligned/access_ok.h:40:17: warning: array subscript -1 is outside array bounds of 'struct retrieve_data_struct_cmd[1]' [-Warray-bounds]
    40 | *((__le16 *)p) = cpu_to_le16(val);
    drivers/input/mouse/cyapa_gen6.c:569:13: note: while referencing 'cmd'
    569 | } __packed cmd;
    | ^~~

    Apparently the '-2' was added to the pointer instead of the value,
    writing garbage into the stack next to this variable.

    Fixes: c2c06c41f700 ("Input: cyapa - add gen6 device module support")
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20201026161332.3708389-1-arnd@kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • [ Upstream commit 59bbf83835f591b95c3bdd09d900f3584fa227af ]

    In omap4_keypad_probe, the patch fix several bugs.

    1) pm_runtime_get_sync will increment pm usage counter even it
    failed. Forgetting to pm_runtime_put_noidle will result in
    reference leak.

    2) In err_unmap, forget to disable runtime of device,
    pm_runtime_enable will increase power disable depth. Thus a
    pairing decrement is needed on the error handling path to keep
    it balanced.

    3) In err_pm_disable, it will call pm_runtime_put_sync twice not
    one time.

    To fix this we factor out code reading revision and disabling touchpad, and
    drop PM reference once we are done talking to the device.

    Fixes: f77621cc640a7 ("Input: omap-keypad - dynamically handle register offsets")
    Fixes: 5ad567ffbaf20 ("Input: omap4-keypad - wire up runtime PM handling")
    Signed-off-by: Zhang Qilong
    Link: https://lore.kernel.org/r/20201120133918.2559681-1-zhangqilong3@huawei.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Zhang Qilong
     
  • [ Upstream commit 03e2c9c782f721b661a0e42b1b58f394b5298544 ]

    req->sample[1] is not naturally aligned at word boundary, and therefore we
    should use get_unaligned_be16() when accessing it.

    Fixes: 3eac5c7e44f3 ("Input: ads7846 - extend the driver for ads7845 controller support")
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Dmitry Torokhov
     
  • [ Upstream commit 820830ec918f6c3dcd77a54a1c6198ab57407916 ]

    In some rare cases the 32 bit Rt value will overflow if z2 and x is max,
    z1 is minimal value and x_plate_ohms is relatively high (for example 800
    ohm). This would happen on some screen age with low pressure.

    There are two possible fixes:
    - make Rt 64bit
    - reorder calculation to avoid overflow

    The second variant seems to be preferable, since 64 bit calculation on
    32 bit system is a bit more expensive.

    Fixes: ffa458c1bd9b6f653008d450f337602f3d52a646 ("spi: ads7846 driver")
    Co-developed-by: David Jander
    Signed-off-by: David Jander
    Signed-off-by: Oleksij Rempel
    Link: https://lore.kernel.org/r/20201113112240.1360-1-o.rempel@pengutronix.de
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Oleksij Rempel
     
  • [ Upstream commit e52cd628a03f72a547dbf90ccb703ee64800504a ]

    If touchscreen is released while busy reading HWMON device, the release
    can be missed. The IRQ thread is not started because no touch is active
    and BTN_TOUCH release event is never sent.

    Fixes: f5a28a7d4858f94a ("Input: ads7846 - avoid pen up/down when reading hwmon")
    Co-developed-by: Oleksij Rempel
    Signed-off-by: David Jander
    Signed-off-by: Oleksij Rempel
    Link: https://lore.kernel.org/r/20201027105416.18773-1-o.rempel@pengutronix.de
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    David Jander
     

18 Dec, 2020

2 commits

  • * sensor/next: (31 commits)
    input: rpmsg-input: convert pm_qos_*() usage to new cpu_latency_qos_*()
    LF-665-4 input: mma8450: fix build break
    LF-375 sensor: fxls8471: set output data rate when device init
    LF-99 hwmon: mag3110: correct processing order after probe error
    MLK-22296-4 misc: mpl3115: Fix build warning when CONFIG_PM_SLEEP=n
    ...

    BJ DevOps Team
     
  • * origin/input/touch: (15 commits)
    LF-2539-2 input: touch: goodix: force set the IRQ_TYPE_EDGE_FALLING for GT1151Q
    MLK-24528 input: touch: synaptics_dsx: correct the irq handler define
    LF-45-2: input: touch: synaptics_dsx: enable module autoloading
    MLK-19751 input: synaptics_dsx: free touch irq when touch suspend
    MLK-18816-2 input/touch: do not clear touch interrupt when enable irq
    ...

    BJ DevOps Team
     

14 Dec, 2020

32 commits

  • 67b06ba0 ("PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions")
    changed the pm_qos_*() APIs. Updated the IMX usage of them to the new
    APIs.

    Signed-off-by: Li Yang
    Signed-off-by: Dong Aisheng

    Li Yang
     
  • ../drivers/input/misc/mma8450.c: In function 'mma8450_probe':
    ../drivers/input/misc/mma8450.c:156:6: error: redeclaration of 'err' with no linkage
    int err, client_id;

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • The default output data rate was only assigned to variable. It was not
    configured for register when sensor init. This causes output data rate
    is 800hz and it will increase cpu loading.
    Config output data rate as 12.5hz to register when sensor init now.

    Acked-by: Fugang Duan
    Signed-off-by: Clark Wang

    Clark Wang
     
  • Fix build warning when CONFIG_PM_SLEEP=n, the warning message is:
    drivers/input/misc/mpl3115.c:290:12: warning: ‘mpl3115_start_chip’ defined but not used [-Wunused-function]
    static int mpl3115_start_chip(struct i2c_client *client)
    ^~~~~~~~~~~~~~~~~~

    Signed-off-by: Clark Wang
    (cherry picked from commit fd826f4b26257fe04272e0d91b53a8e448812bf3)

    Clark Wang
     
  • The sensors share an interrupt pin on imx8qm/imx8qxp mek.
    As a result, the interrupt signals will be interfered by
    each other in default push-pull status.

    This patch sets sensor interrupt pins as open-drain when
    necessary.

    Signed-off-by: Gao Pan
    (cherry-picked from 48bcb7aafa2a3ced923d1a1753bb19d89a9fc273)
    Signed-off-by: Vipul Kumar
    (cherry picked from commit 8406dfab0fdbd5d135a614c38492b2e949ce0ede)

    Gao Pan
     
  • In probe function, if probe fails, the enabled regulator will cause a
    WARN_ON.
    Add regulator_diable when error occurs in probe function.

    Signed-off-by: Clark Wang

    Clark Wang
     
  • Add makefile and kconfig strings for rpmsg sensor and isl29023.

    Signed-off-by: Clark Wang

    Clark Wang
     
  • Add Freescale fxls8471 motion sensor support files.

    Signed-off-by: Clark Wang

    Clark Wang
     
  • When CONFIG_SENSOR_FXLS8471=m build was failing due to missing
    exported symbol. This patch export the missing symbol.

    Signed-off-by: Julien Olivain
    Signed-off-by: Vipul Kumar

    Julien Olivain
     
  • The driver kfree the global memory that is not correct. The patch
    remove them.

    Signed-off-by: Fugang Duan
    Signed-off-by: Vipul Kumar

    Fugang Duan
     
  • Support ±2g/±4g/±8g dynamically selection for motion sensor fxls8471.

    Set the sensor mode to standby mode before changing the scale range
    with the command "echo 0 > enable". The scale range can be changed
    with the command "echo 0/1/2 > range".

    Signed-off-by: Gao Pan
    Signed-off-by: Fugang Duan
    (cherry picked from commit: 6824cff93d368eafbf96c71fad541f9bc2502e3a)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Gao Pan
     
  • Add Freescale fxls8471 motion sensor.

    Signed-off-by: Gao Pan
    Signed-off-by: Fugang Duan
    (cherry picked from commit: 20cfe2d9d9305559e35fe2e508d5a70b057ffc70)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    gaopan
     
  • Fix the Coverity warning "divide_by_zero".

    If "rext" is incorrectly set as zero in dts file, "divide_by_zero" will
    happen at line 960. So add a judgment condition here, and let "rext" uses
    default value when it is equal to zero.

    Signed-off-by: Clark Wang
    (cherry picked from commit 999f94e0d7524640381eb4b3f6590f213533679e)

    Clark Wang
     
  • Add isl29023 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

    Signed-off-by: Luwei Zhou
    Signed-off-by: Fugang Duan
    (cherry picked from commit: b0134420bba0022151499f1bb15e0d5daba970fa)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Luwei Zhou
     
  • Add chip ID check in probe function. The mma8450 is
    on the E-INK daughter board. When the daughter board
    is not pluged, there would be polling error log
    continuously. Add the check to avoid this.

    Signed-off-by: Luwei Zhou
    Signed-off-by: Fugang Duan
    (cherry picked from commit e9f2c4cf673dee1527925f30a9f3fd137d9799ad)
    Signed-off-by: Vipul Kumar
    [ Aisheng: fix minior conflicts due to
    867e8820e037 ("Input: mma8450 - switch to using polled mode of input devices") ]
    Sign-off-by: Dong Aisheng

    Luwei Zhou
     
  • NXP i.MX7ULP EVK boards all sensors connect with M4 core, A core
    has to conmunicate with sensors by virtual io bus like rpmsg bus.
    The driver implement the virtual sensor input driver to configure
    sensors active/idle/delay actions and report the sensors' event to
    user space.

    Supply below sysfs for user to enable/disable detector and counter,
    set poll delay:
    /sys/class/misc/step_counter/enable
    /sys/class/misc/step_detector/enable
    /sys/class/misc/step_counter/poll_delay

    Reviewed-by: Elven Wang
    Signed-off-by: Fugang Duan
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Fugang Duan
     
  • Add Freescale MPL3115 pressure temperature sensor.

    Signed-off-by: Fugang Duan
    (cherry picked from commit 16bf758cad781d9f67e16206e2f6e8071df72814)

    Fugang Duan
     
  • For the touch chip use on the new OLED panel(rm67199), when touch
    the screen, GT1151Q sends a falling edge pulse via INT pin.

    For code logic, it will read the touch internal config data, the bit[1~0]
    of config[6] means the interrupt trigger method. For this GT1151Q, this
    bit[1~0] is 3 in default, which means IRQ_TYPE_LEVEL_HIGH, which not
    match with the datasheet and the hardware behavior. Since the default
    level of the INT pin is high, so after driver probe, a lot of useless
    touch interrupts keep triggered.
    To fix this, need to update the touch firmware. Set the bit[1~0] of config[6]
    to value 1. Since we lack the touch firmware file, as a workaround, add a
    property "edge-failling-trigger" in dts file, if has this property, force
    set the IRQ_TYPE_EDGE_FALLING.

    Signed-off-by: Haibo Chen
    Reviewed-by: Dong Aisheng

    Haibo Chen
     
  • According to the define: typedef irqreturn_t (*irq_handler_t)(int, void *);
    correct the two parameter definition of tpd_eint_handler.

    If not, Android will get the following dump since Android set the CONFIG_CFI_CLANG

    [ 49.905828] ------------[ cut here ]------------ [1088/49494]
    [ 49.910457] CFI failure (target: tpd_eint_handler+0x0/0x4 [synaptics_dsx_i2c]):
    [ 49.917785] WARNING: CPU: 0 PID: 0 at kernel/cfi.c:29 __ubsan_handle_cfi_check_fail+0x4c/0x54
    [ 49.926299] Modules linked in: vvcam(O) synaptics_dsx_i2c pcie8xxx mlan
    [ 49.932912] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 5.4.47-00119-gfd9c870e583c #1
    [ 49.941948] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 49.947252] pstate: 60400085 (nZCv daIf +PAN -UAO)
    [ 49.952036] pc : __ubsan_handle_cfi_check_fail+0x4c/0x54
    [ 49.957340] lr : __ubsan_handle_cfi_check_fail+0x4c/0x54
    [ 49.962642] sp : ffff800010003d80
    [ 49.965956] x29: ffff800010003d80 x28: ffff80001154e76c
    [ 49.971268] x27: ffff800012560140 x26: ffff000177c28c00
    [ 49.976572] x25: 0000000000000003 x24: ffff8000096fb394
    [ 49.981876] x23: 0000000000000059 x22: ffff8000096fb000
    [ 49.987180] x21: c6783f1d911d68d7 x20: ffff8000126a90c0
    [ 49.992483] x19: ffff8000096fb394 x18: ffff00017f338058
    [ 49.997787] x17: 0000000000000041 x16: ffff800011526a2c
    [ 50.003099] x15: ffff800011e308e7 x14: 0000000000000050
    [ 50.008403] x13: 0000000000003537 x12: 0000000000000000
    [ 50.013706] x11: 0000000000000000 x10: 00000000ffffffff
    [ 50.019010] x9 : 6320576a23b1fd00 x8 : 6320576a23b1fd00
    [ 50.024314] x7 : 735b203478302f30 x6 : ffff800012772273
    [ 50.029617] x5 : 0000000000000000 x4 : 0000000000000008
    [ 50.034921] x3 : ffff80001155978c x2 : fffffffffffffc04
    [ 50.040225] x1 : 0000000000000000 x0 : 0000000000000043
    [ 50.045529] Call trace:
    [ 50.047978] __ubsan_handle_cfi_check_fail+0x4c/0x54
    [ 50.052940] __cfi_check_fail+0x30/0x38 [synaptics_dsx_i2c]
    [ 50.058509] __cfi_check+0x32c/0x358 [synaptics_dsx_i2c]
    [ 50.063817] __handle_irq_event_percpu+0x330/0x37c
    [ 50.068600] handle_irq_event+0x60/0xd8
    [ 50.072428] handle_level_irq+0x178/0x2dc
    [ 50.076430] generic_handle_irq+0x44/0x8c
    [ 50.080433] mxc_gpio_irq_handler+0x68/0x10c
    [ 50.084695] mx3_gpio_irq_handler+0xf8/0x200
    [ 50.088957] __handle_domain_irq+0xa0/0x108
    [ 50.093132] efi_header_end+0xb8/0x15c
    [ 50.096873] el1_irq+0x104/0x200
    [ 50.100103] cpuidle_enter_state+0x178/0x314
    [ 50.104365] cpuidle_enter+0x38/0x50
    [ 50.107933] do_idle.llvm.13790858479135427060+0x1a4/0x294
    [ 50.113410] cpu_startup_entry+0x24/0x28
    [ 50.117327] kernel_init+0x0/0x2ac
    [ 50.120723] start_kernel+0x0/0x41c
    [ 50.124211] start_kernel+0x3a4/0x41c
    [ 50.127865] ---[ end trace b7a14580e01cd817 ]---
    [ 50.136267] synaptics_rmi4_sensor_report: spontaneous reset detected
    [ 50.139705] imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot!
    [ 50.149756] reboot: Restarting system with command 'bootloader'

    Reported-by: Jindong Yue
    Signed-off-by: Haibo Chen

    Haibo Chen
     
  • Export the OF table, report the OF module alias, to enable the
    module autoloading.

    Signed-off-by: Haibo Chen
    Acked-by: Fugang Duan

    Haibo Chen
     
  • On the imx8 MIPI DSI oled board, MIPI panel and touch share one RST
    pin. when suspend the whole system, touch will suspend first, it
    disable touch irq, and let touch work in sleep mode. Then MIPI panel
    suspend, it will give a reset signal on the RST pin. Due to this reset
    signal, touch will trigger two interrupt on GPIO1_9. Because touch
    suspend code already disable touch irq, so these two new touch interrupt
    will be pending there, and pending there in GPIO forever.

    When system resume, GPIO will restore registers in runtime resume before
    synaptics_dsx_i2c touch driver resume, so the GPIO1_9 IRQ will be unmasked
    and since its IRQ is pending there so IRQ keeps coming without touch
    driver to handle it, since it is NOT resume yet, make the system can't
    resueme back normally.

    Due to this is the hardware limitation which cause this issue, I format this
    patch to workaround this issue.
    This patch free touch irq in the touch driver suspend procedure, rather than
    just disable the touch irq.

    Reviewed-by: Fugang Duan
    Signed-off-by: Haibo Chen
    (cherry picked from commit a157605b47e2c3800d706b3ca0af24e26c92c187)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • On imx8mscale-evk baord, if I2C bus is configed pull-up, then once send
    the i2c command to clear touch interrupt during the touch initialization,
    touch will keep SDA line in low level, block the i2c bus. If config the
    I2C bus pull-down, then this issue gone. Due to it is not reasonable to
    set the I2c bus to pull-down for other i2c slave device, this patch work
    as a workaround, just remove this i2c command, do not clear the touch
    interrupt, test that touch can also work well after the initialization.

    Signed-off-by: Haibo Chen
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • Add S3508 touch driver support.

    Signed-off-by: Haibo Chen
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • add focaltech touch screen support

    Signed-off-by: Gao Pan

    Gao Pan
     
  • Upstream dropped the call to i2c_set_client_data as "unneeded" in commit
    8300445cc7c1 ("Input: touchscreen - drop calls to platform_set_drvdata and i2c_set_clientdata")

    The client_data pointer is used on suspend/resume by downstream commit
    76a621ae711b ("MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO")

    This causes suspend/resume to crash (and apparently hang) on
    imx6qdl-sabresd with LVDS display connected. Fix by adding back the
    i2c_set_clientdata call.

    Fixes: 76a621ae711b ("MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO")

    This could be squashed into MLK-17779

    Signed-off-by: Leonard Crestez
    Acked-by: Fugang Duan
    Signed-off-by: Vipul Kumar

    Leonard Crestez
     
  • If GPIO is connected to an IRQ then it should not request it as
    GPIO function only when free its IRQ resource.

    Tested-by: Haibo Chen
    Signed-off-by: Fugang Duan
    Signed-off-by: Anson Huang
    Signed-off-by: Robin Gong
    Signed-off-by: Vipul Kumar

    Fugang Duan
     
  • For HannStar (HSD100PXN1 Rev: 1-A00C11 F/W:0634) LVDS touch screen,
    it has a special request for the EETI touch controller. The host
    needs to trigger I2C event to device FW at booting first, and then
    the FW can switch to I2C interface. Otherwise, the FW can’t work
    with I2C interface, and can't generate any interrupt when touch
    the screen.

    This patch send an I2C command before the device wake up, make sure
    the device switch to I2C interface first.

    Signed-off-by: Haibo Chen
    Reviewed-by: Andy Duan
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • Add the support for a CT36X based touchscreens using
    the CT36X controller and i2c touchscreen interface.

    Signed-off-by: Alejandro Lozano
    Signed-off-by: Juan Gutierrez
    Signed-off-by: Alejandro Sierra
    (Vipul: Fixed merge conflicts)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Alejandro Lozano
     
  • For the touch pressure_max, if dts has no property "ti,pressure-max"
    or this property is config to value 0, then default use 65535 as
    the max pressure value. otherwise, in the latest xwayland rootfs,
    will meet the following issue:

    [21:44:34.302] input device 'ADS7846 Touchscreen', /dev/input/event3 is tagged by udev as: Touchscreen
    [21:44:34.302] kernel bug: Device 'ADS7846 Touchscreen' has min == max on ABS_PRESSURE
    [21:44:34.302] input device 'ADS7846 Touchscreen', /dev/input/event3 was rejected.
    [21:44:34.302] failed to create input device '/dev/input/event3'

    Reviewed-by: Fugang Duan
    Signed-off-by: Haibo Chen
    (cherry picked from commit 0bb15e676cb74739291c9054411a28cad4e36f34)
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • Add return value check after calling .of_property_read_u32().
    The issue was reported by coverity.

    Signed-off-by: Haibo Chen

    Haibo Chen
     
  • Add elan touch screen driver in linux kernel.

    Signed-off-by: Haibo Chen
    (cherry picked from commit 20180719c54760359d78544d55e4ac1fabaf6e8b)
    (Vipul: Fixed merge conflicts)
    TODO: checkpatch warnings
    Signed-off-by: Vipul Kumar

    Haibo Chen
     
  • We need add DCM mode/AUX mode for ADC converter function of max11801, so
    that it can be used to read voltage of battery. Meanwhile, let the driver
    based on device tree. The patchset is based on below patch (V3.5.7):

    commit 4001774cf51f0140ae7e4e8e0ec1d86475790682
    Author: Rong Dian
    Date: Fri Jan 18 14:24:28 2013 +0800

    Engr00240284-1 MAX11801: Add DCM aux adc sample function

    1.Add direct conversion mode operations
    2.Add aux adc sample function

    Signed-off-by: Robin Gong
    Signed-off-by: Vipul Kumar

    Robin Gong