diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-07-10 14:21:45 +0200 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:47:30 +0900 |
commit | 767c0684f393ce44a82597ba2f39c6ad138c1b7c (patch) | |
tree | a7720fcc2b96337c26cae17687b79409dd5ff605 /drivers/media/platform | |
parent | 8b290f8d3d664c0aac7f0932bfa4d9e0f05ea341 (diff) |
fimc-is: remove pin_config_set dependency
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'drivers/media/platform')
4 files changed, 26 insertions, 64 deletions
diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-device-af.c b/drivers/media/platform/exynos/fimc-is/fimc-is-device-af.c index 367e3b1a2d1e..ca5340a2912e 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-device-af.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-device-af.c @@ -49,15 +49,15 @@ static void fimc_is_af_i2c_config(struct i2c_client *client, bool onoff) { struct device *i2c_dev = client->dev.parent->parent; struct pinctrl *pinctrl_i2c = NULL; - info("(%s):onoff(%d)\n", __func__, onoff); if (onoff) { /* ON */ - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - + pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "default"); + if (IS_ERR_OR_NULL(pinctrl_i2c)) { + printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); + } else { + devm_pinctrl_put(pinctrl_i2c); + } pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "on_i2c"); if (IS_ERR_OR_NULL(pinctrl_i2c)) { printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); @@ -66,17 +66,18 @@ static void fimc_is_af_i2c_config(struct i2c_client *client, bool onoff) } } else { /* OFF */ + pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "default"); + if (IS_ERR_OR_NULL(pinctrl_i2c)) { + printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); + } else { + devm_pinctrl_put(pinctrl_i2c); + } pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "off_i2c"); if (IS_ERR_OR_NULL(pinctrl_i2c)) { printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); } else { devm_pinctrl_put(pinctrl_i2c); } - - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); } } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-device-companion.c b/drivers/media/platform/exynos/fimc-is/fimc-is-device-companion.c index bf004a9f76e8..54681a3e6e2e 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-device-companion.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-device-companion.c @@ -361,11 +361,6 @@ int fimc_is_companion_open(struct fimc_is_device_companion *device) /* TODO: loading firmware */ fimc_is_s_int_comb_isp(core, false, INTMR2_INTMCIS22); - // Workaround for Host to use ISP-SPI. Will be removed later. - /* set pin output for Host to use SPI*/ - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_ssn, - PINCFG_PACK(PINCFG_TYPE_FUNC, FUNC_OUTPUT)); - fimc_is_set_spi_config(spi_gpio, FIMC_IS_SPI_FUNC, false); if (fimc_is_comp_is_valid(core) == 0) { @@ -388,45 +383,16 @@ int fimc_is_companion_open(struct fimc_is_device_companion *device) } } - // Workaround for Host to use ISP-SPI. Will be removed later. - /* Set SPI pins to low before changing pin function */ - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_sclk, - PINCFG_PACK(PINCFG_TYPE_DAT, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_ssn, - PINCFG_PACK(PINCFG_TYPE_DAT, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_miso, - PINCFG_PACK(PINCFG_TYPE_DAT, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_mois, - PINCFG_PACK(PINCFG_TYPE_DAT, 0)); - - /* Set pin function for A5 to use SPI */ - pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_ssn, - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); - set_bit(FIMC_IS_COMPANION_OPEN, &device->state); device->companion_status = FIMC_IS_COMPANION_OPENDONE; fimc_is_companion_wakeup(device); if(core->use_ois) { - if (!core->use_ois_hsi2c) { - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 1)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 1)); - } - if (!core->ois_ver_read) { fimc_is_ois_check_fw(core); } fimc_is_ois_exif_data(core); - - if (!core->use_ois_hsi2c) { - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); - } } info("[COMP:D] %s(%d)status(%d)\n", __func__, ret, device->companion_status); diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.c b/drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.c index 619e849039f7..70cf6301b894 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.c @@ -78,11 +78,12 @@ static void fimc_is_ois_i2c_config(struct i2c_client *client, bool onoff) ois_device->ois_hsi2c_status, onoff); if (onoff) { - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - + pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "default"); + if (IS_ERR_OR_NULL(pinctrl_i2c)) { + printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); + } else { + devm_pinctrl_put(pinctrl_i2c); + } pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "on_i2c"); if (IS_ERR_OR_NULL(pinctrl_i2c)) { printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); @@ -90,17 +91,18 @@ static void fimc_is_ois_i2c_config(struct i2c_client *client, bool onoff) devm_pinctrl_put(pinctrl_i2c); } } else { + pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "default"); + if (IS_ERR_OR_NULL(pinctrl_i2c)) { + printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); + } else { + devm_pinctrl_put(pinctrl_i2c); + } pinctrl_i2c = devm_pinctrl_get_select(i2c_dev, "off_i2c"); if (IS_ERR_OR_NULL(pinctrl_i2c)) { printk(KERN_ERR "%s: Failed to configure i2c pin\n", __func__); } else { devm_pinctrl_put(pinctrl_i2c); } - - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 2)); } ois_device->ois_hsi2c_status = onoff; } @@ -1417,15 +1419,6 @@ static int fimc_is_ois_probe(struct i2c_client *client, devm_pinctrl_put(pinctrl_i2c); } - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_FUNC, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-2", - PINCFG_PACK(PINCFG_TYPE_PUD, 0)); - pin_config_set(FIMC_IS_SPI_PINNAME, "gpc2-3", - PINCFG_PACK(PINCFG_TYPE_PUD, 0)); - return 0; } diff --git a/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.c b/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.c index b50bb2e0f330..087d6f90a413 100644 --- a/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.c +++ b/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.c @@ -1084,6 +1084,7 @@ exit: } void fimc_is_set_spi_config(struct fimc_is_spi_gpio *spi_gpio, int func, bool ssn) { +#if 0 pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_sclk, PINCFG_PACK(PINCFG_TYPE_FUNC, func)); pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_miso, @@ -1094,6 +1095,7 @@ void fimc_is_set_spi_config(struct fimc_is_spi_gpio *spi_gpio, int func, bool ss pin_config_set(FIMC_IS_SPI_PINNAME, spi_gpio->spi_ssn, PINCFG_PACK(PINCFG_TYPE_FUNC, func)); } +#endif } int fimc_is_sec_concord_fw_sel(struct fimc_is_core *core, struct device *dev, |