Permalink
Commits on Sep 10, 2014
  1. @mthuurne

    PWM: JZ4770: Correct polarity again

    My earlier conclusion (see cb0edde) that the output while disabled is
    the non-initial state was incorrect. For PWM4, the level is the inital
    state when disabled, consistent with the programming manual.
    
    For PWM1, the output at boot is independent of the initial state
    setting. So there is a difference here between TCU1 and TCU2 modes.
    mthuurne committed Sep 10, 2014
  2. @mthuurne

    input: pwm-haptic: Clean up probe and remove function

    Include error codes in error logging.
    
    Use "idev" instead of "haptic->input_dev" where possible.
    
    Do not call input_ff_destroy:
    Calling it when input_ff_create_memless fails is unnecessary because
    the "ff" field hasn't been set in that case.
    Calling it when input_register_device fails is unnecessary because
    the managed destruction of the input_dev will take care of destroying
    the ff_device. I verified this by attaching a "destroy" handler.
    Calling it in pwm_haptic_remove is unnecessary because the managed
    destruction of input_dev will destroy the ff_device as well.
    mthuurne committed Sep 10, 2014
  3. @mthuurne

    input: pwm-haptic: Made platform data optional

    The only remaining field can fall back on a default value, so we can
    deal with missing platform data just fine (unlike before when pwm_id
    was essential).
    mthuurne committed Sep 10, 2014
Commits on Sep 9, 2014
  1. @mthuurne

    input: pwm-haptic: Remove pwm_id from platform data

    In the new PWM API, mapping tables take care of attaching the right PWM
    to the driver. So this field was unused since 85e6083.
    mthuurne committed Sep 9, 2014
  2. @mthuurne

    input: pwm-haptic: Don't set polarity at all

    If the polarity should be set to a non-default value, it likely means
    the motor will be running until it is set. I don't think a hardware
    design would want that to happen, so most likely it would either use
    the default polarity or it would have a power regulator that is kept
    off until the PWM is configured properly. In either case the polarity
    support that was present isn't useful, so I'm removing it.
    
    Platform data is being replaced by Device Tree anyway, so I think it's
    best to put only values in there that we need right now.
    mthuurne committed Sep 9, 2014
  3. @mthuurne

    MIPS: JZ4770: GCW0: Reduce pwm_haptic_platform_data

    Removed pwm_id, which is not used since switching to the new style
    mapping tables.
    
    Removed polarity, which is default (value 0) and will be removed in
    the pwm-haptic driver.
    mthuurne committed Sep 9, 2014
Commits on Sep 8, 2014
  1. @mthuurne

    input: pwm-haptic: Set polarity on probe

    The polarity won't change, so there is no need to set it on every open.
    Also the suspend/resume behavior might be wrong if the polarity is not
    set.
    mthuurne committed Sep 8, 2014
Commits on Sep 6, 2014
  1. @mthuurne

    input: pwm-haptic: Remove inverted duty cycle

    This only existed to work around a bug in the pwm driver we were using.
    mthuurne committed Sep 6, 2014
  2. @mthuurne

    MIPS: JZ4770: GCW0: Correct polarity of backlight PWM

    The backlight is high active (verified using GPIO mode), so it should
    be using normal polarity. The inversed polarity configuration used to
    work because the PWM driver had a bug that flipped polarity, but that
    bug has now been fixed.
    mthuurne committed Sep 6, 2014
  3. @mthuurne

    PWM: JZ4770: Correct polarity

    When disabled, output is the non-initial state. Since normal polarity
    should output 0 when disabled, its initial state must be 1.
    mthuurne committed Sep 6, 2014
  4. @mthuurne
  5. @mthuurne

    MIPS: JZ4770: GCW0: Assign PWM pins to specific drivers

    By assigning them to the backlight and the haptic driver, the pins get
    freed when those drivers are unloaded. Previously the pins were
    assigned to the PWM chip driver.
    mthuurne committed Sep 6, 2014
Commits on Sep 5, 2014
  1. @mthuurne

    fb: JZ4770: Switch to sleep pinctrl state when display is blanked (2)

    This was originally implemented in 8bb7be3, but this time we use
    pinctrl_pm_select_*_state() to do the same thing in far less code.
    mthuurne committed Sep 5, 2014
Commits on Sep 4, 2014
  1. @mthuurne

    input: pwm-haptic: Implement platform remove operation

    The driver is not usable as a module without this.
    mthuurne committed Sep 4, 2014
  2. @mthuurne

    input: pwm-haptic: Use set_bit from bitmap.h

    Since "ffbit" is a bitmap, this would be the right function to use.
    It is also what input_ff_create_memless() uses internally.
    mthuurne committed Sep 4, 2014
Commits on Aug 20, 2014
  1. @pcercuei
  2. @pcercuei
Commits on Aug 14, 2014
  1. @pcercuei

    input: pwm-haptic: Properly configure PWM when opening / closing device

    It was previously incorrectly configuring the PWM, which resulted in the
    haptic device running at full power as soon as the device node was
    opened.
    pcercuei committed Aug 14, 2014
  2. @pcercuei

    fb: JZ4770: Cut the rightmost column of pixels to avoid showing garbage

    If we are upscaling horizontally, the last columns of pixels
    shall be hidden, as they usually contain garbage: the last
    resizing coefficients, when applied to the last column of the
    input frame, instruct the IPU to blend the pixels with the
    ones that correspond to the next column, that is to say the
    leftmost column of pixels of the input frame.
    pcercuei committed Aug 14, 2014
