13 Sep, 2016

1 commit

  • These structures are only used to copy into other structures, so declare
    them as const.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct gpio_chip i@p = { ... };

    @ok@
    identifier r.i;
    expression e;
    position p;
    @@
    e = i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct gpio_chip e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct gpio_chip i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Joachim Eastwood
    Signed-off-by: Linus Walleij

    Julia Lawall
     

04 Jul, 2016

1 commit

  • This fixes the issue descirbe in bug 117531
    (https://bugzilla.kernel.org/show_bug.cgi?id=117531).
    It's a regression introduced in linux 4.5 that causes a Oops at load of
    gpio_sch and prevents powering off the computer.

    The issue is that sch_gpio_reg_set is called in sch_gpio_probe before
    gpio_chip data is initialized with the pointer to the sch_gpio struct. As
    sch_gpio_reg_set calls gpiochip_get_data, it returns NULL which causes
    the Oops.

    The patch follows Mika's advice (https://lkml.org/lkml/2016/5/9/61) and
    consists in modifying sch_gpio_reg_get and sch_gpio_reg_set to take a
    sch_gpio struct directly instead of a gpio_chip, which avoids the call to
    gpiochip_get_data.

    Thanks Mika for your patience with me :-)

    Cc: stable@vger.kernel.org
    Signed-off-by: Colin Pitrat
    Acked-by: Alexandre Courbot
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Colin Pitrat
     

23 Feb, 2016

1 commit


05 Jan, 2016

1 commit


19 Nov, 2015

1 commit

  • The name .dev in a struct is normally reserved for a struct device
    that is let us say a superclass to the thing described by the struct.
    struct gpio_chip stands out by confusingly using a struct device *dev
    to point to the parent device (such as a platform_device) that
    represents the hardware. As we want to give gpio_chip:s real devices,
    this is not working. We need to rename this member to parent.

    This was done by two coccinelle scripts, I guess it is possible to
    combine them into one, but I don't know such stuff. They look like
    this:

    @@
    struct gpio_chip *var;
    @@
    -var->dev
    +var->parent

    and:

    @@
    struct gpio_chip var;
    @@
    -var.dev
    +var.parent

    and:

    @@
    struct bgpio_chip *var;
    @@
    -var->gc.dev
    +var->gc.parent

    Plus a few instances of bgpio that I couldn't figure out how
    to teach Coccinelle to rewrite.

    This patch hits all over the place, but I *strongly* prefer this
    solution to any piecemal approaches that just exercise patch
    mechanics all over the place. It mainly hits drivers/gpio and
    drivers/pinctrl which is my own backyard anyway.

    Cc: Haavard Skinnemoen
    Cc: Rafał Miłecki
    Cc: Richard Purdie
    Cc: Mauro Carvalho Chehab
    Cc: Alek Du
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Dmitry Torokhov
    Acked-by: Greg Kroah-Hartman
    Acked-by: Lee Jones
    Acked-by: Jiri Kosina
    Acked-by: Hans-Christian Egtvedt
    Acked-by: Jacek Anaszewski
    Signed-off-by: Linus Walleij

    Linus Walleij
     

29 Jan, 2015

1 commit


16 Jan, 2015

1 commit

  • Intel Quark X1000 provides a total of 16 GPIOs. The GPIOs are split between
    the legacy I/O bridge and the GPIO controller.

    GPIO-SCH is the GPIO pins on legacy bridge for Intel Quark SoC.
    Intel Quark X1000 has 2 GPIOs powered by the core power well and 6 from
    the suspend power well.

    This piece of work is derived from Dan O'Donovan's initial work for Quark
    X1000 enabling.

    Signed-off-by: Chang Rebecca Swee Fun
    Reviewed-by: Mika Westerberg
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Chang Rebecca Swee Fun
     

15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

05 Nov, 2014

1 commit

  • This is actually a single device with two sets of identical registers,
    which just happen to start from a different offset. Instead of having
    separate GPIO chips created we consolidate them to be single GPIO chip.

    In addition having a single GPIO chip allows us to handle ACPI GPIO
    translation in the core in a more generic way, since the two GPIO chips
    share the same parent ACPI device.

    Signed-off-by: Mika Westerberg
    Acked-by: Linus Walleij
    Acked-by: Grant Likely
    Signed-off-by: Rafael J. Wysocki

    Mika Westerberg
     

20 Oct, 2014

1 commit


22 Jul, 2014

1 commit


29 Apr, 2014

1 commit

  • According to the datasheet, writing to the level register has no effect
    when GPIO is programmed as input. Actually the the level register is
    read-only when configured as input. Thus presetting the output level
    before switching to output is _NOT_ possible. Any writes are lost!
    Hence we set the level after configuring the GPIO as output.
    But we cannot prevent a short low pulse if direction is set to high and
    an external pull-up is connected.

    Signed-off-by: Daniel Krueger
    Signed-off-by: Alexander Stein
    Signed-off-by: Linus Walleij

    Daniel Krueger
     

21 May, 2013

1 commit


27 Mar, 2013

2 commits


29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Acked-by: Linus Walleij
    Cc: Peter Tyser
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Cc: Peter Tyser
    Cc: Santosh Shilimkar
    Cc: Kevin Hilman
    Acked-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Cc: Peter Tyser
    Acked-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

05 Aug, 2012

1 commit


23 May, 2012

1 commit


02 Jan, 2012

1 commit


07 Jun, 2011

1 commit

  • Sort the gpio makefile and enforce the naming convention gpio-*.c for
    gpio drivers.

    v2: cleaned up filenames in Kconfig and comment blocks
    v3: fixup use of BASIC_MMIO to GENERIC_GPIO for mxc

    Signed-off-by: Grant Likely

    Grant Likely