Hi:
I am trying to modify imx185.c for ar0134,the ar0134 is aptina’s ic.I made ar0134 into monochrome mode,so the ar0134 will output the gray8 data,that means the pixel format is grey,one byte one pixel.
I don’t know how to modify “mode_type” “pixel_phase”,when I modprobe the driver,the log is:
[ 31.409412] ar0134 2-0010: sensor_common_parse_image_props:pixel_t property missing
[ 31.417096] extract_pixel_format: Need to extend formatbayer_rggb8
[ 31.423300] ar0134 2-0010: Unsupported pixel format
[ 31.428198] ar0134 2-0010: Failed to read mode0 image props
[ 31.433797] ar0134 2-0010: Could not initialize sensor properties.
[ 31.440002] ar0134 2-0010: Failed to initialize ar0134.
[ 31.447826] ar0134: probe of 2-0010 failed with error -22
when I followed the code ,I founded V4L2_PIX_FMT_GREY “NOT” supported by tegra’s code:
static int extract_pixel_format(
118 const char *pixel_t, u32 *format)
119 {
120 size_t size = strnlen(pixel_t, OF_MAX_STR_LEN);
121
122 if (strncmp(pixel_t, "bayer_bggr10", size) == 0)
123 *format = V4L2_PIX_FMT_SBGGR10;
124 else if (strncmp(pixel_t, "bayer_rggb10", size) == 0)
125 *format = V4L2_PIX_FMT_SRGGB10;
126 else if (strncmp(pixel_t, "bayer_bggr12", size) == 0)
127 *format = V4L2_PIX_FMT_SBGGR12;
128 else if (strncmp(pixel_t, "bayer_rggb12", size) == 0)
129 *format = V4L2_PIX_FMT_SRGGB12;
130 else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0)
131 *format = V4L2_PIX_FMT_SRGGB12;
132 else if (strncmp(pixel_t, "bayer_wdr_dol_rggb10", size) == 0)
133 *format = V4L2_PIX_FMT_SRGGB10;
134 else if (strncmp(pixel_t, "bayer_xbggr10p", size) == 0)
135 *format = V4L2_PIX_FMT_XBGGR10P;
136 else if (strncmp(pixel_t, "bayer_xrggb10p", size) == 0)
137 *format = V4L2_PIX_FMT_XRGGB10P;
138 else {
139 pr_err("%s: Need to extend format%s\n", __func__, pixel_t);
140 return -EINVAL;
141 }
142
143 return 0;
144 }
so,will nvidia add this support in next version?
the code’s path is:
drivers/media/i2c/imx185.c---->imx185_probe() function----->camera_common_initialize() function----->drivers/media/platform/tegra/camera/camera_common.c camera_common_initialize() function---->sensor_common_sensor_init_properties() function---->sensor_common_parse_image_props() function------>extra_pixel_format() function
the ar0134 uses CON_CSI_A_D0_P, CON_CSI_A_D0_N, CON_CSI_A_D1_P, CON_CSI_A_D1_N.
the tegra186-quill-p3310-1000-a00-00-base.dts is:
#include <t18x-common-platforms/tegra186-quill-common-p3310-1000-a00.dtsi>
#include <t18x-common-platforms/tegra186-quill-power-tree-p3310-1000-a00-00.dtsi>
//#include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi>
#include <t18x-common-modules/tegra186-camera-ar0134-li-mipi-adpt-a00.dtsi>
#include <t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi>
/* comms dtsi file should be included after gpio dtsi file */
#include <t18x-common-platforms/tegra186-quill-comms.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-p3310-1000-a00-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-super-module-e2614-p2597-1000-a00.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi>
#include <t18x-common-prod/tegra186-priv-quill-p3310-1000-a00-prod.dtsi>
//#include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
#include <dt-bindings/linux/driver-info.h>
the tegra186-camera-ar0134-li-mipi-adpt-a00.dtsi is:
i2c@3180000 {
#address-cells = <0x1>;
#size-cells = <0x0>;
#stream-id-cells = <0x1>;
compatible = "nvidia,tegra186-i2c";
reg = <0x0 0x3180000 0x0 0x100>;
interrupts = <0x0 0x1b 0x4>;
scl-gpio = <0x12 0x72 0x0>;
sda-gpio = <0x12 0x73 0x0>;
status = "okay";
clock-frequency = <0x186a0>;
clocks = <0xd 0x4b 0xd 0x10d 0xd 0x5c>;
clock-names = "div-clk", "parent", "slow-clk";
resets = <0xd 0x15>;
reset-names = "i2c";
dmas = <0x19 0x17 0x19 0x17>;
dma-names = "rx", "tx";
linux,phandle = <0x83>;
phandle = <0x83>;
prod-settings {
prod_c_fm {
prod = <0x6c 0xffff0000 0x190000 0x94 0x3f00 0x200>;
};
prod_c_fmplus {
prod = <0x6c 0xffff0000 0x100000 0x94 0x3f00 0x200>;
};
prod_c_hs {
prod = <0x6c 0xffff 0x2 0x9c 0x3f00 0x300>;
};
prod_c_sm {
prod = <0x6c 0xffff0000 0x160000 0x94 0x3f00 0x300>;
};
};
ar0134_a@10 {
compatible = "nvidia,ar0134";
reg = <0x10>;
devnode = "video0";
physical_w = "10.0";
physical_h = "10.0";
sensor_model = "ar0134";
post_crop_frame_drop = [30 00];
use_decibel_gain = "false";
delayed_gain = "false";
use_sensor_mode_id = "true";
clocks = <0xd 0x59 0xd 0x10d>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";
status = "okay";
mode0 {
mclk_khz = "37125";
num_lanes = [34 00];
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = [30 00];
dynamic_pixel_bit_depth = [38 00];
csi_pixel_bit_depth = [38 00];
pixel_t = "bayer_rggb";
mode_type = "bayer";
pixel_phase = "rggb";
active_w = "1000";
active_h = "720";
readout_orientation = [30 00];
line_length = "1280";
inherent_gain = [31 00];
mclk_multiplier = [32 00];
pix_clk_hz = "74250000";
min_gain_val = [30 00];
max_gain_val = "48";
min_hdr_ratio = [31 00];
max_hdr_ratio = [31 00];
min_framerate = "1.5";
max_framerate = "60";
min_exp_time = "30";
max_exp_time = "660000";
embedded_metadata_height = [30 00];
};
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0x0>;
endpoint {
csi-port = <0x0>;
bus-width = <0x2>;
remote-endpoint = <0x1f>;
linux,phandle = <0x9d>;
phandle = <0x9d>;
};
};
};
};
};