SPRACD8 June 2019 DRA710 , DRA712 , DRA714 , DRA716 , DRA718 , DRA722 , DRA724 , DRA725 , DRA726 , DRA745 , DRA746 , DRA74P , DRA750 , DRA756 , DRA75P , DRA76P , DRA77P , DRA780 , DRA781 , DRA782 , DRA783 , DRA786 , DRA787 , DRA790 , DRA791 , DRA793 , DRA797 , TDA2EG-17 , TDA2HF , TDA2HG , TDA2HV , TDA2LF , TDA2P-ABZ , TDA2P-ACD , TDA2SA , TDA2SG , TDA2SX
Depending on the custom board designs, it is possible that the camera interfaces are multiplexed with other peripheral IO and often controlled via board muxes with GPIOs acting as selection lines. Typical camera drivers are written such that the GPIOs to be controlled are descibed with names in the device tree. For example, reset-gpio=phandle or power-gpio=phandle. This makes sense if the device needs fixed number of GPIOs. These are part of the camera and makes sense to be handled in the camera driver. On the other hand, board muxes are not part of the camera, and the programming changes from each board to the other. The board muxes were set in a generic way by handling a special property called mux-gpios=list of phandles.
The following example demonstrates how the same TVP5158 device connected on different boards can be described such that the generic driver can setup all the board muxes required for that instance.
----------------------------------------------------------------------------
arch/arm/boot/dts/dra7-evm.dts
----------------------------------------------------------------------------
&tvp_5158{
mux-gpios = <&pcf_hdmi 3 GPIO_ACTIVE_HIGH>, /*CAM_FPD_MUX_S0*/
<&pcf_jamr3_21 8 GPIO_ACTIVE_LOW>; /*SEL_TVP_FPD*/
};
----------------------------------------------------------------------------
arch/arm/boot/dts/dra72-evm-revc.dts
----------------------------------------------------------------------------
&tvp_5158{
mux-gpios = <&pcf_hdmi 2 GPIO_ACTIVE_LOW>, /*VIN2_S0*/
<&pcf_jamr3_21 8 GPIO_ACTIVE_LOW>, /*SEL_TVP_FPD*/
<&pcf_hdmi 6 GPIO_ACTIVE_HIGH>; /*VIN2_S2*/
};
----------------------------------------------------------------------------
arch/arm/boot/dts/dra76-evm.dts
----------------------------------------------------------------------------
&tvp_5158{
mux-gpios = <&pcf_jamr3_21 8 GPIO_ACTIVE_LOW>; /*SEL_TVP_FPD*/
};