char drivers don't have attributes, they have a single bidirectional data stream and iocontrol's. the stuff in sysfs is similar to a char driver from the users perspective, except for iocontrol, which is what i think you want.
On Fri, Feb 11, 2011 at 12:18 AM, jon.schell <[email protected]> wrote: > What's the difference between writing a char driver from scratch that > has a single attribute called "brightness" and copying the red led > driver and calling it the shoe led so that it inherits all the led > class attributes (of which there's only one, which is "brightness")? > > On Feb 10, 6:49 pm, Jon Pry <[email protected]> wrote: > > Depending on the pattern of access, you can probably accomplish this with > a > > standard char driver. IOControl's come to mind. More advanced scenarios > > would probably call for a block driver with memory map support. There's > lots > > of stuff out there on writing a simple char driver, and even the most > > trivial usually have some IOControl's implemented. Only trouble with > howto's > > is that they tend to be old and writing simple drivers is actually much > > easier on newer kernel's. Lots of infrastructure for making them in very > few > > lines of code. > > -- > unsubscribe: [email protected] > website: http://groups.google.com/group/android-kernel > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
