summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-thunderx-pcidrv.c
AgeCommit message (Collapse)Author
2017-11-02i2c: thunderx: Remove duplicate NULL checkAndy Shevchenko
Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-10-28i2c: i2c-smbus: Use threaded irq for smbalertPhil Reid
Prior to this commit the smbalert_irq was handling in the hard irq context. This change switch to using a thread irq which avoids the need for the work thread. Using threaded irq also removes the need for the edge_triggered flag as the enabling / disabling of the hard irq for level triggered interrupts will be handled by the irq core. Without this change have an irq connected to something like an i2c gpio resulted in a null ptr deferences. Specifically handle_nested_irq calls the threaded irq handler. There are currently 3 in tree drivers affected by this change. i2c-parport driver calls i2c_handle_smbus_alert in a hard irq context. This driver use edge trigger interrupts which skip the enable / disable calls. But it still need to handle the smbus transaction on a thread. So the work thread is kept for this driver. i2c-parport-light & i2c-thunderx-pcidrv provide the irq number in the setup which will result in the thread irq being used. i2c-parport-light is edge trigger so the enable / disable call was skipped as well. i2c-thunderx-pcidrv is getting the edge / level trigger setting from of data and was setting the flag as required. However the irq core should handle this automatically. Signed-off-by: Phil Reid <preid@electromag.com.au> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-08-29i2c: busses: make i2c_adapter constBhumika Goyal
Make these const as they are only used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: David Daney <david.daney@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-04-21i2c: thunderx: Enable HWMON class probingJan Glauber
Set I2C_CLASS_HWMON to enable automatic probing of BMC devices by the ipmi-ssif driver. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-03-23i2c: thunderx: ACPI support for clock settingsJan Glauber
Add support for reading the system clock and the TWSI clock frequency from ACPI DSDT. TWSI clock was already covered by using device_property_read(). Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-02-23i2c: thunderx: Replace pci_enable_msix()Jan Glauber
Using pci_alloc_irq_vectors() instead of the deprecated pci_enable_msix() allows to remove the msix_entry from struct octeon_i2c and thus to get rid of the config symbol check. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-08-26i2c: octeon,thunderx: Move register offsets to structJan Glauber
The register offsets are different between Octeon and ThunderX so move them into the algorithm struct and get rid of the define. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-08-26i2c: thunderx: Add SMBUS alert supportJan Glauber
Add SMBUS alert interrupt support. For now only device tree is supported for specifying the alert. In case of ACPI an error is returned. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-08-26i2c: thunderx: Add i2c driver for ThunderX SOCJan Glauber
The ThunderX SOC uses the same i2c block as the Octeon SOC. The main difference is that on ThunderX the device is a PCI device so device probing is done via PCI, interrupts are MSI-X. The clock rates can be set via device tree or ACPI. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>