linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Q: FE set_property() and get_property callbacks
@ 2012-07-11 19:25 Antti Palosaari
  0 siblings, 0 replies; only message in thread
From: Antti Palosaari @ 2012-07-11 19:25 UTC (permalink / raw)
  To: linux-media

I was playing with the DVB API LNA support and ended up looking common 
dvb-frontend code.

There is struct dvb_frontend_ops:
int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);

What I can see from the dvb-core comments those are used for validating 
parameters. Why? Naming is very misleading. For me those names sounds 
like setting and getting parameters is something what average coder can 
think.

For example if I wish to set LNA I would like to implement 
set_property() to my driver and expect to catch DTV_LNA	command and 
handle it.

But what now is done is to add new callback "set_lna()" to struct 
dvb_frontend_ops, add new parameter "lna" to struct 
dtv_frontend_properties, cache value here and use new callback to set 
value. Due to that selected implementation it goes complex and "struct 
dvb_frontend_ops" and "struct dtv_frontend_properties" grows all the 
time when new parameter is added.

It looks even more weird as you grep current use of set_property() and 
get_property(). There is only two drivers, stv0288 and stv6110, defining 
those callbacks. And both of those seems to have quite nonsense 
implementation. So whats happening here?

regards
Antti

-- 
http://palosaari.fi/


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-11 19:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11 19:25 Q: FE set_property() and get_property callbacks Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).