]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
EDP: remove old system EDP framework (ov5693 and mt9m114 drivers)
authorTimo Alho <talho@nvidia.com>
Sat, 28 Dec 2013 10:41:53 +0000 (12:41 +0200)
committerJuha Tukkinen <jtukkinen@nvidia.com>
Tue, 7 Jan 2014 11:38:24 +0000 (03:38 -0800)
Revert "drivers: media: tegra: edp support"
This reverts commit bdd27016ab662a70e85245631a3a89b74f1fe664.

Revised system edp software framework has been put in place. This
patch removes the old system EDP client code from ov5693 and mt9m114
camera sensors.

Bug 1431977

Change-Id: Iedb6807cadfc7d57b3724c398a345cce14867212
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: http://git-master/r/350410
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
drivers/media/platform/tegra/mt9m114.c
drivers/media/platform/tegra/ov5693.c
include/media/mt9m114.h
include/media/ov5693.h

index 118132d81da62dba7c59e77c3135e963b6a34417..2c233a84aa3df1370a647c8f238f1e9c57908ac0 100644 (file)
@@ -423,8 +423,6 @@ struct mt9m114_info {
        const struct mt9m114_reg        *mode;
        u8                              i2c_trans_buf[SIZEOF_I2C_TRANSBUF];
        struct clk *mclk;
-       struct edp_client *edpc;
-       unsigned int edp_state;
        struct sysedp_consumer *sysedpc;
 };
 
