adv7604.c (c38e8657a471e9af42b86009e5d3085031b41fda) adv7604.c (af28c99628ebfbdc3fff3d92c7044d3a51b7ccea)
1/*
2 * adv7604 - Analog Devices ADV7604 video decoder driver
3 *
4 * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.

--- 1934 unchanged lines hidden (view full) ---

1943{
1944 struct adv76xx_state *state = to_state(sd);
1945 const struct adv76xx_format_info *info;
1946
1947 if (format->pad != state->source_pad)
1948 return -EINVAL;
1949
1950 info = adv76xx_format_info(state, format->format.code);
1/*
2 * adv7604 - Analog Devices ADV7604 video decoder driver
3 *
4 * Copyright 2012 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.

--- 1934 unchanged lines hidden (view full) ---

1943{
1944 struct adv76xx_state *state = to_state(sd);
1945 const struct adv76xx_format_info *info;
1946
1947 if (format->pad != state->source_pad)
1948 return -EINVAL;
1949
1950 info = adv76xx_format_info(state, format->format.code);
1951 if (info == NULL)
1951 if (!info)
1952 info = adv76xx_format_info(state, MEDIA_BUS_FMT_YUYV8_2X8);
1953
1954 adv76xx_fill_format(state, &format->format);
1955 format->format.code = info->code;
1956
1957 if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
1958 struct v4l2_mbus_framefmt *fmt;
1959

--- 291 unchanged lines hidden (view full) ---

2251 return -EINVAL;
2252 }
2253
2254 if (edid->start_block == 0 && edid->blocks == 0) {
2255 edid->blocks = data ? state->edid.blocks : 0;
2256 return 0;
2257 }
2258
1952 info = adv76xx_format_info(state, MEDIA_BUS_FMT_YUYV8_2X8);
1953
1954 adv76xx_fill_format(state, &format->format);
1955 format->format.code = info->code;
1956
1957 if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
1958 struct v4l2_mbus_framefmt *fmt;
1959

--- 291 unchanged lines hidden (view full) ---

2251 return -EINVAL;
2252 }
2253
2254 if (edid->start_block == 0 && edid->blocks == 0) {
2255 edid->blocks = data ? state->edid.blocks : 0;
2256 return 0;
2257 }
2258
2259 if (data == NULL)
2259 if (!data)
2260 return -ENODATA;
2261
2262 if (edid->start_block >= state->edid.blocks)
2263 return -EINVAL;
2264
2265 if (edid->start_block + edid->blocks > state->edid.blocks)
2266 edid->blocks = state->edid.blocks - edid->start_block;
2267

--- 1207 unchanged lines hidden (view full) ---

3475
3476 for (i = 1; i < ADV76XX_PAGE_MAX; ++i) {
3477 if (!(BIT(i) & state->info->page_mask))
3478 continue;
3479
3480 state->i2c_clients[i] =
3481 adv76xx_dummy_client(sd, state->pdata.i2c_addresses[i],
3482 0xf2 + i);
2260 return -ENODATA;
2261
2262 if (edid->start_block >= state->edid.blocks)
2263 return -EINVAL;
2264
2265 if (edid->start_block + edid->blocks > state->edid.blocks)
2266 edid->blocks = state->edid.blocks - edid->start_block;
2267

--- 1207 unchanged lines hidden (view full) ---

3475
3476 for (i = 1; i < ADV76XX_PAGE_MAX; ++i) {
3477 if (!(BIT(i) & state->info->page_mask))
3478 continue;
3479
3480 state->i2c_clients[i] =
3481 adv76xx_dummy_client(sd, state->pdata.i2c_addresses[i],
3482 0xf2 + i);
3483 if (state->i2c_clients[i] == NULL) {
3483 if (!state->i2c_clients[i]) {
3484 err = -ENOMEM;
3485 v4l2_err(sd, "failed to create i2c client %u\n", i);
3486 goto err_i2c;
3487 }
3488 }
3489
3490 INIT_DELAYED_WORK(&state->delayed_work_enable_hotplug,
3491 adv76xx_delayed_work_enable_hotplug);

--- 85 unchanged lines hidden ---
3484 err = -ENOMEM;
3485 v4l2_err(sd, "failed to create i2c client %u\n", i);
3486 goto err_i2c;
3487 }
3488 }
3489
3490 INIT_DELAYED_WORK(&state->delayed_work_enable_hotplug,
3491 adv76xx_delayed_work_enable_hotplug);

--- 85 unchanged lines hidden ---