summaryrefslogtreecommitdiff
path: root/drivers/stream_input/tv_frontend/dtv_demod/i2c_func.c (plain)
blob: 68b214efc470026bb5aa61e244296583af5f8560
1/*
2* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful, but WITHOUT
10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12* more details.
13*
14* You should have received a copy of the GNU General Public License along
15* with this program; if not, write to the Free Software Foundation, Inc.,
16* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*
18* Description:
19*/
20#include <linux/kernel.h>
21#include <linux/i2c.h>
22#include <linux/delay.h>
23#include <linux/dvb/aml_demod.h>
24#include "demod_func.h"
25
26int am_demod_i2c_xfer(struct aml_demod_i2c *adap, struct i2c_msg msgs[],
27 int num)
28{
29 int ret = 0;
30
31 if (adap->scl_oe) {
32 /* ret = aml_i2c_sw_bit_xfer(adap, msgs, num);*/
33 } else {
34 if (adap->i2c_priv)
35 ret = i2c_transfer((struct i2c_adapter *)adap->i2c_priv,
36 msgs, num);
37 else
38 ;
39 /* printk("i2c error, no valid i2c\n");*/
40 }
41 return ret;
42}
43