• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include "mipi_csi_if.h"
10 #include "mipi_csi_core.h"
11 
12 #define HDF_LOG_TAG mipi_csi_if
13 
MipiCsiOpen(uint8_t id)14 DevHandle MipiCsiOpen(uint8_t id)
15 {
16     return (DevHandle)MipiCsiCntlrGet(id);
17 }
18 
MipiCsiClose(DevHandle handle)19 void MipiCsiClose(DevHandle handle)
20 {
21     MipiCsiCntlrPut((struct MipiCsiCntlr *)handle);
22 }
23 
MipiCsiSetComboDevAttr(DevHandle handle,ComboDevAttr * pAttr)24 int32_t MipiCsiSetComboDevAttr(DevHandle handle, ComboDevAttr *pAttr)
25 {
26     return MipiCsiCntlrSetComboDevAttr((struct MipiCsiCntlr *)handle, pAttr);
27 }
28 
MipiCsiSetPhyCmvmode(DevHandle handle,uint8_t devno,PhyCmvMode cmvMode)29 int32_t MipiCsiSetPhyCmvmode(DevHandle handle, uint8_t devno, PhyCmvMode cmvMode)
30 {
31     return MipiCsiCntlrSetPhyCmvmode((struct MipiCsiCntlr *)handle, devno, cmvMode);
32 }
33 
MipiCsiSetExtDataType(DevHandle handle,ExtDataType * dataType)34 int32_t MipiCsiSetExtDataType(DevHandle handle, ExtDataType* dataType)
35 {
36     return MipiCsiCntlrSetExtDataType((struct MipiCsiCntlr *)handle, dataType);
37 }
38 
MipiCsiSetHsMode(DevHandle handle,LaneDivideMode laneDivideMode)39 int32_t MipiCsiSetHsMode(DevHandle handle, LaneDivideMode laneDivideMode)
40 {
41     return MipiCsiCntlrSetHsMode((struct MipiCsiCntlr *)handle, laneDivideMode);
42 }
43 
MipiCsiEnableClock(DevHandle handle,uint8_t comboDev)44 int32_t MipiCsiEnableClock(DevHandle handle, uint8_t comboDev)
45 {
46     return MipiCsiCntlrEnableClock((struct MipiCsiCntlr *)handle, comboDev);
47 }
48 
MipiCsiDisableClock(DevHandle handle,uint8_t comboDev)49 int32_t MipiCsiDisableClock(DevHandle handle, uint8_t comboDev)
50 {
51     return MipiCsiCntlrDisableClock((struct MipiCsiCntlr *)handle, comboDev);
52 }
53 
MipiCsiResetRx(DevHandle handle,uint8_t comboDev)54 int32_t MipiCsiResetRx(DevHandle handle, uint8_t comboDev)
55 {
56     return MipiCsiCntlrResetRx((struct MipiCsiCntlr *)handle, comboDev);
57 }
58 
MipiCsiUnresetRx(DevHandle handle,uint8_t comboDev)59 int32_t MipiCsiUnresetRx(DevHandle handle, uint8_t comboDev)
60 {
61     return MipiCsiCntlrUnresetRx((struct MipiCsiCntlr *)handle, comboDev);
62 }
63 
MipiCsiEnableSensorClock(DevHandle handle,uint8_t snsClkSource)64 int32_t MipiCsiEnableSensorClock(DevHandle handle, uint8_t snsClkSource)
65 {
66     return MipiCsiCntlrEnableSensorClock((struct MipiCsiCntlr *)handle, snsClkSource);
67 }
68 
MipiCsiDisableSensorClock(DevHandle handle,uint8_t snsClkSource)69 int32_t MipiCsiDisableSensorClock(DevHandle handle, uint8_t snsClkSource)
70 {
71     return MipiCsiCntlrDisableSensorClock((struct MipiCsiCntlr *)handle, snsClkSource);
72 }
73 
MipiCsiResetSensor(DevHandle handle,uint8_t snsResetSource)74 int32_t MipiCsiResetSensor(DevHandle handle, uint8_t snsResetSource)
75 {
76     return MipiCsiCntlrResetSensor((struct MipiCsiCntlr *)handle, snsResetSource);
77 }
78 
MipiCsiUnresetSensor(DevHandle handle,uint8_t snsResetSource)79 int32_t MipiCsiUnresetSensor(DevHandle handle, uint8_t snsResetSource)
80 {
81     return MipiCsiCntlrUnresetSensor((struct MipiCsiCntlr *)handle, snsResetSource);
82 }
83 
MipiCsiSetDrvData(DevHandle handle,void * drvData)84 int32_t MipiCsiSetDrvData(DevHandle handle, void *drvData)
85 {
86     return MipiCsiCntlrSetDrvData((struct MipiCsiCntlr *)handle, drvData);
87 }
88