summaryrefslogtreecommitdiffstats
path: root/hdata/i2c.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-04-24 13:25:00 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-04-24 00:11:50 -0500
commit3a4b4db368125c2ddb1fb4831253fa51d3268152 (patch)
treec16d67ccc6961caccdf7cda1e70ef705c4aa6556 /hdata/i2c.c
parent12514d328159c2cc4215c50d569fb7706d736b09 (diff)
downloadtalos-skiboot-3a4b4db368125c2ddb1fb4831253fa51d3268152.tar.gz
talos-skiboot-3a4b4db368125c2ddb1fb4831253fa51d3268152.zip
hdata/i2c: Replace i2c_ prefix with dev_
The current naming scheme makes it easy to conflate "i2cm_port" and "i2c_port." The latter is used to describe multi-port I2C devices such as GPIO expanders and multi-channel PCIe hotplug controllers. Rename i2c_port to dev_port to make the two a bit more distinct. Also rename i2c_addr to dev_addr for consistency. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hdata/i2c.c')
-rw-r--r--hdata/i2c.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hdata/i2c.c b/hdata/i2c.c
index 6ea34507..c08b53d5 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -31,8 +31,8 @@ struct i2c_dev {
/* i2c slave info */
uint8_t type;
- uint8_t i2c_addr;
- uint8_t i2c_port;
+ uint8_t dev_addr;
+ uint8_t dev_port;
uint8_t __reserved;
__be32 purpose;
@@ -207,7 +207,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
const struct i2c_dev *dev;
const char *label, *name, *compat;
const struct host_i2c_hdr *ahdr;
- uint32_t i2c_addr;
+ uint32_t dev_addr;
uint32_t version;
uint32_t size;
uint32_t purpose;
@@ -280,7 +280,7 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
* justified quantity (i.e it includes the R/W bit). So we need
* to strip it off to get an address linux can use.
*/
- i2c_addr = dev->i2c_addr >> 1;
+ dev_addr = dev->dev_addr >> 1;
purpose = be32_to_cpu(dev->purpose);
type = map_type(dev->type);
@@ -315,18 +315,18 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
*/
if (!type || dev->type == 0xFF)
prlog(PR_WARNING, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n",
- dev->i2cm_engine, dev->i2cm_port, name, i2c_addr,
+ dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
purpose, label);
else
prlog(PR_TRACE, "HDAT I2C: found e%dp%d - %s@%x (%#x:%s)\n",
- dev->i2cm_engine, dev->i2cm_port, name, i2c_addr,
+ dev->i2cm_engine, dev->i2cm_port, name, dev_addr,
purpose, label);
- node = dt_new_addr(bus, name, i2c_addr);
+ node = dt_new_addr(bus, name, dev_addr);
if (!node)
continue;
- dt_add_property_cells(node, "reg", i2c_addr);
+ dt_add_property_cells(node, "reg", dev_addr);
dt_add_property_cells(node, "link-id",
be32_to_cpu(dev->i2c_link));
if (compat)
OpenPOWER on IntegriCloud