Page MenuHomeFreeBSD

D31103.id91956.diff
No OneTemporary

D31103.id91956.diff

Index: sys/dev/iicbus/syr827.c
===================================================================
--- sys/dev/iicbus/syr827.c
+++ sys/dev/iicbus/syr827.c
@@ -64,8 +64,14 @@
#define ID2 0x4
#define ID2_DIE_REV_MASK 0xF
+enum syrtype {
+ SYR827 = 1,
+ SYR828,
+};
+
static struct ofw_compat_data compat_data[] = {
- { "silergy,syr827", 1 },
+ { "silergy,syr827", SYR827 },
+ { "silergy,syr828", SYR828 },
{ NULL, 0 }
};
@@ -241,13 +247,23 @@
static int
syr827_probe(device_t dev)
{
+ int type;
+
if (!ofw_bus_status_okay(dev))
return (ENXIO);
- if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
+ type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+ switch (type) {
+ case SYR827:
+ device_set_desc(dev, "Silergy SYR827 regulator");
+ break;
+ case SYR828:
+ device_set_desc(dev, "Silergy SYR828 regulator");
+ break;
+ case 0:
+ default:
return (ENXIO);
-
- device_set_desc(dev, "Silergy SYR827 regulator");
+ }
return (BUS_PROBE_DEFAULT);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 10:52 AM (12 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14696338
Default Alt Text
D31103.id91956.diff (1010 B)

Event Timeline