Commits on Aug 9, 2014
  1. @pcercuei

    fb: JZ4770: Fix an issue where x/32 or 32/x ratios were refused

    It was only allowed up to x/31 or 31/x before, but the IPU really
    accepts up to 32 coefficients.
    
    Furthermore, a ratio of e.g. 32/63 is totally possible, as the
    number of coefficients corresponds to the numerator of the ratio.
    Now, the code only verifies that the numerator is inferior or
    equal to 32.
    
    Additionally, the code now makes use of <linux/gcd.h> instead of
    duplicating the functionality in a custom function.
    pcercuei committed Aug 9, 2014
  2. @pcercuei
  3. @aejsmith @mthuurne

    MIPS: O32/32-bit: Fix bug which can cause incorrect system call restarts

    On 32-bit/O32, pt_regs has a padding area at the beginning into which the
    syscall arguments passed via the user stack are copied. 4 arguments
    totalling 16 bytes are copied to offset 16 bytes into this area, however
    the area is only 24 bytes long. This means the last 2 arguments overwrite
    pt_regs->regs[{0,1}].
    
    If a syscall function returns an error, handle_sys stores the original
    syscall number in pt_regs->regs[0] for syscall restart. signal.c checks
    whether regs[0] is non-zero, if it is it will check whether the syscall
    return value is one of the ERESTART* codes to see if it must be
    restarted.
    
    Should a syscall be made that results in a non-zero value being copied
    off the user stack into regs[0], and then returns a positive (non-error)
    value that matches one of the ERESTART* error codes, this can be mistaken
    for requiring a syscall restart.
    
    While the possibility for this to occur has always existed, it is made
    much more likely to occur by commit 46e12c0 ("MIPS: O32 / 32-bit:
    Always copy 4 stack arguments."), since now every syscall will copy 4
    arguments and overwrite regs[0], rather than just those with 7 or 8
    arguments.
    
    Since that commit, booting Debian under a 32-bit MIPS kernel almost
    always results in a hang early in boot, due to a wait4 syscall returning
    a PID that matches one of the ERESTART* codes, which then causes an
    incorrect restart of the syscall.
    
    The problem is fixed by increasing the size of the padding area so that
    arguments copied off the stack will not overwrite pt_regs->regs[{0,1}].
    
    Signed-off-by: Alex Smith <alex.smith@imgtec.com>
    Cc: <stable@vger.kernel.org> # v3.13+
    Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
    Tested-by: Aurelien Jarno <aurelien@aurel32.net>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7454/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    aejsmith committed with mthuurne Jul 23, 2014
Commits on Aug 4, 2014
  1. @pcercuei

    fb: JZ4770: Allow hot-switching the "keep aspect ratio" param at runtime

    This change makes sure that the IPU gets reconfigured as soon as the
    keep_aspect_ratio parameter is written in sysfs.
    
    Note that this commit has a side effect, the sysfs nodes moved in the
    sysfs tree from /sys/module/jz4770-fb/parameters to
    /sys/devices/platform/jz-lcd.0
    
    For consistency, the allow_downscaling parameter moved as well to this
    new directory.
    pcercuei committed Aug 4, 2014
  2. @pcercuei

    input: linkdev: Send key release events when changing key map

    When switching between the regular and the alternative key maps,
    it is required that the input device does not report any of its keys
    as pressed, otherwise the input handlers get confused. To avoid that,
    we send a "key released" event for each of the keys we support, even
    if the key isn't pressed in the first place.
    pcercuei committed Aug 4, 2014
  3. @pcercuei

    input: linkdev: Register driver data once client devices are present

    This fixes a bug where the driver data registered in the probe function
    would be forgotten as soon as the probe function would return -EPROBE_DEFER.
    pcercuei committed Aug 4, 2014
Commits on Jul 31, 2014
  1. @mthuurne
  2. @mthuurne
  3. @mthuurne
  4. @mthuurne

    MIPS: JZ4770: GCW0: Use new PWM mapping API

    This removes the following warning from the boot log:
    pwm-backlight pwm-backlight: unable to request PWM, trying legacy API
    mthuurne committed Jul 31, 2014
Commits on Jul 30, 2014
  1. @mthuurne

    MIPS: JZ4770: GCW0: Document MXC6225 INT GPIO pin and disable pull

    MXC6225 is the g-sensor.
    mthuurne committed Jul 30, 2014
  2. @pcercuei
  3. @pcercuei
Commits on Jul 29, 2014
  1. @mthuurne

    fb: JZ4770: Switch to sleep pinctrl state when display is blanked

    We don't need a signal on the LCD pins when the panel is off.
    mthuurne committed Jul 29, 2014
  2. @mthuurne

    MIPS: JZ4770: GCW0: When the LCD sleeps, select "no_pins" group

    This will disable the actual LCD pins, putting them in pulled-up input
    mode, which we hope saves power over keeping them configured in the LCD
    function.
    mthuurne committed Jul 29, 2014
  3. @mthuurne