1. 31 8月, 2018 1 次提交
  2. 24 8月, 2018 1 次提交
  3. 09 8月, 2018 1 次提交
  4. 05 8月, 2018 1 次提交
  5. 21 7月, 2018 1 次提交
    • P
      i2c: smbus: add unlocked __i2c_smbus_xfer variant · eef5ba1a
      Peter Rosin 提交于
      Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer,
      then adds a new i2c_smbus_xfer function that simply grabs the lock while
      calling the unlocked variant.
      
      This is not perfectly equivalent, since i2c_smbus_xfer was callable from
      atomic/irq context if you happened to end up emulating SMBus with an I2C
      transfer, and that is no longer the case with this patch. It is unknown
      (to me) if anything depends on that quirk, but it seems fragile enough to
      simply break those cases and require them to call i2c_transfer directly
      instead.
      
      While at it, for consistency rename the 2nd to last argument (size) of
      the i2c_smbus_xfer declaration to protocol and remove the surplus extern
      marker.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      eef5ba1a
  6. 17 7月, 2018 2 次提交
  7. 13 7月, 2018 1 次提交
    • P
      i2c: remove i2c_lock_adapter and use i2c_lock_bus directly · 3f3a89e1
      Peter Rosin 提交于
      The i2c_lock_adapter name is ambiguous since it is unclear if it
      refers to the root adapter or the adapter you name in the argument.
      The natural interpretation is the adapter you name in the argument,
      but there are historical reasons for that not being the case; it
      in fact locks the root adapter. Just remove the function and force
      users to spell out the I2C_LOCK_ROOT_ADAPTER name to indicate what
      is really going on. Also remove i2c_unlock_adapter, of course.
      
      This patch was generated with
      
      git grep -l 'i2c_\(un\)\?lock_adapter' \
      | xargs sed -i 's/i2c_\(un\)\?lock_adapter(\([^)]*\))/'\
      'i2c_\1lock_bus(\2, I2C_LOCK_ROOT_ADAPTER)/g'
      
      followed by white-space touch-up.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Acked-by: NJonathan Cameron <jonathan.cameron@huawei.com>
      Tested-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      3f3a89e1
  8. 04 7月, 2018 1 次提交
    • P
      i2c: smbus: add unlocked __i2c_smbus_xfer variant · 63453b59
      Peter Rosin 提交于
      Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer,
      then adds a new i2c_smbus_xfer function that simply grabs the lock while
      calling the unlocked variant.
      
      This is not perfectly equivalent, since i2c_smbus_xfer was callable from
      atomic/irq context if you happened to end up emulating SMBus with an I2C
      transfer, and that is no longer the case with this patch. It is unknown
      (to me) if anything depends on that quirk, but it seems fragile enough to
      simply break those cases and require them to call i2c_transfer directly
      instead.
      
      While at it, for consistency rename the 2nd to last argument (size) of
      the i2c_smbus_xfer declaration to protocol and remove the surplus extern
      marker.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      63453b59
  9. 22 5月, 2018 1 次提交
    • B
      i2c: Export of_i2c_get_board_info() · da0086d0
      Boris Brezillon 提交于
      I3C busses have to know about all I2C devices connected on the I3C bus
      to properly initialize the I3C master, and I2C frames can't be sent on
      the bus until this initialization is done.
      
      We can't let the I2C core parse the DT and instantiate I2C devices as
      part of its i2c_add_adapter() procedure because, when done this way,
      I2C devices are directly registered to the device-model and might be
      attached to drivers which could in turn start sending frames on the bus,
      which won't work since, as said above, the bus is not yet initialized.
      
      Export of_i2c_register_device() in order to let the I3C core parse the
      I2C device nodes by itself and initialize the bus.
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      da0086d0
  10. 15 5月, 2018 1 次提交
  11. 06 3月, 2018 1 次提交
  12. 16 1月, 2018 3 次提交
  13. 04 12月, 2017 3 次提交
  14. 28 11月, 2017 3 次提交
  15. 27 10月, 2017 1 次提交
    • H
      i2c: Allow overriding dev_name through board_info · 728fe6ce
      Hans de Goede 提交于
      For devices not instantiated through ACPI the i2c-client's device-name
      gets set to <busnr>-<addr> by default, e.g. "0-0022" this means that
      the device-name is dependent on the order in which the i2c-busses are
      enumerated.
      
      In some cases having a predictable constant device-name is desirable,
      for example on non device-tree platforms the link between a regulator
      and its consumers is specified by the platform code by setting
      regulator_init_data.consumers. This array identifies the regulator's
      consumers by dev_name and supply(-name). Which requires a constant
      dev_name.
      
      This commit adds a dev_name field to i2c_board_info allowing
      platform code to set a contstant dev_name so that the device can
      be identified by its dev_name in other platform code.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: Mark Brown <broonie@kernel.org> (live at ELCE17)
      Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (live at ELCE17)
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      728fe6ce
  16. 31 7月, 2017 1 次提交
  17. 09 7月, 2017 1 次提交
  18. 17 4月, 2017 2 次提交
    • H
      i2c: core: Allow drivers to disable i2c-core irq mapping · d1d84bb9
      Hans de Goede 提交于
      By default the i2c-core will try to get an irq with index 0 on ACPI / of
      instantiated devices. This is troublesome on some ACPI systems where the
      irq info at index 0 in the CRS table may contain nonsense and/or point
      to an irqchip for which there is no Linux driver.
      
      If this happens then before this commit the driver's probe method would
      never get called because i2c_device_probe will try to get an irq by
      calling acpi_dev_gpio_irq_get which will always return -EPROBE in this
      case, as it waits for a matching irqchip driver to load. Thus causing
      the driver to not get a chance to bind.
      
      This commit adds a new disable_i2c_core_irq_mapping flag to struct
      i2c_driver which a driver can set to tell the core to skip irq mapping.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      d1d84bb9
    • H
      i2c: core: Add new i2c_acpi_new_device helper function · 605f8fc2
      Hans de Goede 提交于
      By default the i2c subsys creates an i2c-client for the first I2cSerialBus
      resource of an acpi_device, but some acpi_devices have multiple
      I2cSerialBus resources and we may want to instantiate i2c-clients for
      the others.
      
      This commit adds a new i2c_acpi_new_device function which can be used to
      create an i2c-client for any I2cSerialBus resource of an acpi_device.
      
      Note that the other resources may even be on a different i2c bus, so just
      retrieving the client address is not enough.
      
      Here is an example DSDT excerpt from such a device:
      
      Device (WIDR)
      {
          Name (_HID, "INT33FE" /* XPOWER Battery Device */)
          Name (_CID, "INT33FE" /* XPOWER Battery Device */)
          Name (_DDN, "WC PMIC Battery Device")
      <snip>
          Name (RBUF, ResourceTemplate ()
          {
              I2cSerialBusV2 (0x005E, ControllerInitiated, 0x000186A0,
                  AddressingMode7Bit, "\\_SB.PCI0.I2C7",
                  0x00, ResourceConsumer, , Exclusive,
                  )
              I2cSerialBusV2 (0x0036, ControllerInitiated, 0x000186A0,
                  AddressingMode7Bit, "\\_SB.PCI0.I2C1",
                  0x00, ResourceConsumer, , Exclusive,
                  )
              I2cSerialBusV2 (0x0022, ControllerInitiated, 0x00061A80,
                  AddressingMode7Bit, "\\_SB.PCI0.I2C1",
                  0x00, ResourceConsumer, , Exclusive,
                  )
              I2cSerialBusV2 (0x0054, ControllerInitiated, 0x00061A80,
                  AddressingMode7Bit, "\\_SB.PCI0.I2C1",
                  0x00, ResourceConsumer, , Exclusive,
                  )
              GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000,
                  "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, ,
                  )
                  {   // Pin list
              0x0012
                  }
              GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000,
                  "\\_SB.GPO1", 0x00, ResourceConsumer, ,
                  )
                  {   // Pin list
              0x0005
                  }
              GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000,
                  "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, ,
                  )
                  {   // Pin list
              0x0013
                  }
          })
          Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
          {
              Return (RBUF) /* \_SB_.PCI0.I2C7.WIDR.RBUF */
          }
      <snip>
      }
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      605f8fc2
  19. 02 4月, 2017 2 次提交
  20. 02 3月, 2017 1 次提交
  21. 08 2月, 2017 1 次提交
  22. 29 1月, 2017 1 次提交
  23. 13 1月, 2017 1 次提交
  24. 24 11月, 2016 1 次提交
    • B
      i2c: use an IRQ to report Host Notify events, not alert · 4d5538f5
      Benjamin Tissoires 提交于
      The current SMBus Host Notify implementation relies on .alert() to
      relay its notifications. However, the use cases where SMBus Host
      Notify is needed currently is to signal data ready on touchpads.
      
      This is closer to an IRQ than a custom API through .alert().
      Given that the 2 touchpad manufacturers (Synaptics and Elan) that
      use SMBus Host Notify don't put any data in the SMBus payload, the
      concept actually matches one to one.
      
      Benefits are multiple:
      - simpler code and API: the client will just have an IRQ, and
        nothing needs to be added in the adapter beside internally
        enabling it.
      - no more specific workqueue, the threading is handled by IRQ core
        directly (when required)
      - no more races when removing the device (the drivers are already
        required to disable irq on remove)
      - simpler handling for drivers: use plain regular IRQs
      - no more dependency on i2c-smbus for i2c-i801 (and any other adapter)
      - the IRQ domain is created automatically when the adapter exports
        the Host Notify capability
      - the IRQ are assign only if ACPI, OF and the caller did not assign
        one already
      - the domain is automatically destroyed on remove
      - fewer lines of code (minus 20, yeah!)
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      4d5538f5
  25. 17 11月, 2016 3 次提交
  26. 24 9月, 2016 1 次提交
  27. 31 8月, 2016 1 次提交
  28. 26 8月, 2016 2 次提交
    • J
      i2c: core: Add function for finding the bus speed from ACPI, take 2 · 5853b22d
      Jarkko Nikula 提交于
      ACPI 5 specification doesn't have property for the I2C bus speed but
      I2cSerialBus resource descriptor which define each controller-slave
      connection define the maximum speed supported by that connection.
      
      Thus finding the maximum safe speed for the bus is to walk through all
      I2cSerialBus resources that are associated to I2C controller and use the
      speed of slowest connection.
      
      Add function i2c_acpi_find_bus_speed() to the i2c-core that adapter
      drivers can call prior registering itself to core.
      
      This implies two-step walk through the I2cSerialBus resources: call to
      i2c_acpi_find_bus_speed() does the first scan and finds the safe bus
      speed that adapter drivers can set up. Adapter driver registration does
      the second scan when i2c-core creates the I2C slaves by calling the
      i2c_acpi_register_devices(). In that way the bus speed is set in case
      slave device probe gets called during registration and does communication.
      
      Previous version commit 55d38d06 ("i2c: core: Add function for finding
      the bus speed from ACPI") got reverted due merge conflicts from
      commit 525e6fab ("i2c / ACPI: add support for ACPI reconfigure
      notifications").
      
      This version is a bit bigger than previous version but is still sharing
      the lowest and complicated part of I2cSerialBus lookup routines with the
      existing code.
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      5853b22d
    • P
      i2c: add i2c_trylock_bus wrapper, use it · fb79e09a
      Peter Rosin 提交于
      This unifies usage with i2c_lock_bus and i2c_unlock_bus, and paves the
      way for the next patch which looks a bit saner with this preparatory
      work taken care of beforehand.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      fb79e09a