diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-09-09 06:06:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 16:28:59 -0400 |
commit | 443f483aa2494b93d73ba122cafdf2ef89989ed7 (patch) | |
tree | 8b94a6d4ef0696c0b9310dd2bb7bdadee1eb7249 /drivers/media/video | |
parent | 14178aa57ce6ac4f05b4df8ea9e010486ce83a76 (diff) |
[media] V4L: mt9m001, mt9v022: use internally cached pixel code
Using the internally cached pixel code, instead of the one, provided by
the soc-camera, removes one more use of struct soc_camera_device in these
drivers. Also remove the no longer needed soc_camera_from_i2c() inline
function.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/mt9m001.c | 10 | ||||
-rw-r--r-- | drivers/media/video/mt9v022.c | 14 |
2 files changed, 4 insertions, 20 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index 58cdcedf53de..63ae5c61c9bf 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -601,15 +601,9 @@ static int mt9m001_s_mbus_config(struct v4l2_subdev *sd, | |||
601 | const struct v4l2_mbus_config *cfg) | 601 | const struct v4l2_mbus_config *cfg) |
602 | { | 602 | { |
603 | const struct i2c_client *client = v4l2_get_subdevdata(sd); | 603 | const struct i2c_client *client = v4l2_get_subdevdata(sd); |
604 | struct soc_camera_device *icd = soc_camera_from_i2c(client); | ||
605 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); | 604 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); |
606 | /* | 605 | struct mt9m001 *mt9m001 = to_mt9m001(client); |
607 | * Cannot use icd->current_fmt->host_fmt->bits_per_sample, because that | 606 | unsigned int bps = soc_mbus_get_fmtdesc(mt9m001->fmt->code)->bits_per_sample; |
608 | * is the number of bits, that the host has to sample, not the number of | ||
609 | * bits, that we have to send. See mx3_camera.c for an example of 10-bit | ||
610 | * formats being truncated to 8 bits by the host. | ||
611 | */ | ||
612 | unsigned int bps = soc_mbus_get_fmtdesc(icd->current_fmt->code)->bits_per_sample; | ||
613 | 607 | ||
614 | if (icl->set_bus_param) | 608 | if (icl->set_bus_param) |
615 | return icl->set_bus_param(icl, 1 << (bps - 1)); | 609 | return icl->set_bus_param(icl, 1 << (bps - 1)); |
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 72b179b2ad6c..b6a29f7de82c 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -700,23 +700,13 @@ static int mt9v022_s_mbus_config(struct v4l2_subdev *sd, | |||
700 | const struct v4l2_mbus_config *cfg) | 700 | const struct v4l2_mbus_config *cfg) |
701 | { | 701 | { |
702 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 702 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
703 | struct soc_camera_device *icd = client->dev.platform_data; | 703 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); |
704 | struct soc_camera_link *icl = to_soc_camera_link(icd); | ||
705 | struct mt9v022 *mt9v022 = to_mt9v022(client); | 704 | struct mt9v022 *mt9v022 = to_mt9v022(client); |
706 | unsigned long flags = soc_camera_apply_board_flags(icl, cfg); | 705 | unsigned long flags = soc_camera_apply_board_flags(icl, cfg); |
707 | /* | 706 | unsigned int bps = soc_mbus_get_fmtdesc(mt9v022->fmt->code)->bits_per_sample; |
708 | * Cannot use icd->current_fmt->host_fmt->bits_per_sample, because that | ||
709 | * is the number of bits, that the host has to sample, not the number of | ||
710 | * bits, that we have to send. See mx3_camera.c for an example of 10-bit | ||
711 | * formats being truncated to 8 bits by the host. | ||
712 | */ | ||
713 | unsigned int bps = soc_mbus_get_fmtdesc(icd->current_fmt->code)->bits_per_sample; | ||
714 | int ret; | 707 | int ret; |
715 | u16 pixclk = 0; | 708 | u16 pixclk = 0; |
716 | 709 | ||
717 | dev_dbg(icd->pdev, "set %d: %s, %dbps\n", icd->current_fmt->code, | ||
718 | icd->current_fmt->host_fmt->name, bps); | ||
719 | |||
720 | if (icl->set_bus_param) { | 710 | if (icl->set_bus_param) { |
721 | ret = icl->set_bus_param(icl, 1 << (bps - 1)); | 711 | ret = icl->set_bus_param(icl, 1 << (bps - 1)); |
722 | if (ret) | 712 | if (ret) |