45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef __TDA8425_H__
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __TDA8425_H__
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "xf86i2c.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync I2CDevRec d;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync int mux;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int stereo;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int v_left;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int v_right;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int bass;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int treble;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int src_sel;
45e9809aff7304721fddb95654901b32195c9c7avboxsync Bool mute;
45e9809aff7304721fddb95654901b32195c9c7avboxsync } TDA8425Rec, *TDA8425Ptr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define TDA8425_ADDR_1 0x82
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* the third parameter is meant to force detection of tda8425.
45e9809aff7304721fddb95654901b32195c9c7avboxsync This is because tda8425 is write-only and complete implementation
45e9809aff7304721fddb95654901b32195c9c7avboxsync of I2C protocol is not always available. Besides address there is no good
45e9809aff7304721fddb95654901b32195c9c7avboxsync way to autodetect it so we have to _know_ it is there anyway */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncTDA8425Ptr Detect_tda8425(I2CBusPtr b, I2CSlaveAddr addr,Bool force);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncBool tda8425_init(TDA8425Ptr t);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid tda8425_setaudio(TDA8425Ptr t);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid tda8425_mute(TDA8425Ptr t, Bool mute);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define TDA8425SymbolsList \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "Detect_tda8425", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "tda8425_init", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "tda8425_setaudio", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "tda8425_mute"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_Detect_tda8425 ((TDA8425Ptr (*)(I2CBusPtr, I2CSlaveAddr,Bool))LoaderSymbol("Detect_tda8425"))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_tda8425_init ((Bool (*)(TDA8425Ptr))LoaderSymbol("tda8425_init"))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_tda8425_setaudio ((void (*)(TDA8425Ptr))LoaderSymbol("tda8425_setaudio"))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_tda8425_mute ((void (*)(TDA8425Ptr, Bool))LoaderSymbol("tda8425_mute"))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif