All of lore.kernel.org
 help / color / mirror / Atom feed
* Best option for handling dependencies between sysfs params.
@ 2009-10-17 18:24 Jonathan Cameron
  2009-10-18 11:43 ` Jean Delvare
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2009-10-17 18:24 UTC (permalink / raw)
  To: LKML, Jean Delvare, Zhang Rui

Dear All,

The tsl2561 ambient light sensor has separate controls for integration
time and for gain.

Now, discussions about the tsl2550 driver suggested that range be handled
by an illuminance0_max_range parameter.  In that particular device things
are simple as there is one internal variable effecting the range.

So to try and match interfaces, I'm intending to have the
same illuminance0_max_range and also an integration time parameter.
(avoiding for now the more complex manual option!)

My current approach is to use writes to illuminance0_max_range to store
a 'requested' max gain value.  Thus a later change to the integration time
parameter may well result in the internal gain parameter also changing
in order to meet this desired value.

Reading this parameter will always return the max range value for
the current configuration.

Do people think this is a valid approach?  More or less corresponds to 
'integration time priority' in the language of photography. In effect
it makes the internal gain an automatic parameter rather than integration
time. Could just as easily do the other way round though.

All comments welcome.

Jonathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-18 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-17 18:24 Best option for handling dependencies between sysfs params Jonathan Cameron
2009-10-18 11:43 ` Jean Delvare
2009-10-18 12:32   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.