Re: ofw/fdt: obstacle on pretty dev/fdt/X_fdt.c attachment glue for the common (ie. i2c) drivers
On Fri, May 04, 2018 at 08:08:15PM +0200, Mark Kettenis wrote: > > Date: Fri, 4 May 2018 20:56:07 +0300 > > From: Artturi Alm > > > > Hi, > > > > currently, I don't see how it is possible to write generic > > i2c-parent-controller-independent attachment glue in dev/fdt/, > > ie. for drivers in dev/i2c. The usual way how they are written with > > doesn't work as the devices in dev/i2c attach "at i2c" already. > > > > visa@ just commited something in the direction i wish you would > > continue, and that would be adding "needs-flag" to > > > > dev/ofw/files.ofw: > > 3: file dev/ofw/fdt.c fdt > > -> > > 3: file dev/ofw/fdt.c fdt needs-flag > > > > which would allow writing cleaner glue with less pollution, imo.. > > > > I have some examples, if this isn't totally out of the question, > > of which i think most wanted might be for maxrtc(4), as many boards > > come with lacking RTC/battery and maxrtc(4) is a cheap&easy fix for it. > > You completely fail to explain what the problem is. There are several > i2c drivers for RTC chips in the tree that work on armv7 and/or arm64 > and they are completely fdt-agnostic. See for example > dev/i2c/isl1208.c. Oh, I have totally missed isl1208.c and the way it does _match(), just what i was missing, this is great. Thank you, and sorry for the noise:) -Artturi
Re: ofw/fdt: obstacle on pretty dev/fdt/X_fdt.c attachment glue for the common (ie. i2c) drivers
> Date: Fri, 4 May 2018 20:56:07 +0300 > From: Artturi Alm > > Hi, > > currently, I don't see how it is possible to write generic > i2c-parent-controller-independent attachment glue in dev/fdt/, > ie. for drivers in dev/i2c. The usual way how they are written with > doesn't work as the devices in dev/i2c attach "at i2c" already. > > visa@ just commited something in the direction i wish you would > continue, and that would be adding "needs-flag" to > > dev/ofw/files.ofw: > 3: file dev/ofw/fdt.c fdt > -> > 3: file dev/ofw/fdt.c fdt needs-flag > > which would allow writing cleaner glue with less pollution, imo.. > > I have some examples, if this isn't totally out of the question, > of which i think most wanted might be for maxrtc(4), as many boards > come with lacking RTC/battery and maxrtc(4) is a cheap&easy fix for it. You completely fail to explain what the problem is. There are several i2c drivers for RTC chips in the tree that work on armv7 and/or arm64 and they are completely fdt-agnostic. See for example dev/i2c/isl1208.c.
ofw/fdt: obstacle on pretty dev/fdt/X_fdt.c attachment glue for the common (ie. i2c) drivers
Hi, currently, I don't see how it is possible to write generic i2c-parent-controller-independent attachment glue in dev/fdt/, ie. for drivers in dev/i2c. The usual way how they are written with doesn't work as the devices in dev/i2c attach "at i2c" already. visa@ just commited something in the direction i wish you would continue, and that would be adding "needs-flag" to dev/ofw/files.ofw: 3: file dev/ofw/fdt.c fdt -> 3: file dev/ofw/fdt.c fdt needs-flag which would allow writing cleaner glue with less pollution, imo.. I have some examples, if this isn't totally out of the question, of which i think most wanted might be for maxrtc(4), as many boards come with lacking RTC/battery and maxrtc(4) is a cheap&easy fix for it. -Artturi