.. | .. |
---|
1604 | 1604 | return 0; |
---|
1605 | 1605 | } |
---|
1606 | 1606 | |
---|
1607 | | -static int tc358743_g_mbus_config(struct v4l2_subdev *sd, |
---|
1608 | | - struct v4l2_mbus_config *cfg) |
---|
| 1607 | +static int tc358743_get_mbus_config(struct v4l2_subdev *sd, |
---|
| 1608 | + unsigned int pad, |
---|
| 1609 | + struct v4l2_mbus_config *cfg) |
---|
1609 | 1610 | { |
---|
1610 | 1611 | struct tc358743_state *state = to_state(sd); |
---|
1611 | 1612 | |
---|
1612 | | - cfg->type = V4L2_MBUS_CSI2; |
---|
| 1613 | + cfg->type = V4L2_MBUS_CSI2_DPHY; |
---|
1613 | 1614 | |
---|
1614 | 1615 | /* Support for non-continuous CSI-2 clock is missing in the driver */ |
---|
1615 | 1616 | cfg->flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; |
---|
.. | .. |
---|
1838 | 1839 | .s_dv_timings = tc358743_s_dv_timings, |
---|
1839 | 1840 | .g_dv_timings = tc358743_g_dv_timings, |
---|
1840 | 1841 | .query_dv_timings = tc358743_query_dv_timings, |
---|
1841 | | - .g_mbus_config = tc358743_g_mbus_config, |
---|
1842 | 1842 | .s_stream = tc358743_s_stream, |
---|
1843 | 1843 | }; |
---|
1844 | 1844 | |
---|
.. | .. |
---|
1850 | 1850 | .set_edid = tc358743_s_edid, |
---|
1851 | 1851 | .enum_dv_timings = tc358743_enum_dv_timings, |
---|
1852 | 1852 | .dv_timings_cap = tc358743_dv_timings_cap, |
---|
| 1853 | + .get_mbus_config = tc358743_get_mbus_config, |
---|
1853 | 1854 | }; |
---|
1854 | 1855 | |
---|
1855 | 1856 | static const struct v4l2_subdev_ops tc358743_ops = { |
---|
.. | .. |
---|
1897 | 1898 | static int tc358743_probe_of(struct tc358743_state *state) |
---|
1898 | 1899 | { |
---|
1899 | 1900 | struct device *dev = &state->i2c_client->dev; |
---|
1900 | | - struct v4l2_fwnode_endpoint *endpoint; |
---|
| 1901 | + struct v4l2_fwnode_endpoint endpoint = { .bus_type = 0 }; |
---|
1901 | 1902 | struct device_node *ep; |
---|
1902 | 1903 | struct clk *refclk; |
---|
1903 | 1904 | u32 bps_pr_lane; |
---|
1904 | | - int ret = -EINVAL; |
---|
| 1905 | + int ret; |
---|
1905 | 1906 | |
---|
1906 | 1907 | refclk = devm_clk_get(dev, "refclk"); |
---|
1907 | 1908 | if (IS_ERR(refclk)) { |
---|
.. | .. |
---|
1917 | 1918 | return -EINVAL; |
---|
1918 | 1919 | } |
---|
1919 | 1920 | |
---|
1920 | | - endpoint = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep)); |
---|
1921 | | - if (IS_ERR(endpoint)) { |
---|
| 1921 | + ret = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep), &endpoint); |
---|
| 1922 | + if (ret) { |
---|
1922 | 1923 | dev_err(dev, "failed to parse endpoint\n"); |
---|
1923 | | - ret = PTR_ERR(endpoint); |
---|
1924 | 1924 | goto put_node; |
---|
1925 | 1925 | } |
---|
1926 | 1926 | |
---|
1927 | | - if (endpoint->bus_type != V4L2_MBUS_CSI2 || |
---|
1928 | | - endpoint->bus.mipi_csi2.num_data_lanes == 0 || |
---|
1929 | | - endpoint->nr_of_link_frequencies == 0) { |
---|
| 1927 | + if (endpoint.bus_type != V4L2_MBUS_CSI2_DPHY || |
---|
| 1928 | + endpoint.bus.mipi_csi2.num_data_lanes == 0 || |
---|
| 1929 | + endpoint.nr_of_link_frequencies == 0) { |
---|
1930 | 1930 | dev_err(dev, "missing CSI-2 properties in endpoint\n"); |
---|
| 1931 | + ret = -EINVAL; |
---|
1931 | 1932 | goto free_endpoint; |
---|
1932 | 1933 | } |
---|
1933 | 1934 | |
---|
1934 | | - if (endpoint->bus.mipi_csi2.num_data_lanes > 4) { |
---|
| 1935 | + if (endpoint.bus.mipi_csi2.num_data_lanes > 4) { |
---|
1935 | 1936 | dev_err(dev, "invalid number of lanes\n"); |
---|
| 1937 | + ret = -EINVAL; |
---|
1936 | 1938 | goto free_endpoint; |
---|
1937 | 1939 | } |
---|
1938 | 1940 | |
---|
1939 | | - state->bus = endpoint->bus.mipi_csi2; |
---|
| 1941 | + state->bus = endpoint.bus.mipi_csi2; |
---|
1940 | 1942 | |
---|
1941 | 1943 | ret = clk_prepare_enable(refclk); |
---|
1942 | 1944 | if (ret) { |
---|
.. | .. |
---|
1969 | 1971 | * The CSI bps per lane must be between 62.5 Mbps and 1 Gbps. |
---|
1970 | 1972 | * The default is 594 Mbps for 4-lane 1080p60 or 2-lane 720p60. |
---|
1971 | 1973 | */ |
---|
1972 | | - bps_pr_lane = 2 * endpoint->link_frequencies[0]; |
---|
| 1974 | + bps_pr_lane = 2 * endpoint.link_frequencies[0]; |
---|
1973 | 1975 | if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U) { |
---|
1974 | 1976 | dev_err(dev, "unsupported bps per lane: %u bps\n", bps_pr_lane); |
---|
1975 | 1977 | ret = -EINVAL; |
---|
.. | .. |
---|
2016 | 2018 | disable_clk: |
---|
2017 | 2019 | clk_disable_unprepare(refclk); |
---|
2018 | 2020 | free_endpoint: |
---|
2019 | | - v4l2_fwnode_endpoint_free(endpoint); |
---|
| 2021 | + v4l2_fwnode_endpoint_free(&endpoint); |
---|
2020 | 2022 | put_node: |
---|
2021 | 2023 | of_node_put(ep); |
---|
2022 | 2024 | return ret; |
---|
.. | .. |
---|
2028 | 2030 | } |
---|
2029 | 2031 | #endif |
---|
2030 | 2032 | |
---|
2031 | | -static int tc358743_probe(struct i2c_client *client, |
---|
2032 | | - const struct i2c_device_id *id) |
---|
| 2033 | +static int tc358743_probe(struct i2c_client *client) |
---|
2033 | 2034 | { |
---|
2034 | 2035 | static struct v4l2_dv_timings default_timing = |
---|
2035 | 2036 | V4L2_DV_BT_CEA_640X480P59_94; |
---|
.. | .. |
---|
2224 | 2225 | .name = "tc358743", |
---|
2225 | 2226 | .of_match_table = of_match_ptr(tc358743_of_match), |
---|
2226 | 2227 | }, |
---|
2227 | | - .probe = tc358743_probe, |
---|
| 2228 | + .probe_new = tc358743_probe, |
---|
2228 | 2229 | .remove = tc358743_remove, |
---|
2229 | 2230 | .id_table = tc358743_id, |
---|
2230 | 2231 | }; |
---|