blob: a44a03afbd302367542e36ea312d8ef6c732b148 [file] [log] [blame]
Ben Collinsfaa4fd22010-06-17 13:27:26 -04001/*
2 * Copyright (C) 2010 Bluecherry, LLC www.bluecherrydvr.com
3 * Copyright (C) 2010 Ben Collins <bcollins@bluecherry.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010020#ifndef __SOLO6X10_TW28_H
21#define __SOLO6X10_TW28_H
Ben Collinsfaa4fd22010-06-17 13:27:26 -040022
Krzysztof Hałasaae69b222011-02-11 13:36:27 +010023#include "solo6x10.h"
Ben Collinsfaa4fd22010-06-17 13:27:26 -040024
25#define TW_NUM_CHIP 4
26#define TW_BASE_ADDR 0x28
27#define TW_CHIP_OFFSET_ADDR(n) (TW_BASE_ADDR + (n))
28
29/* tw2815 */
30#define TW_AV_STAT_ADDR 0x5a
31#define TW_HUE_ADDR(n) (0x07 | ((n) << 4))
32#define TW_SATURATION_ADDR(n) (0x08 | ((n) << 4))
33#define TW_CONTRAST_ADDR(n) (0x09 | ((n) << 4))
34#define TW_BRIGHTNESS_ADDR(n) (0x0a | ((n) << 4))
35#define TW_AUDIO_OUTPUT_VOL_ADDR 0x70
36#define TW_AUDIO_INPUT_GAIN_ADDR(n) (0x60 + ((n > 1) ? 1 : 0))
37
38/* tw286x */
39#define TW286X_AV_STAT_ADDR 0xfd
40#define TW286x_HUE_ADDR(n) (0x06 | ((n) << 4))
41#define TW286x_SATURATIONU_ADDR(n) (0x04 | ((n) << 4))
42#define TW286x_SATURATIONV_ADDR(n) (0x05 | ((n) << 4))
43#define TW286x_CONTRAST_ADDR(n) (0x02 | ((n) << 4))
44#define TW286x_BRIGHTNESS_ADDR(n) (0x01 | ((n) << 4))
45#define TW286x_SHARPNESS(n) (0x03 | ((n) << 4))
46#define TW286x_AUDIO_OUTPUT_VOL_ADDR 0xdf
47#define TW286x_AUDIO_INPUT_GAIN_ADDR(n) (0xD0 + ((n > 1) ? 1 : 0))
48
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010049int solo_tw28_init(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -040050
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010051int tw28_set_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 val);
52int tw28_get_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 *val);
Ben Collinsfaa4fd22010-06-17 13:27:26 -040053
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010054u8 tw28_get_audio_gain(struct solo_dev *solo_dev, u8 ch);
55void tw28_set_audio_gain(struct solo_dev *solo_dev, u8 ch, u8 val);
56int tw28_get_video_status(struct solo_dev *solo_dev, u8 ch);
Ben Collinsfaa4fd22010-06-17 13:27:26 -040057
58#if 0
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010059unsigned int tw2815_get_audio_status(struct SOLO *solo);
60void tw2815_Set_AudioOutVol(struct SOLO *solo, unsigned int u_val);
Ben Collinsfaa4fd22010-06-17 13:27:26 -040061#endif
62
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010063#endif /* __SOLO6X10_TW28_H */