.. | .. |
---|
89 | 89 | |
---|
90 | 90 | #define IMX258_NUM_SUPPLIES ARRAY_SIZE(imx258_supply_names) |
---|
91 | 91 | |
---|
92 | | -enum imx258_max_pad { |
---|
93 | | - PAD0, |
---|
94 | | - PAD1, |
---|
95 | | - PAD2, |
---|
96 | | - PAD3, |
---|
97 | | - PAD_MAX, |
---|
98 | | -}; |
---|
99 | | - |
---|
100 | 92 | struct regval { |
---|
101 | 93 | u16 addr; |
---|
102 | 94 | u8 val; |
---|
.. | .. |
---|
968 | 960 | struct imx258 *imx258 = to_imx258(sd); |
---|
969 | 961 | const struct imx258_mode *mode = imx258->cur_mode; |
---|
970 | 962 | |
---|
971 | | - mutex_lock(&imx258->mutex); |
---|
972 | 963 | fi->interval = mode->max_fps; |
---|
973 | | - mutex_unlock(&imx258->mutex); |
---|
974 | 964 | |
---|
975 | 965 | return 0; |
---|
976 | 966 | } |
---|
.. | .. |
---|
990 | 980 | if (imx258_module_info[i].id == otp->module_id) |
---|
991 | 981 | break; |
---|
992 | 982 | } |
---|
993 | | - strlcpy(inf->fac.module, imx258_module_info[i].name, |
---|
| 983 | + strscpy(inf->fac.module, imx258_module_info[i].name, |
---|
994 | 984 | sizeof(inf->fac.module)); |
---|
995 | 985 | |
---|
996 | 986 | for (i = 0; i < ARRAY_SIZE(imx258_lens_info) - 1; i++) { |
---|
997 | 987 | if (imx258_lens_info[i].id == otp->lens_id) |
---|
998 | 988 | break; |
---|
999 | 989 | } |
---|
1000 | | - strlcpy(inf->fac.lens, imx258_lens_info[i].name, |
---|
| 990 | + strscpy(inf->fac.lens, imx258_lens_info[i].name, |
---|
1001 | 991 | sizeof(inf->fac.lens)); |
---|
1002 | 992 | } |
---|
1003 | 993 | /* awb */ |
---|
.. | .. |
---|
1042 | 1032 | { |
---|
1043 | 1033 | struct imx258_otp_info *otp = imx258->otp; |
---|
1044 | 1034 | |
---|
1045 | | - strlcpy(inf->base.sensor, IMX258_NAME, sizeof(inf->base.sensor)); |
---|
1046 | | - strlcpy(inf->base.module, |
---|
| 1035 | + strscpy(inf->base.sensor, IMX258_NAME, sizeof(inf->base.sensor)); |
---|
| 1036 | + strscpy(inf->base.module, |
---|
1047 | 1037 | imx258->module_name, |
---|
1048 | 1038 | sizeof(inf->base.module)); |
---|
1049 | | - strlcpy(inf->base.lens, imx258->len_name, sizeof(inf->base.lens)); |
---|
| 1039 | + strscpy(inf->base.lens, imx258->len_name, sizeof(inf->base.lens)); |
---|
1050 | 1040 | if (otp) |
---|
1051 | 1041 | imx258_get_otp(otp, inf); |
---|
1052 | 1042 | } |
---|
.. | .. |
---|
1599 | 1589 | return 0; |
---|
1600 | 1590 | } |
---|
1601 | 1591 | |
---|
1602 | | -static int imx258_g_mbus_config(struct v4l2_subdev *sd, |
---|
| 1592 | +static int imx258_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id, |
---|
1603 | 1593 | struct v4l2_mbus_config *config) |
---|
1604 | 1594 | { |
---|
1605 | 1595 | u32 val = 0; |
---|
.. | .. |
---|
1607 | 1597 | val = 1 << (IMX258_LANES - 1) | |
---|
1608 | 1598 | V4L2_MBUS_CSI2_CHANNEL_0 | |
---|
1609 | 1599 | V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; |
---|
1610 | | - config->type = V4L2_MBUS_CSI2; |
---|
| 1600 | + config->type = V4L2_MBUS_CSI2_DPHY; |
---|
1611 | 1601 | config->flags = val; |
---|
1612 | 1602 | |
---|
1613 | 1603 | return 0; |
---|
.. | .. |
---|
1635 | 1625 | static const struct v4l2_subdev_video_ops imx258_video_ops = { |
---|
1636 | 1626 | .s_stream = imx258_s_stream, |
---|
1637 | 1627 | .g_frame_interval = imx258_g_frame_interval, |
---|
1638 | | - .g_mbus_config = imx258_g_mbus_config, |
---|
1639 | 1628 | }; |
---|
1640 | 1629 | |
---|
1641 | 1630 | static const struct v4l2_subdev_pad_ops imx258_pad_ops = { |
---|
.. | .. |
---|
1644 | 1633 | .enum_frame_interval = imx258_enum_frame_interval, |
---|
1645 | 1634 | .get_fmt = imx258_get_fmt, |
---|
1646 | 1635 | .set_fmt = imx258_set_fmt, |
---|
| 1636 | + .get_mbus_config = imx258_g_mbus_config, |
---|
1647 | 1637 | }; |
---|
1648 | 1638 | |
---|
1649 | 1639 | static const struct v4l2_subdev_ops imx258_subdev_ops = { |
---|