@@ -453,95 +451,6 @@ static const struct regmap_config sensor_regmap_config = {
 static long mt9m114_ioctl(struct file *file,
                        unsigned int cmd, unsigned long arg);
 
-static void mt9m114_edp_lowest(struct mt9m114_info *info)
-{
-       if (!info->edpc)
-               return;
-
-       info->edp_state = info->edpc->num_states - 1;
-       dev_dbg(&info->i2c_client->dev, "%s %d\n", __func__, info->edp_state);
-       if (edp_update_client_request(info->edpc, info->edp_state, NULL)) {
-               dev_err(&info->i2c_client->dev, "THIS IS NOT LIKELY TO HAPPEN!\n");
-               dev_err(&info->i2c_client->dev,
-                       "UNABLE TO SET LOWEST EDP STATE!\n");
-       }
-}
-
-static void mt9m114_edp_throttle(unsigned int new_state, void *priv_data)
-{
-       struct mt9m114_info *info = priv_data;
-
-       if (info->pdata && info->pdata->power_off)
-               info->pdata->power_off(&info->power);
-}
-
-static void mt9m114_edp_register(struct mt9m114_info *info)
-{
-       struct edp_manager *edp_manager;
-       struct edp_client *edpc = &info->pdata->edpc_config;
-       int ret;
-
-       info->edpc = NULL;
-       if (!edpc->num_states) {
-               dev_warn(&info->i2c_client->dev,
-                       "%s: No edp states defined.\n", __func__);
-               return;
-       }
-
-       strncpy(edpc->name, "mt9m114", EDP_NAME_LEN - 1);
-       edpc->name[EDP_NAME_LEN - 1] = 0;
-       edpc->private_data = info;
-       edpc->throttle = mt9m114_edp_throttle;
-
-       dev_dbg(&info->i2c_client->dev, "%s: %s, e0 = %d, p %d\n",
-               __func__, edpc->name, edpc->e0_index, edpc->priority);
-       for (ret = 0; ret < edpc->num_states; ret++)
-               dev_dbg(&info->i2c_client->dev, "e%d = %d mA",
-                       ret - edpc->e0_index, edpc->states[ret]);
-
-       edp_manager = edp_get_manager("battery");
-       if (!edp_manager) {
-               dev_err(&info->i2c_client->dev,
-                       "unable to get edp manager: battery\n");
-               return;
-       }
-
-       ret = edp_register_client(edp_manager, edpc);
-       if (ret) {
-               dev_err(&info->i2c_client->dev,
-                       "unable to register edp client\n");
-               return;
-       }
-
-       info->edpc = edpc;
-       /* set to lowest state at init */
-       mt9m114_edp_lowest(info);
-}
-
-static int mt9m114_edp_req(struct mt9m114_info *info, unsigned new_state)
-{
-       unsigned approved;
-       int ret = 0;
-
-       if (!info->edpc)
-               return 0;
-
-       dev_dbg(&info->i2c_client->dev, "%s %d\n", __func__, new_state);
-       ret = edp_update_client_request(info->edpc, new_state, &approved);
-       if (ret) {
-               dev_err(&info->i2c_client->dev, "E state transition failed\n");
-               return ret;
-       }
-
-       if (approved > new_state) {
-               dev_err(&info->i2c_client->dev, "EDP no enough current\n");
-               return -ENODEV;
-       }
-
-       info->edp_state = approved;
-       return 0;
-}
-
 static inline void mt9m114_msleep(u32 t)
 {
        usleep_range(t*1000, t*1000 + 500);
@@ -646,7 +555,6 @@ int mt9m114_release(struct inode *inode, struct file *file)
 
        if (info->pdata && info->pdata->power_off) {
                info->pdata->power_off(&info->power);
-               mt9m114_edp_lowest(info);
                mt9m114_mclk_disable(info);
                sysedp_set_state(info->sysedpc, 0);
        }
@@ -774,13 +682,6 @@ static int mt9m114_set_mode(struct mt9m114_info *info,
                return -EINVAL;
        }
 
-       /* request highest edp state */
-       err = mt9m114_edp_req(info, 0);
-       if (err) {
-               dev_err(&info->i2c_client->dev,
-                       "%s: ERROR cannot set edp state! %d\n", __func__, err);
-               return err;
-       }
        sysedp_set_state(info->sysedpc, 1);
 
        err = mt9m114_write_table(
@@ -929,7 +830,6 @@ static int mt9m114_probe(struct i2c_client *client,
        }
 
        mt9m114_power_get(info);
-       mt9m114_edp_register(info);
        info->sysedpc = sysedp_create_consumer("mt9m114", "mt9m114");
        mt9m114_mode_info_init(info);
 
index 9979441c116037274729f72f2cc0fe3763b3180f..cf48a0f2eb12a57e081118e15fb20faa0db1d12a 100644 (file)
@@ -74,8 +74,6 @@ struct ov5693_info {
        struct regmap *regmap;
        struct regulator *ext_vcm_vdd;
        struct ov5693_cal_data cal;
-       struct edp_client *edpc;
-       unsigned int edp_state;
        struct sysedp_consumer *sysedpc;
        char devname[16];
        struct ov5693_eeprom_data eeprom[OV5693_EEPROM_NUM_BLOCKS];
@@ -2137,95 +2135,6 @@ static const struct ov5693_reg *mode_table[] = {
        [OV5693_MODE_1280x720_HDR_60FPS] = ov5693_1280x720_HDR_60fps_i2c,
 };
 
-static void ov5693_edp_lowest(struct ov5693_info *info)
-{
-       if (!info->edpc)
-               return;
-
-       info->edp_state = info->edpc->num_states - 1;
-       dev_dbg(&info->i2c_client->dev, "%s %d\n", __func__, info->edp_state);
-       if (edp_update_client_request(info->edpc, info->edp_state, NULL)) {
-               dev_err(&info->i2c_client->dev, "THIS IS NOT LIKELY TO HAPPEN!\n");
-               dev_err(&info->i2c_client->dev,
-                       "UNABLE TO SET LOWEST EDP STATE!\n");
-       }
-}
-
-static void ov5693_edp_throttle(unsigned int new_state, void *priv_data)
-{
-       struct ov5693_info *info = priv_data;
-
-       if (info->pdata && info->pdata->power_off)
-               info->pdata->power_off(&info->regulators);
-}
-
-static void ov5693_edp_register(struct ov5693_info *info)
-{
-       struct edp_manager *edp_manager;
-       struct edp_client *edpc = &info->pdata->edpc_config;
-       int ret;
-
-       info->edpc = NULL;
-       if (!edpc->num_states) {
-               dev_warn(&info->i2c_client->dev,
-                       "%s: No edp states defined.\n", __func__);
-               return;
-       }
-
-       strncpy(edpc->name, "ov5693", EDP_NAME_LEN - 1);
-       edpc->name[EDP_NAME_LEN - 1] = 0;
-       edpc->private_data = info;
-       edpc->throttle = ov5693_edp_throttle;
-
-       dev_dbg(&info->i2c_client->dev, "%s: %s, e0 = %d, p %d\n",
-               __func__, edpc->name, edpc->e0_index, edpc->priority);
-       for (ret = 0; ret < edpc->num_states; ret++)
-               dev_dbg(&info->i2c_client->dev, "e%d = %d mA",
-                       ret - edpc->e0_index, edpc->states[ret]);
-
-       edp_manager = edp_get_manager("battery");
-       if (!edp_manager) {
-               dev_err(&info->i2c_client->dev,
-                       "unable to get edp manager: battery\n");
-               return;
-       }
-
-       ret = edp_register_client(edp_manager, edpc);
-       if (ret) {
-               dev_err(&info->i2c_client->dev,
-                       "unable to register edp client\n");
-               return;
-       }
-
-       info->edpc = edpc;
-       /* set to lowest state at init */
-       ov5693_edp_lowest(info);
-}
-
-static int ov5693_edp_req(struct ov5693_info *info, unsigned new_state)
-{
-       unsigned approved;
-       int ret = 0;
-
-       if (!info->edpc)
-               return 0;
-
-       dev_dbg(&info->i2c_client->dev, "%s %d\n", __func__, new_state);
-       ret = edp_update_client_request(info->edpc, new_state, &approved);
-       if (ret) {
-               dev_err(&info->i2c_client->dev, "E state transition failed\n");
-               return ret;
-       }
-
-       if (approved > new_state) {
-               dev_err(&info->i2c_client->dev, "EDP no enough current\n");
-               return -ENODEV;
-       }
-
-       info->edp_state = approved;
-       return 0;
-}
-
 static int ov5693_i2c_rd8(struct ov5693_info *info, u16 reg, u8 *val)
 {
        unsigned int data;
@@ -2733,7 +2642,6 @@ static int ov5693_power_off(struct ov5693_info *info)
                info->power_on = false;
                ov5693_gpio_pwrdn(info, 1);
                ov5693_mclk_disable(info);
-               ov5693_edp_lowest(info);
                sysedp_set_state(info->sysedpc, 0);
        } else {
                dev_err(&info->i2c_client->dev,
@@ -2952,12 +2860,6 @@ static int ov5693_set_mode(struct ov5693_info *info,
        }
 
        /* request highest edp state */
-       err = ov5693_edp_req(info, 0);
-       if (err) {
-               dev_err(&info->i2c_client->dev,
-                       "%s: ERROR cannot set edp state! %d\n", __func__, err);
-               return err;
-       }
        sysedp_set_state(info->sysedpc, 1);
 
        if (!info->mode_valid || (info->mode_index != mode_index))
@@ -3177,6 +3079,7 @@ static long ov5693_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return ret;
        }
 
+
        case OV5693_IOCTL_SET_GAIN:
                return ov5693_set_gain(info, (u32)arg, true);
 
@@ -3556,7 +3459,6 @@ static int ov5693_probe(
        if (!info->regulators.avdd || !info->regulators.dovdd)
                return -EFAULT;
 
-       ov5693_edp_register(info);
        info->sysedpc = sysedp_create_consumer("ov5693", "ov5693");
 
        ov5693_sdata_init(info);
index 25f27ac62b8c44bde2999df2003586a493e7d72f..6ddb748c126e9432c04d54ada122612fdee09b21 100644 (file)
@@ -20,7 +20,6 @@
 #define __MT9M114_H__
 
 #include <linux/ioctl.h>  /* For IOCTL macros */
-#include <linux/edp.h>
 
 #define SENSOR_NAME     "mt9m114"
 #define DEV(x)          "/dev/"x
@@ -142,7 +141,6 @@ struct mt9m114_platform_data {
        int (*power_on)(struct mt9m114_power_rail *pw);
        int (*power_off)(struct mt9m114_power_rail *pw);
        const char *mclk_name;
-       struct edp_client edpc_config;
 };
 #endif /* __KERNEL__ */
 
index 1804efab15394c56315ea8f7a8f164f823f678e7..60f06ddddcac80632def8ba562334364d61eb264 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <media/nvc.h>
 #include <media/nvc_image.h>
-#include <linux/edp.h>
 
 #define OV5693_IOCTL_SET_MODE               _IOW('o', 1, struct ov5693_mode)
 #define OV5693_IOCTL_SET_FRAME_LENGTH       _IOW('o', 2, __u32)
@@ -130,7 +129,6 @@ struct ov5693_platform_data {
        int (*power_on)(struct ov5693_power_rail *);
        int (*power_off)(struct ov5693_power_rail *);
        const char *mclk_name;
-       struct edp_client edpc_config;
 };
 
 #endif  /* __OV5693_H__ */