Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 358f8c26 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull i2c fixes from Wolfram Sang:
 "The main thing is to allow empty id_tables for ACPI to make some
  drivers get probed again. It looks a bit bigger than usual because it
  needs some internal renaming, too.

  Other than that, there is a fix for broken DSTDs, a super simple
  enablement for ARM MPS, and two documentation fixes which I'd like to
  see in v4.13 already"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: rephrase explanation of I2C_CLASS_DEPRECATED
  i2c: allow i2c-versatile for ARM MPS platforms
  i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
  i2c: designware: Print clock freq on invalid clock freq error
  i2c: core: Allow empty id_table in ACPI case as well
  i2c: mux: pinctrl: mention correct module name in Kconfig help text
parents 31cf92f3 9c800349
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -983,7 +983,7 @@ config I2C_UNIPHIER_F

config I2C_VERSATILE
	tristate "ARM Versatile/Realview I2C bus support"
	depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS || COMPILE_TEST
	depends on ARCH_MPS2 || ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS || COMPILE_TEST
	select I2C_ALGOBIT
	help
	  Say yes if you want to support the I2C serial bus on ARMs Versatile
+5 −1
Original line number Diff line number Diff line
@@ -298,6 +298,9 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
	}

	acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
	/* Some broken DSTDs use 1MiHz instead of 1MHz */
	if (acpi_speed == 1048576)
		acpi_speed = 1000000;
	/*
	 * Find bus speed from the "clock-frequency" device property, ACPI
	 * or by using fast mode if neither is set.
@@ -319,7 +322,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
	if (dev->clk_freq != 100000 && dev->clk_freq != 400000
	    && dev->clk_freq != 1000000 && dev->clk_freq != 3400000) {
		dev_err(&pdev->dev,
			"Only 100kHz, 400kHz, 1MHz and 3.4MHz supported");
			"%d Hz is unsupported, only 100kHz, 400kHz, 1MHz and 3.4MHz are supported\n",
			dev->clk_freq);
		ret = -EINVAL;
		goto exit_reset;
	}
+15 −4
Original line number Diff line number Diff line
@@ -230,6 +230,16 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap)
		dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
}

const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
		      struct i2c_client *client)
{
	if (!(client && matches))
		return NULL;

	return acpi_match_device(matches, &client->dev);
}

static acpi_status i2c_acpi_lookup_speed(acpi_handle handle, u32 level,
					   void *data, void **return_value)
{
@@ -289,7 +299,7 @@ u32 i2c_acpi_find_bus_speed(struct device *dev)
}
EXPORT_SYMBOL_GPL(i2c_acpi_find_bus_speed);

static int i2c_acpi_match_adapter(struct device *dev, void *data)
static int i2c_acpi_find_match_adapter(struct device *dev, void *data)
{
	struct i2c_adapter *adapter = i2c_verify_adapter(dev);

@@ -299,7 +309,7 @@ static int i2c_acpi_match_adapter(struct device *dev, void *data)
	return ACPI_HANDLE(dev) == (acpi_handle)data;
}

static int i2c_acpi_match_device(struct device *dev, void *data)
static int i2c_acpi_find_match_device(struct device *dev, void *data)
{
	return ACPI_COMPANION(dev) == data;
}
@@ -309,7 +319,7 @@ static struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
	struct device *dev;

	dev = bus_find_device(&i2c_bus_type, NULL, handle,
			      i2c_acpi_match_adapter);
			      i2c_acpi_find_match_adapter);
	return dev ? i2c_verify_adapter(dev) : NULL;
}

@@ -317,7 +327,8 @@ static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)
{
	struct device *dev;

	dev = bus_find_device(&i2c_bus_type, NULL, adev, i2c_acpi_match_device);
	dev = bus_find_device(&i2c_bus_type, NULL, adev,
			      i2c_acpi_find_match_device);
	return dev ? i2c_verify_client(dev) : NULL;
}

+1 −0
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@ static int i2c_device_probe(struct device *dev)
	 * Tree match table entry is supplied for the probing device.
	 */
	if (!driver->id_table &&
	    !i2c_acpi_match_device(dev->driver->acpi_match_table, client) &&
	    !i2c_of_match_device(dev->driver->of_match_table, client))
		return -ENODEV;

+9 −0
Original line number Diff line number Diff line
@@ -31,9 +31,18 @@ int i2c_check_addr_validity(unsigned addr, unsigned short flags);
int i2c_check_7bit_addr_validity_strict(unsigned short addr);

#ifdef CONFIG_ACPI
const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
		      struct i2c_client *client);
void i2c_acpi_register_devices(struct i2c_adapter *adap);
#else /* CONFIG_ACPI */
static inline void i2c_acpi_register_devices(struct i2c_adapter *adap) { }
static inline const struct acpi_device_id *
i2c_acpi_match_device(const struct acpi_device_id *matches,
		      struct i2c_client *client)
{
	return NULL;
}
#endif /* CONFIG_ACPI */
extern struct notifier_block i2c_acpi_notifier;

Loading