18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * CIMaX SP2/HF CI driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2014 Olli Salonen <olli.salonen@iki.fi> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef SP2_PRIV_H 98c2ecf20Sopenharmony_ci#define SP2_PRIV_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include "sp2.h" 128c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* state struct */ 158c2ecf20Sopenharmony_cistruct sp2 { 168c2ecf20Sopenharmony_ci int status; 178c2ecf20Sopenharmony_ci struct i2c_client *client; 188c2ecf20Sopenharmony_ci struct dvb_adapter *dvb_adap; 198c2ecf20Sopenharmony_ci struct dvb_ca_en50221 ca; 208c2ecf20Sopenharmony_ci int module_access_type; 218c2ecf20Sopenharmony_ci unsigned long next_status_checked_time; 228c2ecf20Sopenharmony_ci void *priv; 238c2ecf20Sopenharmony_ci void *ci_control; 248c2ecf20Sopenharmony_ci}; 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#define SP2_CI_ATTR_ACS 0x00 278c2ecf20Sopenharmony_ci#define SP2_CI_IO_ACS 0x04 288c2ecf20Sopenharmony_ci#define SP2_CI_WR 0 298c2ecf20Sopenharmony_ci#define SP2_CI_RD 1 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* Module control register (0x00 module A, 0x09 module B) bits */ 328c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_DET 0x01 338c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_AUTO 0x02 348c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_ACS0 0x04 358c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_ACS1 0x08 368c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_HAD 0x10 378c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_TSIEN 0x20 388c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_TSOEN 0x40 398c2ecf20Sopenharmony_ci#define SP2_MOD_CTL_RST 0x80 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#endif 42