13 Aug, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Acked-by: Rob Herring
    Signed-off-by: Lee Jones

    Alexander A. Klimov
     

11 Nov, 2019

1 commit

  • It is possible that platform_get_resource() might return NULL and
    therefore code needs to check for this condition before
    de-referencing the pointer.

    Therefore move the de-referencing of 'res' pointer after
    devm_ioremap_resource() which would have checked the validity of the
    pointer.

    Reported-by: Dan Murphy
    Signed-off-by: Vignesh Raghavendra
    Signed-off-by: Lee Jones

    Vignesh Raghavendra
     

03 Dec, 2018

1 commit


09 Oct, 2018

2 commits


27 Jul, 2018

1 commit

  • Use devm_elk_get() to let Linux manage struct clk memory to avoid the following
    memory leakage report:

    unreferenced object 0xdd75efc0 (size 64):
    comm "systemd-udevd", pid 186, jiffies 4294945126 (age 1195.750s)
    hex dump (first 32 bytes):
    61 64 63 5f 74 73 63 5f 66 63 6b 00 00 00 00 00 adc_tsc_fck.....
    00 00 00 00 92 03 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc+0x40/0x74
    [] __kmalloc_track_caller+0x198/0x388
    [] kstrdup+0x40/0x5c
    [] kstrdup_const+0x30/0x3c
    [] __clk_create_clk+0x60/0xac
    [] clk_get_sys+0x74/0x144
    [] clk_get+0x5c/0x68
    [] ti_tscadc_probe+0x260/0x468 [ti_am335x_tscadc]
    [] platform_drv_probe+0x60/0xac
    [] driver_probe_device+0x214/0x2dc
    [] __driver_attach+0x94/0xc0
    [] bus_for_each_dev+0x90/0xa0
    [] driver_attach+0x28/0x30
    [] bus_add_driver+0x184/0x1ec
    [] driver_register+0xb0/0xf0
    [] __platform_driver_register+0x40/0x54

    Signed-off-by: Zumeng Chen
    Signed-off-by: Lee Jones

    Zumeng Chen
     

16 May, 2018

1 commit


08 Jan, 2018

1 commit

  • Node is being initialized a value that is never read, it is
    being written over a few statements into the function with
    the return value from call to of_get_child_by_name. Hence
    this initialization can be removed. Cleans up clang warning:

    drivers/mfd/ti_am335x_tscadc.c:127:22: warning: Value stored
    to 'node' during its initialization is never read

    Signed-off-by: Colin Ian King
    Signed-off-by: Lee Jones

    Colin Ian King
     

06 Nov, 2016

1 commit


29 Jun, 2016

5 commits


04 Mar, 2015

1 commit

  • In one shot mode, sequencer automatically disables all enabled steps at
    the end of each cycle. (both ADC steps and TSC steps) Hence these steps
    need not be saved in reg_se_cache for clearing these steps at a later
    stage.
    Also, when ADC wakes up Sequencer should not be busy executing any of the
    config steps except for the charge step. Previously charge step was 1 ADC
    clock cycle and hence it was ignored.
    TSC steps are always disabled at the end of each conversion cycle, hence
    there is no need to explicitly disable TSC steps by writing 0 to REG_SE.

    Signed-off-by: Vignesh R
    Signed-off-by: Lee Jones

    Vignesh R
     

20 Oct, 2014

1 commit


26 Sep, 2014

3 commits

  • The logic in AFE_Pen_Ctrl bitmask in the CTRL register is different for five
    wire versus four or eight wire touschscreens. This patch should fix this for
    five-wire touch screens. There should be no change needed here for four and
    eight wire tousch screens.

    Signed-off-by: Jeff Lance
    [bigeasy: keep the change mfd only]
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Lee Jones

    Jeff Lance
     
  • In the resume path, the ADC invokes am335x_tsc_se_set_cache() with 0 as
    the steps argument if continous mode is not in use. This in turn disables
    all steps and so the TSC is not working until one ADC sampling is
    performed.

    This patch fixes it by writing the current cached mask instead of the
    passed steps.

    Fixes: 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADCA
    synchronization")
    Cc: stable@vger.kernel.org # v3.13+
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • After enabling and disabling ADC continuous mode via sysfs, ts_print_raw
    fails to return any data. This is because when ADC is configured for
    continuous mode, it disables touch screen steps.These steps are not
    re-enabled when ADC continuous mode is disabled. Therefore existing values
    of REG_SE needs to be cached before enabling continuous mode and
    disabling touch screen steps and enabling ADC steps. The cached value
    are to be restored to REG_SE once ADC is disabled.

    Fixes: 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization")

    Cc: stable@vger.kernel.org # v3.13+
    Signed-off-by: Vignesh R
    Signed-off-by: Lee Jones

    Vignesh R
     

19 Mar, 2014

2 commits


07 Jan, 2014

