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/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html