diff options
| -rw-r--r-- | drivers/media/video/mt9t112.c | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c index a3368d8e3193..608a3b6a8e99 100644 --- a/drivers/media/video/mt9t112.c +++ b/drivers/media/video/mt9t112.c | |||
| @@ -743,46 +743,6 @@ static int mt9t112_init_camera(const struct i2c_client *client) | |||
| 743 | } | 743 | } |
| 744 | 744 | ||
| 745 | /************************************************************************ | 745 | /************************************************************************ |
| 746 | soc_camera_ops | ||
| 747 | ************************************************************************/ | ||
| 748 | static int mt9t112_set_bus_param(struct soc_camera_device *icd, | ||
| 749 | unsigned long flags) | ||
| 750 | { | ||
| 751 | struct soc_camera_link *icl = to_soc_camera_link(icd); | ||
| 752 | struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); | ||
| 753 | struct mt9t112_priv *priv = to_mt9t112(client); | ||
| 754 | |||
| 755 | if (soc_camera_apply_sensor_flags(icl, flags) & SOCAM_PCLK_SAMPLE_RISING) | ||
| 756 | priv->flags |= PCLK_RISING; | ||
| 757 | |||
| 758 | return 0; | ||
| 759 | } | ||
| 760 | |||
| 761 | static unsigned long mt9t112_query_bus_param(struct soc_camera_device *icd) | ||
| 762 | { | ||
| 763 | struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); | ||
| 764 | struct mt9t112_priv *priv = to_mt9t112(client); | ||
| 765 | struct soc_camera_link *icl = to_soc_camera_link(icd); | ||
| 766 | unsigned long flags = SOCAM_MASTER | SOCAM_VSYNC_ACTIVE_HIGH | | ||
| 767 | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_HIGH; | ||
| 768 | |||
| 769 | flags |= (priv->info->flags & MT9T112_FLAG_PCLK_RISING_EDGE) ? | ||
| 770 | SOCAM_PCLK_SAMPLE_RISING : SOCAM_PCLK_SAMPLE_FALLING; | ||
| 771 | |||
| 772 | if (priv->info->flags & MT9T112_FLAG_DATAWIDTH_8) | ||
| 773 | flags |= SOCAM_DATAWIDTH_8; | ||
| 774 | else | ||
| 775 | flags |= SOCAM_DATAWIDTH_10; | ||
| 776 | |||
| 777 | return soc_camera_apply_sensor_flags(icl, flags); | ||
| 778 | } | ||
| 779 | |||
| 780 | static struct soc_camera_ops mt9t112_ops = { | ||
| 781 | .set_bus_param = mt9t112_set_bus_param, | ||
| 782 | .query_bus_param = mt9t112_query_bus_param, | ||
| 783 | }; | ||
| 784 | |||
| 785 | /************************************************************************ | ||
| 786 | v4l2_subdev_core_ops | 746 | v4l2_subdev_core_ops |
| 787 | ************************************************************************/ | 747 | ************************************************************************/ |
| 788 | static int mt9t112_g_chip_ident(struct v4l2_subdev *sd, | 748 | static int mt9t112_g_chip_ident(struct v4l2_subdev *sd, |
| @@ -1117,13 +1077,11 @@ static int mt9t112_probe(struct i2c_client *client, | |||
| 1117 | 1077 | ||
| 1118 | v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); | 1078 | v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); |
| 1119 | 1079 | ||
| 1120 | icd->ops = &mt9t112_ops; | 1080 | icd->ops = NULL; |
| 1121 | 1081 | ||
| 1122 | ret = mt9t112_camera_probe(icd, client); | 1082 | ret = mt9t112_camera_probe(icd, client); |
| 1123 | if (ret) { | 1083 | if (ret) |
| 1124 | icd->ops = NULL; | ||
| 1125 | kfree(priv); | 1084 | kfree(priv); |
| 1126 | } | ||
| 1127 | 1085 | ||
| 1128 | return ret; | 1086 | return ret; |
| 1129 | } | 1087 | } |
| @@ -1131,9 +1089,7 @@ static int mt9t112_probe(struct i2c_client *client, | |||
| 1131 | static int mt9t112_remove(struct i2c_client *client) | 1089 | static int mt9t112_remove(struct i2c_client *client) |
| 1132 | { | 1090 | { |
| 1133 | struct mt9t112_priv *priv = to_mt9t112(client); | 1091 | struct mt9t112_priv *priv = to_mt9t112(client); |
| 1134 | struct soc_camera_device *icd = client->dev.platform_data; | ||
| 1135 | 1092 | ||
| 1136 | icd->ops = NULL; | ||
| 1137 | kfree(priv); | 1093 | kfree(priv); |
| 1138 | return 0; | 1094 | return 0; |
| 1139 | } | 1095 | } |
