Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
0004  *
0005  * Original author:
0006  * Ben Collins <bcollins@ubuntu.com>
0007  *
0008  * Additional work by:
0009  * John Brooks <john.brooks@bluecherry.net>
0010  */
0011 
0012 #ifndef __SOLO6X10_TW28_H
0013 #define __SOLO6X10_TW28_H
0014 
0015 #include "solo6x10.h"
0016 
0017 #define TW_NUM_CHIP             4
0018 #define TW_BASE_ADDR                0x28
0019 #define TW_CHIP_OFFSET_ADDR(n)          (TW_BASE_ADDR + (n))
0020 
0021 /* tw2815 */
0022 #define TW_AV_STAT_ADDR             0x5a
0023 #define TW_HUE_ADDR(n)              (0x07 | ((n) << 4))
0024 #define TW_SATURATION_ADDR(n)           (0x08 | ((n) << 4))
0025 #define TW_CONTRAST_ADDR(n)         (0x09 | ((n) << 4))
0026 #define TW_BRIGHTNESS_ADDR(n)           (0x0a | ((n) << 4))
0027 #define TW_AUDIO_OUTPUT_VOL_ADDR        0x70
0028 #define TW_AUDIO_INPUT_GAIN_ADDR(n)     (0x60 + ((n > 1) ? 1 : 0))
0029 
0030 /* tw286x */
0031 #define TW286x_AV_STAT_ADDR         0xfd
0032 #define TW286x_HUE_ADDR(n)          (0x06 | ((n) << 4))
0033 #define TW286x_SATURATIONU_ADDR(n)      (0x04 | ((n) << 4))
0034 #define TW286x_SATURATIONV_ADDR(n)      (0x05 | ((n) << 4))
0035 #define TW286x_CONTRAST_ADDR(n)         (0x02 | ((n) << 4))
0036 #define TW286x_BRIGHTNESS_ADDR(n)       (0x01 | ((n) << 4))
0037 #define TW286x_SHARPNESS(n)         (0x03 | ((n) << 4))
0038 #define TW286x_AUDIO_OUTPUT_VOL_ADDR        0xdf
0039 #define TW286x_AUDIO_INPUT_GAIN_ADDR(n)     (0xD0 + ((n > 1) ? 1 : 0))
0040 
0041 int solo_tw28_init(struct solo_dev *solo_dev);
0042 
0043 int tw28_set_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 val);
0044 int tw28_get_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 *val);
0045 bool tw28_has_sharpness(struct solo_dev *solo_dev, u8 ch);
0046 
0047 u8 tw28_get_audio_gain(struct solo_dev *solo_dev, u8 ch);
0048 void tw28_set_audio_gain(struct solo_dev *solo_dev, u8 ch, u8 val);
0049 int tw28_get_video_status(struct solo_dev *solo_dev, u8 ch);
0050 
0051 #if 0
0052 unsigned int tw2815_get_audio_status(struct SOLO *solo);
0053 void tw2815_Set_AudioOutVol(struct SOLO *solo, unsigned int u_val);
0054 #endif
0055 
0056 #endif /* __SOLO6X10_TW28_H */