• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ devm_pinctrl_get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中devm_pinctrl_get函数的典型用法代码示例。如果您正苦于以下问题:C++ devm_pinctrl_get函数的具体用法?C++ devm_pinctrl_get怎么用?C++ devm_pinctrl_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了devm_pinctrl_get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ispv1_io_hw_init

/*
 **************************************************************************
 * FunctionName: ispv1_io_hw_init;
 * Description : ispio & csi init;
 * Input       : pdev: used to get resource
 * Output      : NA;
 * ReturnValue : NA;
 * Other       : NA;
 **************************************************************************
 */
int ispv1_io_hw_init(struct platform_device *pdev)
{
	int ret = 0;

	print_debug("enter %s, pdev[%p]", __func__, pdev);

	ispv1_io_set_default();

	ispv1_io.pdev = pdev;


    /* pinctrl enable */
	ispv1_io.isp_pinctrl = devm_pinctrl_get(&pdev->dev);
	if (IS_ERR(ispv1_io.isp_pinctrl)) {
	    print_error("%s :could not get pinctrl\n",__FUNCTION__);
		return ret;
	}

	ispv1_io.pinctrl_def = pinctrl_lookup_state(ispv1_io.isp_pinctrl,PINCTRL_STATE_DEFAULT);
    if (IS_ERR(ispv1_io.pinctrl_def)) {
        print_error("%s : could not get def state\n", __FUNCTION__);
    }
	ispv1_io.pinctrl_idle = pinctrl_lookup_state(ispv1_io.isp_pinctrl,PINCTRL_STATE_IDLE);
	if (IS_ERR(ispv1_io.pinctrl_idle)) {
        print_error("%s : could not get idle state\n", __FUNCTION__);
    }


	return ret;
}
开发者ID:mildrock,项目名称:overlay_plane_display,代码行数:40,代码来源:k3_ispv1_io.c


示例2: nfc_pinctrl_init

