/* make a connection between the input 'i' and the output 'o'
with gain 'g' (note: i = 6 means 'mute') */ staticint tea6420_s_routing(struct v4l2_subdev *sd,
u32 i, u32 o, u32 config)
{ struct i2c_client *client = v4l2_get_subdevdata(sd); int g = (o >> 4) & 0xf;
u8 byte; int ret;
o &= 0xf;
v4l2_dbg(1, debug, sd, "i=%d, o=%d, g=%d\n", i, o, g);
/* check if the parameters are valid */ if (i < 1 || i > 6 || o < 1 || o > 4 || g < 0 || g > 6 || g % 2 != 0) return -EINVAL;
byte = ((o - 1) << 5);
byte |= (i - 1);
/* to understand this, have a look at the tea6420-specs (p.5) */ switch (g) { case0:
byte |= (3 << 3); break; case2:
byte |= (2 << 3); break; case4:
byte |= (1 << 3); break; case6: break;
}
ret = i2c_smbus_write_byte(client, byte); if (ret) {
v4l2_dbg(1, debug, sd, "i2c_smbus_write_byte() failed, ret:%d\n", ret); return -EIO;
} return0;
}
/* set initial values: set "mute"-input to all outputs at gain 0 */
err = 0; for (i = 1; i < 5; i++)
err += tea6420_s_routing(sd, 6, i, 0); if (err) {
v4l_dbg(1, debug, client, "could not initialize tea6420\n"); return -ENODEV;
} return0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.