28 Aug, 2018

1 commit


12 Jul, 2018

1 commit

  • Since commit eca0f13c836a ("extcon: int3496: Ignore incorrect
    IoRestriction for ID pin"), the driver doesn't use GPIOF_* flags
    anymore. We can thus now drop the deprecated include file for GPIO and
    use the new one.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Chanwoo Choi

    Wolfram Sang
     

21 Mar, 2018

1 commit

  • The commit

    70216fd937fe ("extcon: int3496: Set the id pin to direction-input if necessary")

    introduced a workaround for incorrect IoRestriction mode in ACPI table.

    Now, when GPIO ACPI library does it in generic way, see the commit

    1b2ca32ab0b8 ("gpiolib: acpi: Introduce NO_RESTRICTION quirk")

    for the details, just set an appropriate quirk flag instead.

    Reviewed-by: Hans de Goede
    Tested-by: Hans de Goede
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Chanwoo Choi

    Andy Shevchenko
     

14 Feb, 2018

1 commit

  • Some other drivers may be waiting for our extcon to show-up, exiting their
    probe methods with -EPROBE_DEFER until we show up.

    These drivers will typically get the cable state directly after getting
    the extcon, this commit changes the int3496 code to wait for the initial
    processing of the id-pin to complete before exiting probe() with 0, which
    will cause devices waiting on the defered probe to get reprobed.

    This fixes a race where the initial work might still be running while other
    drivers were already calling extcon_get_state().

    Fixes: 2f556bdb9f2e ("extcon: int3496: Add Intel INT3496 ACPI ... driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Chanwoo Choi

    Hans de Goede
     

23 Oct, 2017

1 commit

  • The extcon has two type of extcon devices as following.
    - 'extcon provider deivce' adds new extcon device and detect the
    state/properties of external connector. Also, it notifies the
    state/properties to the extcon consumer device.
    - 'extcon consumer device' gets the change state/properties
    from extcon provider device.
    Prior to that, include/linux/extcon.h contains all exported API for
    both provider and consumer device driver. To clarify the meaning of
    header file and to remove the wrong use-case on consumer device,
    this patch separates into extcon.h and extcon-provider.h.

    [Description for include/linux/{extcon.h|extcon-provider.h}]
    - extcon.h includes the extcon API and data structure for extcon consumer
    device driver. This header file contains the following APIs:
    : Register/unregister the notifier to catch the change of extcon device
    : Get the extcon device instance
    : Get the extcon device name
    : Get the state of each external connector
    : Get the property value of each external connector
    : Get the property capability of each external connector

    - extcon-provider.h includes the extcon API and data structure for extcon
    provider device driver. This header file contains the following APIs:
    : Include 'include/linux/extcon.h'
    : Allocate the memory for extcon device instance
    : Register/unregister extcon device
    : Set the state of each external connector
    : Set the property value of each external connector
    : Set the property capability of each external connector

    Signed-off-by: Chanwoo Choi
    Acked-by: Sebastian Reichel
    Acked-by: Chen-Yu Tsai
    Acked-by: Charles Keepax
    Acked-by: Lee Jones
    Acked-by: Felipe Balbi
    Acked-by: Yoshihiro Shimoda
    Acked-by: Kishon Vijay Abraham I

    Chanwoo Choi
     

16 Jul, 2017

1 commit

  • acpi_device_id are not supposed to change at runtime. All functions
    working with acpi_device_id provided by work with
    const acpi_device_id. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    1733 352 0 2085 825 drivers/extcon/extcon-intel-int3496.o

    File size After adding 'const':
    text data bss dec hex filename
    1797 272 0 2069 815 drivers/extcon/extcon-intel-int3496.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: Chanwoo Choi

    Arvind Yadav
     

12 Jun, 2017

1 commit


22 Mar, 2017

4 commits

  • With the new more strict ACPI gpio code the dsdt's IoRestriction
    flags are honored on gpiod_get, but in some dsdt's it is wrong,
    so explicitly call gpiod_direction_input on the id gpio if
    necessary.

    This fixes the following errors when the int3496 code is used
    together with the new more strict ACPI gpio code:

    [ 2382.484415] gpio gpiochip1: (INT33FF:01): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ
    [ 2382.484425] gpio gpiochip1: (INT33FF:01): unable to lock HW IRQ 3 for IRQ
    [ 2382.484429] genirq: Failed to request resources for INT3496:00 (irq 174) on irqchip chv-gpio
    [ 2382.484518] intel-int3496 INT3496:00: can't request IRQ for USB ID GPIO: -22
    [ 2382.500359] intel-int3496: probe of INT3496:00 failed with error -22

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Chanwoo Choi

    Hans de Goede
     
  • Now that we've an acpi mapping table we should be using gpiod_get
    instead of gpiod_get_index.

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Chanwoo Choi

    Hans de Goede
     
  • In order to make GPIO ACPI library stricter prepare users of
    gpiod_get_index() to correctly behave when there no mapping is
    provided by firmware.

    Here we add explicit mapping between _CRS GpioIo() resources and
    their names used in the driver.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Chanwoo Choi

    Andy Shevchenko
     
  • Update GPIO pin names in extcon-intel-int3496.c driver to follow
    the existing extcon binding.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Chanwoo Choi

    Andy Shevchenko
     

13 Mar, 2017

1 commit


09 Jan, 2017

1 commit

  • Add an extcon driver for USB OTG ports controlled by an Intel INT3496
    ACPI device (e.g. Baytrail, Cherrytrail devices).

    Signed-off-by: David Cohen
    [hdgoede@redhat.com: Port to current kernel, cleanup, submit upstream]
    [hdgoede@redhat.com: Add Documentation/extcon/intel-int3496.txt]
    Signed-off-by: Hans de Goede
    Signed-off-by: Chanwoo Choi

    David Cohen