4 commits

  • The ADC driver always programs all possible ADC values and discards
    them except for the value IIO asked for. On the am335x-evm the driver
    programs four values and it takes 500us to gather them. Reducing the number
    of conversations down to the (required) one also reduces the busy loop down
    to 125us.

    This leads to another error, namely the FIFOCOUNT register is sometimes
    (like one out of 10 attempts) not updated in time leading to EBUSY.
    The next read has the FIFOCOUNT register updated.
    Checking for the ADCSTAT register for being idle isn't a good choice either.
    The problem is that if TSC is used at the same time, the HW completes the
    conversation for ADC *and* before the driver noticed it, the HW begins to
    perform a TSC conversation and so the driver never seen the HW idle. The
    next time we would have two values in the FIFO but since the driver reads
    everything we always see the current one.
    So instead of polling for the IDLE bit in ADCStatus register, we should
    check the FIFOCOUNT register. It should be one instead of zero because we
    request one value.

    This change in turn leads to another error. Sometimes if TSC & ADC are
    used together the TSC starts generating interrupts even if nobody
    actually touched the touchscreen. The interrupts seem valid because TSC's
    FIFO is filled with values for each channel of the TSC. This condition stops
    after a few ADC reads but will occur again. Not good.

    On top of this (even without the changes I just mentioned) there is a ADC
    & TSC lockup condition which was reported to me by Jeff Lance including the
    following test case:
    A busy loop of "cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw"
    and a mug on touch screen. With this setup, the hardware will lockup after
    something between 20 minutes and it could take up to a couple of hours.
    During that lockup, the ADCSTAT register says 0x30 (or 0x70) which means
    STEP_ID = IDLE and FSM_BUSY = yes. That means the hardware says that it is
    idle and busy at the same time which is an invalid condition.

    For all this reasons I decided to rework this TSC/ADC part and add a
    handshake / synchronization here:
    First the ADC signals that it needs the HW and writes a 0 mask into the
    SE register. The HW (if active) will complete the current conversation
    and become idle. The TSC driver will gather the values from the FIFO
    (woken up by an interrupt) and won't "enable" another conversation.
    Instead it will wake up the ADC driver which is already waiting. The ADC
    driver will start "its" conversation and once it is done, it will
    enable the TSC steps so the TSC will work again.

    After this rework I haven't observed the lockup so far. Plus the busy
    loop has been reduced from 500us to 125us.

    The continues-read mode remains unchanged.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • The update of the SE register in MFD doesn't look right as it has
    nothing to do with it. The better place to do it is in TSC driver (which
    is already doing it) and in the ADC driver which needs this only in the
    continues mode.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • The purpose of reg_se_cache has been defeated. It should avoid the
    read-back of the register to avoid the latency and the fact that the
    bits are reset to 0 after the individual conversation took place.

    The reason why this is required like this to work, is that read-back of
    the register removes the bits of the ADC so they do not start another
    conversation after the register is re-written from the TSC side for the
    update.
    To avoid the not required read-back I introduce a "set once" variant which
    does not update the cache mask. After the conversation completes, the
    bit is removed from the SE register anyway and we don't plan a new
    conversation "any time soon". The current set function is renamed to
    set_cache to distinguish the two operations.
    This is a small preparation for a larger sync-rework.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Dmitry Torokhov
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • Since the "recent" changes, am335x_tsc_se_update() has no longer any
    users outside of this file so make it local.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     

23 Oct, 2013

3 commits


15 Aug, 2013

2 commits

  • The reg_cache variable should be updated with current
    steps in the reg_se register. Then the mask should
    apply and clear the register. Previously, the reg_cache
    can be an old redundant value that isn't updated.

    Signed-off-by: Zubair Lutfullah
    Signed-off-by: Lee Jones

    Zubair Lutfullah
     
  • Reg_cache variable is used to lock step enable register
    from being accessed and written by both TSC and ADC
    at the same time.
    However, it isn't updated anywhere in the code at all.

    If both TSC and ADC are used, eventually 1FFFF is always
    written enabling all 16 steps uselessly causing a mess.

    Patch fixes it by correcting the locks and updates the
    variable by reading the step enable register

    Signed-off-by: Zubair Lutfullah
    Signed-off-by: Lee Jones

    Zubair Lutfullah
     

31 Jul, 2013

2 commits

  • AFE Pen Ctrl and TouchScreen transistors enabling is not
    required when only ADC mode is being used, so check for availability of
    TSC driver before accessing control register.

    Signed-off-by: Patil, Rachna
    Acked-by: Vaibhav Hiremath
    Signed-off-by: Zubair Lutfullah
    Signed-off-by: Lee Jones
    Signed-off-by: Samuel Ortiz

    Patil, Rachna
     
  • ADC is ideally expected to work at a frequency of 3MHz.
    The present code had a check, which returned error if the frequency
    went below the threshold value. But since AM335x supports various
    working frequencies, this check is not required.
    Now the code just uses the internal ADC clock divider to set the ADC
    frequency w.r.t the sys clock.

    Signed-off-by: Patil, Rachna
    Signed-off-by: Zubair Lutfullah
    Signed-off-by: Lee Jones
    Signed-off-by: Samuel Ortiz

    Patil, Rachna
     

13 Jun, 2013

8 commits