Re: Finding 'orphaned' i2c drivers

Jon Smirl
2009-02-23T15:24:52Z

This is the last piece....

static int __devinit dspeak01_fabric_probe(struct of_device *op,
const struct of_device_id *match)
{
const phandle *handle;
struct device_node *clock_node;
unsigned int len;

handle = of_get_property(op->node, "clock-handle", &len);
if (!handle || len < sizeof(handle))
return -ENODEV;

clock_node = of_find_node_by_phandle(*handle);
if (!clock_node)
return -ENODEV;

fabric.clock = of_find_i2c_device_by_node(clock_node);
if (!fabric.clock)
return -ENODEV;

of_snd_soc_register_machine("DSPEAK01", &dspeak01_fabric_ops);
return 0;
}

--
Jon Smirl
jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org