static int nfc_pinctrl_init(struct device *dev)
{
	bcm2079x_pctrl.pinctrl = devm_pinctrl_get(dev);

	if (IS_ERR_OR_NULL(bcm2079x_pctrl.pinctrl)) {
		pr_err("%s:%d Getting pinctrl handle failed\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	bcm2079x_pctrl.nfc_gpio_state_active = pinctrl_lookup_state(
					       bcm2079x_pctrl.pinctrl,
					       BCM2079X_STATE_ACTIVE);

	if (IS_ERR_OR_NULL(bcm2079x_pctrl.nfc_gpio_state_active)) {
		pr_err("%s:%d Failed to get the active state pinctrl handle\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	bcm2079x_pctrl.nfc_gpio_state_suspend = pinctrl_lookup_state(
						 bcm2079x_pctrl.pinctrl,
						BCM2079X_STATE_SUSPEND);

	if (IS_ERR_OR_NULL(bcm2079x_pctrl.nfc_gpio_state_active)) {
		pr_err("%s:%d Failed to get the suspend state pinctrl handle\n",
				__func__, __LINE__);
		return -EINVAL;
	}
	return 0;
}
开发者ID:youyim,项目名称:Z9Max_NX510J_V1_kernel,代码行数:29,代码来源:bcm2079x-i2c.c


示例3: mdss_dsi_pinctrl_init

static int mdss_dsi_pinctrl_init(struct platform_device *pdev)
{
	struct mdss_dsi_ctrl_pdata *ctrl_pdata;

	ctrl_pdata = platform_get_drvdata(pdev);
	ctrl_pdata->pin_res.pinctrl = devm_pinctrl_get(&pdev->dev);
	if (IS_ERR_OR_NULL(ctrl_pdata->pin_res.pinctrl)) {
		pr_err("%s: failed to get pinctrl\n", __func__);
		return PTR_ERR(ctrl_pdata->pin_res.pinctrl);
	}

	ctrl_pdata->pin_res.gpio_state_active
		= pinctrl_lookup_state(ctrl_pdata->pin_res.pinctrl,
				MDSS_PINCTRL_STATE_DEFAULT);
	if (IS_ERR_OR_NULL(ctrl_pdata->pin_res.gpio_state_active))
		pr_warn("%s: can not get default pinstate\n", __func__);

	ctrl_pdata->pin_res.gpio_state_suspend
		= pinctrl_lookup_state(ctrl_pdata->pin_res.pinctrl,
				MDSS_PINCTRL_STATE_SLEEP);
	if (IS_ERR_OR_NULL(ctrl_pdata->pin_res.gpio_state_suspend))
		pr_warn("%s: can not get sleep pinstate\n", __func__);

	return 0;
}
开发者ID:netqer,项目名称:android_kernel_N958St,代码行数:25,代码来源:mdss_dsi.c


示例4: pinctrl_init

static int pinctrl_init(struct i2c_client *client)
{
    struct lge_touch_data *ts = i2c_get_clientdata(client);

    /* Get pinctrl if target uses pinctrl */
    ts->ts_pinctrl = devm_pinctrl_get(&(client->dev));
    if (IS_ERR(ts->ts_pinctrl)) {
        if (PTR_ERR(ts->ts_pinctrl) == -EPROBE_DEFER) {
            LGTC_ERR("ts_pinctrl == -EPROBE_DEFER\n");
            return -EPROBE_DEFER;
        }
        LGTC_DBG("Target does not use pinctrl(ts->ts_pinctrl == NULL) \n");
        ts->ts_pinctrl = NULL;
    }

    if (ts->ts_pinctrl) {
        ts->ts_pinset_state_active = pinctrl_lookup_state(ts->ts_pinctrl, "pmx_ts_active");
        if (IS_ERR(ts->ts_pinset_state_active))
            LGTC_DBG("cannot get ts pinctrl active state\n");

        ts->ts_pinset_state_suspend = pinctrl_lookup_state(ts->ts_pinctrl, "pmx_ts_suspend");
        if (IS_ERR(ts->ts_pinset_state_suspend))
            LGTC_DBG("cannot get ts pinctrl active state\n");

        if (ts->ts_pinset_state_active) {
            DO_SAFE(pinctrl_select_state(ts->ts_pinctrl, ts->ts_pinset_state_active), error);
        } else {
            LGTC_DBG("pinctrl active == NULL \n");
        }
    }

    return NO_ERROR;
error:
    return ERROR;
}
开发者ID:GameTheory-,项目名称:android_kernel_g4stylusn2,代码行数:35,代码来源:lgtp_platform_api.c


示例5: gf_init_pinctrl

int gf_init_pinctrl(struct gf_dev *gf_dev, struct device *dev)
{
    GF_LOG_INFO("start\n");

	gf_dev->gf_pctrl.pinctrl= devm_pinctrl_get(dev);
	if (IS_ERR_OR_NULL(gf_dev->gf_pctrl.pinctrl)) {
        GF_LOG_ERROR("failed to get pinctrl handle\n");
        return -EINVAL;
    }

	gf_dev->gf_pctrl.gpio_state_active = pinctrl_lookup_state(gf_dev->gf_pctrl.pinctrl,
		"gf_active");
	if (IS_ERR_OR_NULL(gf_dev->gf_pctrl.gpio_state_active)) {
		GF_LOG_ERROR("failed to get active state pinctrl handle\n");
		return -EINVAL;
	}

	gf_dev->gf_pctrl.gpio_state_suspend = pinctrl_lookup_state(gf_dev->gf_pctrl.pinctrl,
		"gf_suspend");
	if (IS_ERR_OR_NULL(gf_dev->gf_pctrl.gpio_state_suspend)) {
		GF_LOG_ERROR("failed to get suspend state pinctrl handle\n");
		return -EINVAL;
	}

	gf_dev->gf_pctrl.gpio_int_active = pinctrl_lookup_state(gf_dev->gf_pctrl.pinctrl,
		"gf_int_active");
	if (IS_ERR_OR_NULL(gf_dev->gf_pctrl.gpio_int_active)) {
		GF_LOG_ERROR("failed to get int active state pinctrl handle\n");
		return -EINVAL;
	}

    GF_LOG_INFO("success\n");

	return 0;
}
开发者ID:moonlightly,项目名称:NX523J_kernel,代码行数:35,代码来源:gf-spi.c


示例6: cod3022x_i2c_probe

static int cod3022x_i2c_probe(struct i2c_client *i2c,
		const struct i2c_device_id *id)
{
	struct cod3022x_priv *cod3022x;
	struct pinctrl *pinctrl;
	int ret;

	cod3022x = kzalloc(sizeof(struct cod3022x_priv), GFP_KERNEL);
	if (cod3022x == NULL)
		return -ENOMEM;
	cod3022x->dev = &i2c->dev;

	cod3022x->regmap = devm_regmap_init_i2c(i2c, &cod3022x_regmap);
	if (IS_ERR(cod3022x->regmap)) {
		dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
		return PTR_ERR(cod3022x->regmap);
	}

	pinctrl = devm_pinctrl_get(&i2c->dev);
	if (IS_ERR(pinctrl)) {
		dev_warn(&i2c->dev, "did not get pins for codec: %li\n",
							PTR_ERR(pinctrl));
	} else {
		cod3022x->pinctrl = pinctrl;
	}

	i2c_set_clientdata(i2c, cod3022x);

	ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_cod3022x,
			cod3022x_dai, ARRAY_SIZE(cod3022x_dai));
	if (ret < 0)
		dev_err(&i2c->dev, "Failed to register codec: %d\n", ret);

	return ret;
}
开发者ID:MikeForeskin,项目名称:Vindicator-S6-MM,代码行数:35,代码来源:cod3022x.c


示例7: tegra_sdhci_init_pinctrl_info

static int tegra_sdhci_init_pinctrl_info(struct device *dev,
					 struct sdhci_tegra *tegra_host)
{
	tegra_host->pinctrl_sdmmc = devm_pinctrl_get(dev);
	if (IS_ERR(tegra_host->pinctrl_sdmmc)) {
		dev_dbg(dev, "No pinctrl info, err: %ld\n",
			PTR_ERR(tegra_host->pinctrl_sdmmc));
		return -1;
	}

	tegra_host->pinctrl_state_3v3 =
		pinctrl_lookup_state(tegra_host->pinctrl_sdmmc, "sdmmc-3v3");
	if (IS_ERR(tegra_host->pinctrl_state_3v3)) {
		dev_warn(dev, "Missing 3.3V pad state, err: %ld\n",
			 PTR_ERR(tegra_host->pinctrl_state_3v3));
		return -1;
	}

	tegra_host->pinctrl_state_1v8 =
		pinctrl_lookup_state(tegra_host->pinctrl_sdmmc, "sdmmc-1v8");
	if (IS_ERR(tegra_host->pinctrl_state_1v8)) {
		dev_warn(dev, "Missing 1.8V pad state, err: %ld\n",
			 PTR_ERR(tegra_host->pinctrl_state_1v8));
		return -1;
	}

	tegra_host->pad_control_available = true;

	return 0;
}
开发者ID:ezequielgarcia,项目名称:linux,代码行数:30,代码来源:sdhci-tegra.c


示例8: msm_flash_pinctrl_init

static int msm_flash_pinctrl_init(struct msm_led_flash_ctrl_t *ctrl)
{
    struct msm_pinctrl_info *flash_pctrl = NULL;

    flash_pctrl = &ctrl->pinctrl_info;
    flash_pctrl->pinctrl = devm_pinctrl_get(&ctrl->flash_i2c_client->client->dev);

    if (IS_ERR_OR_NULL(flash_pctrl->pinctrl)) {
        pr_err("%s:%d Getting pinctrl handle failed\n",
               __func__, __LINE__);
        return -EINVAL;
    }
    flash_pctrl->gpio_state_active = pinctrl_lookup_state(
                                         flash_pctrl->pinctrl,
                                         CAM_FLASH_PINCTRL_STATE_DEFAULT);

    if (IS_ERR_OR_NULL(flash_pctrl->gpio_state_active)) {
        pr_err("%s:%d Failed to get the active state pinctrl handle\n",
               __func__, __LINE__);
        return -EINVAL;
    }
    flash_pctrl->gpio_state_suspend = pinctrl_lookup_state(
                                          flash_pctrl->pinctrl,
                                          CAM_FLASH_PINCTRL_STATE_SLEEP);

    if (IS_ERR_OR_NULL(flash_pctrl->gpio_state_suspend)) {
        pr_err("%s:%d Failed to get the suspend state pinctrl handle\n",
               __func__, __LINE__);
        return -EINVAL;
    }
    return 0;
}
开发者ID:GameTheory-,项目名称:android_kernel_g4stylusn2,代码行数:32,代码来源:msm_led_i2c_trigger_lm3559.c


示例9: cyttsp4_pinctrl_init

static int cyttsp4_pinctrl_init(struct cyttsp4_core_platform_data *data, int on, struct device *dev)
{
	if (!on) {
		goto pinctrl_put;
	}

	data->pinctrl = devm_pinctrl_get(dev->parent);
	if (IS_ERR_OR_NULL(data->pinctrl)) {
		dev_err(dev, "%s:failed to get pinctrl!\n", __func__);
		return PTR_ERR(data->pinctrl);
	}

	data->gpio_state_active = pinctrl_lookup_state(data->pinctrl, "pmx_ts_active");
	if (IS_ERR_OR_NULL(data->gpio_state_active)) {
		dev_err(dev, "%s:failed to look up pmx_ts_active state!\n", __func__);
		return PTR_ERR(data->gpio_state_active);
	}

	data->gpio_state_suspend = pinctrl_lookup_state(data->pinctrl, "pmx_ts_suspend");
	if (IS_ERR_OR_NULL(data->gpio_state_suspend)) {
		dev_err(dev, "%s:failed to look up pmx_ts_suspend state!\n", __func__);
		return PTR_ERR(data->gpio_state_suspend);
	}

	return 0;

pinctrl_put:
	devm_pinctrl_put(data->pinctrl);
	return 0;
}
开发者ID:BeastOn,项目名称:yu_msm8916,代码行数:30,代码来源:cyttsp4_platform.c


示例10: c55_ctrl_pin_setup

static int c55_ctrl_pin_setup(struct device *dev, struct c55_ctrl_data *cdata)
{
	int i, ret = 0;

	cdata->pctrl = devm_pinctrl_get(dev);
	if (IS_ERR(cdata->pctrl)) {
		ret = PTR_ERR(cdata->pctrl);
		dev_dbg(dev, "no pinctrl handle\n");
	}

	for (i = 0; !ret && (i < C55_MODE_MAX); i++) {
		cdata->states[i] = pinctrl_lookup_state(cdata->pctrl,
			c55_pin_state_labels[i]);
		if (IS_ERR(cdata->states[i])) {
			ret = PTR_ERR(cdata->states[i]);
			dev_dbg(dev, "no %s pinctrl state\n",
				c55_pin_state_labels[i]);
		}
	}

	if (!ret) {
		ret = pinctrl_select_state(cdata->pctrl,
			cdata->states[C55_OFF]);
		if (ret)
			dev_dbg(dev, "failed to activate %s pinctrl state\n",
				c55_pin_state_labels[C55_OFF]);
	}

	return ret;
}
开发者ID:AlmightyMegadeth00,项目名称:kernel_minnow,代码行数:30,代码来源:c55_ctrl.c


示例11: twi_request_gpio

static int twi_request_gpio(struct sunxi_i2c *i2c)
{
	int ret = 0;

	I2C_DBG("Pinctrl init %d ... [%s]\n", i2c->bus_num, i2c->adap.dev.parent->init_name);

	if (!twi_chan_is_enable(i2c->bus_num))
		return -1;
	
	i2c->pctrl = devm_pinctrl_get(i2c->adap.dev.parent);
	if (IS_ERR(i2c->pctrl)) {
		I2C_ERR("TWI%d devm_pinctrl_get() failed! return %ld\n", i2c->bus_num, PTR_ERR(i2c->pctrl));
		return -1;
	}

	i2c->pctrl_state = pinctrl_lookup_state(i2c->pctrl, PINCTRL_STATE_DEFAULT);
	if (IS_ERR(i2c->pctrl_state)) {
		I2C_ERR("TWI%d pinctrl_lookup_state() failed! return %p \n", i2c->bus_num, i2c->pctrl_state);
		return -1;
	}

	ret = pinctrl_select_state(i2c->pctrl, i2c->pctrl_state);
	if (ret < 0)
		I2C_ERR("TWI%d pinctrl_select_state() failed! return %d \n", i2c->bus_num, ret);
	
	return ret;
}
开发者ID:alex-deng,项目名称:a33_linux,代码行数:27,代码来源:i2c-sunxi.c


示例12: isdbt_pinctrl_init

static int isdbt_pinctrl_init(void)
{
	struct pinctrl *tdmb_pinctrl;
	struct pinctrl_state *gpio_state_suspend;

	tdmb_pinctrl = devm_pinctrl_get(&(IsdbCtrlInfo.pdev->dev));


	if(IS_ERR_OR_NULL(tdmb_pinctrl)) {
		pr_err("%s: Getting pinctrl handle failed\n", __func__);
		return -EINVAL;
	}
	gpio_state_suspend
	 = pinctrl_lookup_state(tdmb_pinctrl, "isdbt_gpio_suspend");

	 if(IS_ERR_OR_NULL(gpio_state_suspend)) {
	 	pr_err("%s: [dtv]Failed to get the suspend state pinctrl handle\n", __func__);
	 	return -EINVAL;
	}

	if(pinctrl_select_state(tdmb_pinctrl, gpio_state_suspend)) {
		pr_err("%s: [dtv]error on pinctrl_select_state DTV GPIOs\n", __func__);
		return -EINVAL;
	}
	else {
		printk("%s: success to set pinctrl_select_state for DTV GPIOss\n", __func__);
	}

	return 0;
}
开发者ID:MH2033,项目名称:VIPER_KERNEL_LP_D802,代码行数:30,代码来源:broadcast_fc8300.c


示例13: sms_power_ctrl_of_get_pinctrl

static int sms_power_ctrl_of_get_pinctrl(struct device *dev)
{
	pr_info("sms_power_ctrl_of_get_pinctrl\n");
	pinctrl_info.pinctrl = devm_pinctrl_get(dev);
	if (IS_ERR(pinctrl_info.pinctrl)) {
		pr_err("%s:failed to get pinctrl\n", __func__);
		return PTR_ERR(pinctrl_info.pinctrl);
	}
#if  0
	pinctrl_info.sms_pins_active = pinctrl_lookup_state(pinctrl_info.pinctrl,
					PINCTRL_STATE_ACTIVE);
	if (IS_ERR(pinctrl_info.sms_pins_active)) {
		pr_err("%s Can not get sms power control gpio default pinstate\n", __func__);
		return PTR_ERR(pinctrl_info.sms_pins_active);
	}

	pinctrl_info.sms_pins_suspend = pinctrl_lookup_state(pinctrl_info.pinctrl,
					PINCTRL_STATE_SUSPEND);
	if (IS_ERR(pinctrl_info.sms_pins_suspend)) {
		pr_err("%s Can not get sms power control gpio suspend pinstate\n", __func__);
		return PTR_ERR(pinctrl_info.sms_pins_suspend);
	}
#endif
	return 0;
}
开发者ID:iuncuim,项目名称:A476_V1B_5.1_kernel,代码行数:25,代码来源:smspower_customer.c


示例14: get_pintctrl

static void get_pintctrl(struct device *dev)
{
	if (!pins) {
		pins = devm_pinctrl_get(dev);
		if (!pins)
			pr_err("%s: failed to get pinctrl\n", __func__);
	}

	if (!state_default) {
		state_default = pinctrl_lookup_state(pins, "default");
		if (!state_default)
			pr_err("%s: failed to get default pinctrl\n", __func__);
	}

#if defined(CONFIG_FB_I80_COMMAND_MODE) && !defined(CONFIG_FB_I80_SW_TRIGGER)
	if (!state_turnon_tes) {
		state_turnon_tes = pinctrl_lookup_state(pins, "turnon_tes");
		if (!state_turnon_tes)
			pr_err("%s: failed to get default pinctrl\n", __func__);
	}

	if (!state_turnoff_tes) {
		state_turnoff_tes = pinctrl_lookup_state(pins, "turnoff_tes");
		if (!state_turnoff_tes)
			pr_err("%s: failed to get default pinctrl\n", __func__);
	}
#endif
}
开发者ID:Silverblade-nz,项目名称:Alpha15Copy,代码行数:28,代码来源:fimd_pm_exynos.c


示例15: tpd_init_pins

static int tpd_init_pins(struct platform_device *pdev)
{
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
	struct device_node *node;

	ddata->pins = devm_pinctrl_get(&pdev->dev);
	if (IS_ERR(ddata->pins))
		return PTR_ERR(ddata->pins);

	ddata->pin_state_i2c = pinctrl_lookup_state(ddata->pins, "i2c");
	if (IS_ERR(ddata->pin_state_i2c))
		return PTR_ERR(ddata->pin_state_i2c);

	ddata->pin_state_ddc = pinctrl_lookup_state(ddata->pins, "ddc");
	if (IS_ERR(ddata->pin_state_ddc))
		return PTR_ERR(ddata->pin_state_ddc);

	node = of_parse_phandle(pdev->dev.of_node, "ddc-i2c-bus", 0);
	if (!node)
		return -ENODEV;

	ddata->ddc_i2c_adapter = of_find_i2c_adapter_by_node(node);
	if (!ddata->ddc_i2c_adapter)
		return -ENODEV;

	return 0;
}
开发者ID:pgurenko,项目名称:VAR-SOM-AM33-Kernel-3-14,代码行数:27,代码来源:dra7-evm-encoder-tpd12s015.c


示例16: cyttsp3_pinctrl_init

static int cyttsp3_pinctrl_init(struct device *dev)
{
	cyttsp3_pctrl.pinctrl = devm_pinctrl_get(dev);

	if (IS_ERR_OR_NULL(cyttsp3_pctrl.pinctrl)) {
		pr_err("%s:%d Getting pinctrl handle failed\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	cyttsp3_pctrl.gpio_state_active = pinctrl_lookup_state(
					       cyttsp3_pctrl.pinctrl,
					       CY_PINCTRL_STATE_DEFAULT);

	if (IS_ERR_OR_NULL(cyttsp3_pctrl.gpio_state_active)) {
		pr_err("%s:%d Failed to get the active state pinctrl handle\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	cyttsp3_pctrl.gpio_state_suspend = pinctrl_lookup_state(
						cyttsp3_pctrl.pinctrl,
						CY_PINCTRL_STATE_SLEEP);

	if (IS_ERR_OR_NULL(cyttsp3_pctrl.gpio_state_suspend)) {
		pr_err("%s:%d Failed to get the suspend state pinctrl handle\n",
				__func__, __LINE__);
		return -EINVAL;
	}
	return 0;
}
开发者ID:moonlightly,项目名称:NX523J_kernel,代码行数:29,代码来源:cyttsp3_i2c.c


示例17: aw2013_configure_gpio

static int aw2013_configure_gpio(struct aw2013_led *led, bool on)
{
	struct pinctrl *pinctrl;
	struct pinctrl_state *pinctrl_state;
	int rc;

	pinctrl = devm_pinctrl_get(&led->client->dev);
	if (IS_ERR_OR_NULL(pinctrl)) {
		dev_err(&led->client->dev,
				"Failed to get pinctrl\n");
		return -EFAULT;
	}
	pinctrl_state = pinctrl_lookup_state(pinctrl,
			on ? "aw2013_led_default" : "aw2013_led_suspend");
	if (IS_ERR_OR_NULL(pinctrl_state)) {
		dev_err(&led->client->dev,
				"Failed to look up pinctrl state\n");
		return -EFAULT;
	}
	rc = pinctrl_select_state(pinctrl, pinctrl_state);
	if (rc) {
		dev_err(&led->client->dev,
				"Failed to select pinctrl state\n");
		return -EIO;
	}

	return 0;
}
开发者ID:LEPT-Development,项目名称:android_kernel_lge_msm8916-old,代码行数:28,代码来源:leds-aw2013.c


示例18: msm_camera_pinctrl_init

static int msm_camera_pinctrl_init(struct msm_camera_power_ctrl_t *ctrl)
{
	struct msm_pinctrl_info *sensor_pctrl = NULL;

	sensor_pctrl = &ctrl->pinctrl_info;
	sensor_pctrl->pinctrl = devm_pinctrl_get(ctrl->dev);
	if (IS_ERR_OR_NULL(sensor_pctrl->pinctrl)) {
		pr_err("%s:%d Getting pinctrl handle failed\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	sensor_pctrl->gpio_state_active =
		pinctrl_lookup_state(sensor_pctrl->pinctrl,
				CAM_SENSOR_PINCTRL_STATE_DEFAULT);
	if (IS_ERR_OR_NULL(sensor_pctrl->gpio_state_active)) {
		pr_err("%s:%d Failed to get the active state pinctrl handle\n",
			__func__, __LINE__);
		return -EINVAL;
	}
	sensor_pctrl->gpio_state_suspend
		= pinctrl_lookup_state(sensor_pctrl->pinctrl,
				CAM_SENSOR_PINCTRL_STATE_SLEEP);
	if (IS_ERR_OR_NULL(sensor_pctrl->gpio_state_suspend)) {
		pr_err("%s:%d Failed to get the suspend state pinctrl handle\n",
				__func__, __LINE__);
		return -EINVAL;
	}
	return 0;
}
开发者ID:touchpro,项目名称:android_kernel_lge_ls770,代码行数:29,代码来源:msm_camera_dt_util.c


示例19: mtkcam_gpio_init

int mtkcam_gpio_init(struct platform_device *pdev)
{
	int ret = 0;
	camctrl = devm_pinctrl_get(&pdev->dev);
	if (IS_ERR(camctrl)) {
		dev_err(&pdev->dev, "Cannot find camera pinctrl!");
		ret = PTR_ERR(camctrl);
	}

	cam0_rst_h = pinctrl_lookup_state(camctrl, "cam0_rst1");
	if (IS_ERR(cam0_rst_h)) {
		ret = PTR_ERR(cam0_rst_h);
		pr_debug("%s : pinctrl err, cam0_rst_h\n", __func__);
	}

	cam0_rst_l = pinctrl_lookup_state(camctrl, "cam0_rst0");
	if (IS_ERR(cam0_rst_l)) {
		ret = PTR_ERR(cam0_rst_l);
		pr_debug("%s : pinctrl err, cam0_rst_l\n", __func__);
	}

	cam1_rst_h = pinctrl_lookup_state(camctrl, "cam1_rst1");
	if (IS_ERR(cam1_rst_h)) {
		ret = PTR_ERR(cam1_rst_h);
		pr_debug("%s : pinctrl err, cam1_rst_h\n", __func__);
	}

	cam1_rst_l = pinctrl_lookup_state(camctrl, "cam1_rst0");
	if (IS_ERR(cam1_rst_l)) {
		ret = PTR_ERR(cam1_rst_l);
		pr_debug("%s : pinctrl err, cam1_rst_l\n", __func__);
	}
	return ret;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:34,代码来源:kd_camera_hw.c


示例20: si47xx_get_pinctrl_configs

static int si47xx_get_pinctrl_configs(struct si47xx_platform_data *pdata, struct device *dev)
{
	pdata->si47xx_pinctrl = devm_pinctrl_get(dev);
	if (IS_ERR_OR_NULL(pdata->si47xx_pinctrl)) {
		if (PTR_ERR(pdata->si47xx_pinctrl) == -EPROBE_DEFER)
			return -EPROBE_DEFER;

		pr_err("%s: Target does not use pinctrl\n", __func__);
		return -EINVAL;
	}

	pdata->si47xx_rst_default = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_rst_pins_default");
	if (IS_ERR(pdata->si47xx_rst_default)) {
		pr_err("%s: could not get default pinstate\n", __func__);
		goto pinctrl_fail;
	}
	
	pdata->si47xx_rst_active = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_rst_pins_active");
	if (IS_ERR(pdata->si47xx_rst_active)) {
		pr_err("%s: could not get active pinstate\n", __func__);
		goto pinctrl_fail;
	}

	pdata->si47xx_rst_suspend = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_rst_pins_suspend");
	if (IS_ERR(pdata->si47xx_rst_suspend)) {
		pr_err("%s: could not get suspend pinstate\n", __func__);
		goto pinctrl_fail;
	}

	pdata->si47xx_int_default = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_int_pins_default");
	if (IS_ERR(pdata->si47xx_int_default)) {
		pr_err("%s: could not get default pinstate\n", __func__);
		goto pinctrl_fail;
	}
	
	pdata->si47xx_int_active = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_int_pins_active");
	if (IS_ERR(pdata->si47xx_int_active)) {
		pr_err("%s: could not get active pinstate\n", __func__);
		goto pinctrl_fail;
	}

	pdata->si47xx_int_suspend = pinctrl_lookup_state(pdata->si47xx_pinctrl, 
		"si4705_int_pins_suspend");
	if (IS_ERR(pdata->si47xx_int_suspend)) {
		pr_err("%s: could not get suspend pinstate\n", __func__);
		goto pinctrl_fail;
	}

	return 0;

pinctrl_fail:
	pdata->si47xx_pinctrl = NULL;
	return -EINVAL;
}
开发者ID:MikeForeskin,项目名称:Vindicator-S6-MM,代码行数:59,代码来源:Si47xx_i2c_drv.c



注:本文中的devm_pinctrl_get函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ devm_regmap_init_i2c函数代码示例发布时间:2022-05-30
下一篇:
C++ devm_kzalloc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap