Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 1 | /* |
Hans Verkuil | dcae5da | 2013-03-25 05:35:17 -0300 | [diff] [blame] | 2 | * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com> |
| 3 | * |
| 4 | * Original author: |
| 5 | * Ben Collins <bcollins@ubuntu.com> |
| 6 | * |
| 7 | * Additional work by: |
| 8 | * John Brooks <john.brooks@bluecherry.net> |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 19 | */ |
| 20 | |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 21 | #ifndef __SOLO6X10_TW28_H |
| 22 | #define __SOLO6X10_TW28_H |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 23 | |
Krzysztof Hałasa | ae69b22 | 2011-02-11 13:36:27 +0100 | [diff] [blame] | 24 | #include "solo6x10.h" |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 25 | |
| 26 | #define TW_NUM_CHIP 4 |
| 27 | #define TW_BASE_ADDR 0x28 |
| 28 | #define TW_CHIP_OFFSET_ADDR(n) (TW_BASE_ADDR + (n)) |
| 29 | |
| 30 | /* tw2815 */ |
| 31 | #define TW_AV_STAT_ADDR 0x5a |
| 32 | #define TW_HUE_ADDR(n) (0x07 | ((n) << 4)) |
| 33 | #define TW_SATURATION_ADDR(n) (0x08 | ((n) << 4)) |
| 34 | #define TW_CONTRAST_ADDR(n) (0x09 | ((n) << 4)) |
| 35 | #define TW_BRIGHTNESS_ADDR(n) (0x0a | ((n) << 4)) |
| 36 | #define TW_AUDIO_OUTPUT_VOL_ADDR 0x70 |
| 37 | #define TW_AUDIO_INPUT_GAIN_ADDR(n) (0x60 + ((n > 1) ? 1 : 0)) |
| 38 | |
| 39 | /* tw286x */ |
Hans Verkuil | dcae5da | 2013-03-25 05:35:17 -0300 | [diff] [blame] | 40 | #define TW286x_AV_STAT_ADDR 0xfd |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 41 | #define TW286x_HUE_ADDR(n) (0x06 | ((n) << 4)) |
| 42 | #define TW286x_SATURATIONU_ADDR(n) (0x04 | ((n) << 4)) |
| 43 | #define TW286x_SATURATIONV_ADDR(n) (0x05 | ((n) << 4)) |
| 44 | #define TW286x_CONTRAST_ADDR(n) (0x02 | ((n) << 4)) |
| 45 | #define TW286x_BRIGHTNESS_ADDR(n) (0x01 | ((n) << 4)) |
| 46 | #define TW286x_SHARPNESS(n) (0x03 | ((n) << 4)) |
| 47 | #define TW286x_AUDIO_OUTPUT_VOL_ADDR 0xdf |
| 48 | #define TW286x_AUDIO_INPUT_GAIN_ADDR(n) (0xD0 + ((n > 1) ? 1 : 0)) |
| 49 | |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 50 | int solo_tw28_init(struct solo_dev *solo_dev); |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 51 | |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 52 | int tw28_set_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 val); |
| 53 | int tw28_get_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 *val); |
Hans Verkuil | c813bd3 | 2013-03-25 05:38:14 -0300 | [diff] [blame] | 54 | bool tw28_has_sharpness(struct solo_dev *solo_dev, u8 ch); |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 55 | |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 56 | u8 tw28_get_audio_gain(struct solo_dev *solo_dev, u8 ch); |
| 57 | void tw28_set_audio_gain(struct solo_dev *solo_dev, u8 ch, u8 val); |
| 58 | int tw28_get_video_status(struct solo_dev *solo_dev, u8 ch); |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 59 | |
| 60 | #if 0 |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 61 | unsigned int tw2815_get_audio_status(struct SOLO *solo); |
| 62 | void tw2815_Set_AudioOutVol(struct SOLO *solo, unsigned int u_val); |
Ben Collins | faa4fd2 | 2010-06-17 13:27:26 -0400 | [diff] [blame] | 63 | #endif |
| 64 | |
Krzysztof Hałasa | decebab | 2011-02-11 13:38:20 +0100 | [diff] [blame] | 65 | #endif /* __SOLO6X10_TW28_H */ |