There were three fields used in the DT version of probing this driver which were not yet in ACPI so handle those fields as well.
samsung,i2c-sda-delay = <100>; samsung,i2c-max-bus-freq = <20000>; samsung,i2c-slave-addr = <0x66>;
becomes
Method (DLAY, 0x0, NotSerialized) { Return (100) }
Method (SADD, 0x0, NotSerialized) { Return (0x66) }
Method (FREQ, 0x0, NotSerialized) { Return (20000) }
Thanks
Graeme
From: Graeme Gregory graeme.gregory@linaro.org
To bring functionality upto full FDT level read the final three fields read from DT to ACPI. Fields are frequency, slave address, and sda delay.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/i2c/busses/i2c-s3c2410.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 845a2fe..68c2495 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -1143,8 +1143,26 @@ static void s3c24xx_i2c_parse_acpi(struct device *device, struct s3c24xx_i2c *i2c) { struct s3c2410_platform_i2c *pdata = i2c->pdata; + struct acpi_handle *dev_handle = ACPI_HANDLE(device); + acpi_status res; + u64 result;
pdata->bus_num = -1; /* i2c bus number is dynamically assigned */ + + res = acpi_evaluate_integer(dev_handle, "DLAY", NULL, &result); + if (!ACPI_FAILURE(res)) + pdata->sda_delay = result; + + res = acpi_evaluate_integer(dev_handle, "SADD", NULL, &result); + if (!ACPI_FAILURE(res)) + pdata->slave_addr = result; + + res = acpi_evaluate_integer(dev_handle, "FREQ", NULL, &result); + if (!ACPI_FAILURE(res)) + pdata->frequency = result; + + dev_dbg(device, "ACPI delay %d, freq %ld, address %x\n", + pdata->sda_delay, pdata->frequency, pdata->slave_addr); } #else static void
From: Graeme Gregory graeme.gregory@linaro.org
Add the last three fields that were in FDT to the DSDT for i2c device.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl index 165f283..d03b011 100644 --- a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl +++ b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl @@ -36,7 +36,19 @@ DefinitionBlock ( Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {0x58} GpioIo (Exclusive, PullDefault, , , , "\_SB.GPB3") {0x2A, 0x2B} }) - Return (RBUF) + Return (RBUF) + } + + Method (DLAY, 0x0, NotSerialized) { + Return (100) + } + + Method (SADD, 0x0, NotSerialized) { + Return (0x66) + } + + Method (FREQ, 0x0, NotSerialized) { + Return (20000) } } }