On Fri, Jul 15, 2016 at 10:03:26AM +0800, qiaozhou wrote: > My case is like this: I got a ARM mali-video driver, which may have several > ports/endpoints, which needs I2C/SPI interface to do some initiation. In the > video driver, it uses device node conf to find matching ports, and calls This sounds like a fairly standard setup, most external HDMI encoders are I2C and SPI controlled, which already works fine as far as I'm aware. > functions, such as of_find_video_tx_by_node -> of_find_i2c_device_by_node. > Now the hardware changes from i2c to spi, so I wonder whether > of_find_spi_device_by_node can be used freely. Otherwise I may need to > modify the mali-video driver, and as it's provided to us and may get updated > from time to time, my change may be conflicted with future versions. > Also I didn't quite understand the way to "use a phandle to connect the two > devices", is there any code/driver which I can take as a reference? I'll > study it. Off the top of my head something like the TDA998x or ADV7511 should be worth looking at here - it just sounds like the the Mali driver may just not be using the frameworks well, you should probably encourage people to get it upstreamed.
Attachment:
signature.asc
Description: PGP signature