I encountered some strange behavior with kernel 5.0.19 on the Beagleboard-xm.
If if I put the pin muxing to enable spidev inside the omap3-beagle-xm.dts DT the camera sensor (Aptina MT9P031) cannot capture all the 12 bits but only 9 (the maximum value for a white color is 511, all 9 bits to 1).
I cannot understand how this is possible but put inside comment the following muxing th camera is able to capture 12bit frames:
spi3_pins: pinmux_spi3_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE1) /* sdmmc2_clk.mcspi3_clk gpio_130 */
OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_cmd.mcspi3_simo gpio_131 */
OMAP3_CORE1_IOPAD(0x212c, PIN_INPUT_PULLUP | MUX_MODE1) /* sdmmc2_dat0.mcspi3_somi gpio_132 */
OMAP3_CORE1_IOPAD(0x2130, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat2.mcspi3_cs1 gpio_134 */
OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat3.mcspi3_cs0 gpio_135 */
// >;
};
spi4_pins: pinmux_spi4_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT | MUX_MODE1) /* mcbsp1_clkr.mcspi4_clk gpio_156 */
OMAP3_CORE1_IOPAD(0x2160, PIN_OUTPUT | MUX_MODE1) /* mcbsp1_dx.mcspi4_simo gpio_158 */
OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE1) /* mcbsp1_dr.mcspi4_somi gpio_159 */
OMAP3_CORE1_IOPAD(0x2166, PIN_OUTPUT | MUX_MODE1) /* mcbsp1_fsx.mcspi4_cs0 gpio_161 */
>;
};
I’ve also put inside comment the following:
&mcspi3 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_pins>;
status = "okay";
spidev0: spi@0 {
compatible = "spidev";
reg = <0>;
spi-max-frequency = <48000000>;
};
spidev1: spi@1 {
compatible = "spidev";
reg = <1>;
spi-max-frequency = <48000000>;
};
};
&mcspi4 {
pinctrl-names = "default";
pinctrl-0 = <&spi4_pins>;
status = "okay";
spidev2: spi@0 {
compatible = "spidev";
reg = <0>;
spi-max-frequency = <48000000>;
};
};