xref: /linux/drivers/media/pci/solo6x10/solo6x10-tw28.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
228cae868SHans Verkuil /*
3*cf293a4fSAlexander A. Klimov  * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
428cae868SHans Verkuil  *
528cae868SHans Verkuil  * Original author:
628cae868SHans Verkuil  * Ben Collins <bcollins@ubuntu.com>
728cae868SHans Verkuil  *
828cae868SHans Verkuil  * Additional work by:
928cae868SHans Verkuil  * John Brooks <john.brooks@bluecherry.net>
1028cae868SHans Verkuil  */
1128cae868SHans Verkuil 
1228cae868SHans Verkuil #ifndef __SOLO6X10_TW28_H
1328cae868SHans Verkuil #define __SOLO6X10_TW28_H
1428cae868SHans Verkuil 
1528cae868SHans Verkuil #include "solo6x10.h"
1628cae868SHans Verkuil 
1728cae868SHans Verkuil #define TW_NUM_CHIP				4
1828cae868SHans Verkuil #define TW_BASE_ADDR				0x28
1928cae868SHans Verkuil #define TW_CHIP_OFFSET_ADDR(n)			(TW_BASE_ADDR + (n))
2028cae868SHans Verkuil 
2128cae868SHans Verkuil /* tw2815 */
2228cae868SHans Verkuil #define TW_AV_STAT_ADDR				0x5a
2328cae868SHans Verkuil #define TW_HUE_ADDR(n)				(0x07 | ((n) << 4))
2428cae868SHans Verkuil #define TW_SATURATION_ADDR(n)			(0x08 | ((n) << 4))
2528cae868SHans Verkuil #define TW_CONTRAST_ADDR(n)			(0x09 | ((n) << 4))
2628cae868SHans Verkuil #define TW_BRIGHTNESS_ADDR(n)			(0x0a | ((n) << 4))
2728cae868SHans Verkuil #define TW_AUDIO_OUTPUT_VOL_ADDR		0x70
2828cae868SHans Verkuil #define TW_AUDIO_INPUT_GAIN_ADDR(n)		(0x60 + ((n > 1) ? 1 : 0))
2928cae868SHans Verkuil 
3028cae868SHans Verkuil /* tw286x */
3128cae868SHans Verkuil #define TW286x_AV_STAT_ADDR			0xfd
3228cae868SHans Verkuil #define TW286x_HUE_ADDR(n)			(0x06 | ((n) << 4))
3328cae868SHans Verkuil #define TW286x_SATURATIONU_ADDR(n)		(0x04 | ((n) << 4))
3428cae868SHans Verkuil #define TW286x_SATURATIONV_ADDR(n)		(0x05 | ((n) << 4))
3528cae868SHans Verkuil #define TW286x_CONTRAST_ADDR(n)			(0x02 | ((n) << 4))
3628cae868SHans Verkuil #define TW286x_BRIGHTNESS_ADDR(n)		(0x01 | ((n) << 4))
3728cae868SHans Verkuil #define TW286x_SHARPNESS(n)			(0x03 | ((n) << 4))
3828cae868SHans Verkuil #define TW286x_AUDIO_OUTPUT_VOL_ADDR		0xdf
3928cae868SHans Verkuil #define TW286x_AUDIO_INPUT_GAIN_ADDR(n)		(0xD0 + ((n > 1) ? 1 : 0))
4028cae868SHans Verkuil 
4128cae868SHans Verkuil int solo_tw28_init(struct solo_dev *solo_dev);
4228cae868SHans Verkuil 
4328cae868SHans Verkuil int tw28_set_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 val);
4428cae868SHans Verkuil int tw28_get_ctrl_val(struct solo_dev *solo_dev, u32 ctrl, u8 ch, s32 *val);
4528cae868SHans Verkuil bool tw28_has_sharpness(struct solo_dev *solo_dev, u8 ch);
4628cae868SHans Verkuil 
4728cae868SHans Verkuil u8 tw28_get_audio_gain(struct solo_dev *solo_dev, u8 ch);
4828cae868SHans Verkuil void tw28_set_audio_gain(struct solo_dev *solo_dev, u8 ch, u8 val);
4928cae868SHans Verkuil int tw28_get_video_status(struct solo_dev *solo_dev, u8 ch);
5028cae868SHans Verkuil 
5128cae868SHans Verkuil #if 0
5228cae868SHans Verkuil unsigned int tw2815_get_audio_status(struct SOLO *solo);
5328cae868SHans Verkuil void tw2815_Set_AudioOutVol(struct SOLO *solo, unsigned int u_val);
5428cae868SHans Verkuil #endif
5528cae868SHans Verkuil 
5628cae868SHans Verkuil #endif /* __SOLO6X10_TW28_H */
57