[PATCH 06/17] staging: comedi: ni_65xx: remove 'invert_outputs' from boardinfo

Ian Abbott abbotti at mev.co.uk
Mon Jun 23 15:48:14 UTC 2014


On 2014-06-20 19:52, H Hartley Sweeten wrote:
> Im not sure what was intended with this boardinfo.
>
> It appears to be trying to handle the sink/source output type of the
> boards supported by the driver. But, some of the boardinfo does not
> match the actual hardware descriptions in the manual. The manual also
> does not mention anything about the port setting vs. the actual output
> level.
>
> Also, the (*auto_attach) is a bit goofy. If the boardinfo indicates
> to 'invert_outputs' only the first channel of the port is set.
>
> Simplify the driver a bit by just removing this boardinfo. The values
> written to the "ports" will then be what is passed to comedi by the
> user and values returned to the user will be the value in the "ports".
>
> Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
> Cc: Ian Abbott <abbotti at mev.co.uk>
> Cc: Greg Kroah-Hartman <gregk at linuxfoundation.org>

I've been pondering the best way to handle this.  Although the 
'invert_outputs' is wrong, it's been wrong for years and people have 
worked around it in userspace code.  Now suddenly their outputs are no 
longer inverted after updating the kernel.

I was thinking of adding a module parameter to decide whether to honour 
the 'invert_outputs' for those boards that set it, with the default 
being to do the right thing (ignoring the 'invert_outputs' bit).

In any case, the auto_attach ought to set all the outputs to the same 
value to match the internal state.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the devel mailing list