drivers/i2c/generic: Re-factor SSDT generation code
commit1d33488968573888ea1fc386b7ede0bc67e9b32c
authorFurquan Shaikh <furquan@chromium.org>
Fri, 21 Oct 2016 23:24:07 +0000 (21 16:24 -0700)
committerFurquan Shaikh <furquan@google.com>
Mon, 24 Oct 2016 22:13:05 +0000 (25 00:13 +0200)
tree35b910c2474512bdbec272ef645bd3b417bf45e6
parent9b39adb4545bbfdddda333d23400599b7c061126
drivers/i2c/generic: Re-factor SSDT generation code

1. Export i2c_generic_fill_ssdt to allow other device-specific i2c
drivers to share and re-use the same code for generating AML code for
SSDT. In order to achieve this, following changes are required:
 a. Add macro I2C_GENERIC_CONFIG that defines a structure with all
 generic i2c device-tree properties. This macro should be placed by the
 using driver at the start of its config structure.
 b. Accept a callback function to add any device specific information to
 SSDT. If generic driver is used directly by a device, callback would be
 NULL. Other devices using a separate i2c driver can provide a callback
 to add any properties to SSDT.
2. Allow device to provide _CID.

BUG=chrome-os-partner:57846

Change-Id: I3a0054e22b81f9d6d407bef417eae5e9edc04ee4
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17089
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
src/drivers/i2c/generic/chip.h
src/drivers/i2c/generic/generic.c