worlickwerx / pi-parport

retro parallel port for raspberry pi
GNU General Public License v2.0
65 stars 11 forks source link

optimize frob_control operation #5

Closed garlick closed 7 years ago

garlick commented 7 years ago

The parport_gpio_frob_control() op callback has two problems

1) it returns the original value of the control register. Need to verify that's what it's supposed to do or if it matters (does anyone read the result?) Some drivers do what we're doing, others return new control register value. 2) we read and write all four lines unconditionally, but presumably the main use case is to frob one line at a time; for the GPIO implementation, we probably should only frob bits present in the mask argument