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

C++ pinctrl_select_state函数代码示例

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

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



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

示例1: android_irrc_enable_pwm

static void android_irrc_enable_pwm(struct timed_irrc_data *irrc, int PWM_CLK, int duty)
{
	int rc;

	cancel_delayed_work_sync(&irrc->gpio_off_work); //android_irrc_disable_pwm

	if(g_pwm_enabled == true) {
		INFO_MSG("pwm already enabled !!!\n");
		return;
	}

	if (irrc->vreg != NULL) {
		rc = regulator_enable(irrc->vreg);
		ERR_MSG("regulator_enabled1\n");
		if (rc < 0)
			ERR_MSG("regulator_enable failed\n");
	}
	/*if (irrc->vreg2 != NULL) {
		rc = regulator_enable(irrc->vreg2);
        ERR_MSG("irrc->vreg2 set!!\n");
		if (rc < 0)
			ERR_MSG("regulator_enable failed2\n");
	}*/

	if((PWM_CLK == 0) || (duty == 100)){
		INFO_MSG("gpio set to high!!!\n");

	rc = pinctrl_select_state(irrc->pctrl, irrc->active_state);
	if(rc < 0) {
		ERR_MSG("select active state failed\n");
	} else {
		ERR_MSG("state changed to active\n");
	}
	gpio_direction_output(irrc->pwm_gpio, 1);
	gpio_set_value(irrc->pwm_gpio, 1);

		gpio_high_flag = 1;

	} else if((PWM_CLK < 23) || (PWM_CLK > 1200) || (duty > 60) || (duty < 20) ){
		INFO_MSG("Out of range ! \n");
	} else {
		INFO_MSG("gpio set to gp!!!\n");

		rc = pinctrl_select_state(irrc->pctrl, irrc->suspended_state);
		if(rc < 0){
			ERR_MSG("select suspended state failed\n");
		} else {
			ERR_MSG("state changed to suspended\n");
		}

		gpio_direction_output(irrc->pwm_gpio, 1);
		//gpio_set_value(irrc->pwm_gpio, 1); no need
		clk_set_rate(irrc->gp_clk, irrc->clk_rate);
		clk_prepare_enable(irrc->gp_clk);
		android_irrc_set_pwm(1, PWM_CLK, duty);

		gpio_high_flag = 0;
	}
	g_pwm_enabled = true;
}
开发者ID:GameTheory-,项目名称:android_kernel_g4stylusn2,代码行数:60,代码来源:android_irrc.c


示例2: mtkcam_gpio_set

int mtkcam_gpio_set(int PinIdx, int PwrType, int Val)
{
	int ret = 0;
	switch (PwrType) {
	case CAMRST:
		if (PinIdx == 0) {
			if (Val == 0)
				pinctrl_select_state(camctrl, cam0_rst_l);
			else
				pinctrl_select_state(camctrl, cam0_rst_h);
		} else {
			if (Val == 0)
				pinctrl_select_state(camctrl, cam1_rst_l);
			else
				pinctrl_select_state(camctrl, cam1_rst_h);
		}
		break;
	default:
		PK_DBG("PwrType(%d) is invalid !!\n", PwrType);
		break;
	};

	PK_DBG("PinIdx(%d) PwrType(%d) val(%d)\n", PinIdx, PwrType, Val);

	return ret;
}
开发者ID:P-D-A,项目名称:android_kernel_lge_mt6753,代码行数:26,代码来源:kd_camera_hw.c


示例3: tegra_sdhci_set_padctrl

static int tegra_sdhci_set_padctrl(struct sdhci_host *host, int voltage)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
	int ret;

	if (!tegra_host->pad_control_available)
		return 0;

	if (voltage == MMC_SIGNAL_VOLTAGE_180) {
		ret = pinctrl_select_state(tegra_host->pinctrl_sdmmc,
					   tegra_host->pinctrl_state_1v8);
		if (ret < 0)
			dev_err(mmc_dev(host->mmc),
				"setting 1.8V failed, ret: %d\n", ret);
	} else {
		ret = pinctrl_select_state(tegra_host->pinctrl_sdmmc,
					   tegra_host->pinctrl_state_3v3);
		if (ret < 0)
			dev_err(mmc_dev(host->mmc),
				"setting 3.3V failed, ret: %d\n", ret);
	}

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


示例4: ssusb_mode_manual_switch

/*
 * We provide an interface via debugfs to switch between host and device modes
 * depending on user input.
 * This is useful in special cases, such as uses TYPE-A receptacle but also
 * wants to support dual-role mode.
 * It generates cable state changes by pulling up/down IDPIN and
 * notifies driver to switch mode by "extcon-usb-gpio".
 * NOTE: when use MICRO receptacle, should not enable this interface.
 */
static void ssusb_mode_manual_switch(struct ssusb_mtk *ssusb, int to_host)
{
	struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;

	if (to_host)
		pinctrl_select_state(otg_sx->id_pinctrl, otg_sx->id_ground);
	else
		pinctrl_select_state(otg_sx->id_pinctrl, otg_sx->id_float);
}
开发者ID:asmalldev,项目名称:linux,代码行数:18,代码来源:mtu3_dr.c


示例5: ci13xxx_msm_install_wake_gpio

static int ci13xxx_msm_install_wake_gpio(struct platform_device *pdev,
				struct resource *res)
{
	int wake_irq;
	int ret;
	struct pinctrl_state *set_state;

	dev_dbg(&pdev->dev, "ci13xxx_msm_install_wake_gpio\n");

	_udc_ctxt.wake_gpio = res->start;
	if (_udc_ctxt.ci13xxx_pinctrl) {
		set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl,
				"ci13xxx_active");
		if (IS_ERR(set_state)) {
			pr_err("cannot get ci13xxx pinctrl active state\n");
			return PTR_ERR(set_state);
		}
		pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl, set_state);
	}
	gpio_request(_udc_ctxt.wake_gpio, "USB_RESUME");
	gpio_direction_input(_udc_ctxt.wake_gpio);
	wake_irq = gpio_to_irq(_udc_ctxt.wake_gpio);
	if (wake_irq < 0) {
		dev_err(&pdev->dev, "could not register USB_RESUME GPIO.\n");
		return -ENXIO;
	}

	dev_dbg(&pdev->dev, "_udc_ctxt.gpio_irq = %d and irq = %d\n",
			_udc_ctxt.wake_gpio, wake_irq);
	ret = request_irq(wake_irq, ci13xxx_msm_resume_irq,
		IRQF_TRIGGER_RISING | IRQF_ONESHOT, "usb resume", NULL);
	if (ret < 0) {
		dev_err(&pdev->dev, "could not register USB_RESUME IRQ.\n");
		goto gpio_free;
	}
	disable_irq(wake_irq);
	_udc_ctxt.wake_irq = wake_irq;

	return 0;

gpio_free:
	gpio_free(_udc_ctxt.wake_gpio);
	if (_udc_ctxt.ci13xxx_pinctrl) {
		set_state = pinctrl_lookup_state(_udc_ctxt.ci13xxx_pinctrl,
				"ci13xxx_sleep");
		if (IS_ERR(set_state))
			pr_err("cannot get ci13xxx pinctrl sleep state\n");
		else
			pinctrl_select_state(_udc_ctxt.ci13xxx_pinctrl,
					set_state);
	}
	_udc_ctxt.wake_gpio = 0;
	return ret;
}
开发者ID:sztablet2016,项目名称:Android-kernel-msm-3.10,代码行数:54,代码来源:ci13xxx_msm.c


示例6: config_irq

static int config_irq(int n, int t) {
    
    int ret;

    if(n == 2) {
        trigger1_type = t;
        ret = pinctrl_select_state(pinctrl, pin_irq1);
        if(ret<0) {
            printk("pinctrl select state pin irq[%d] error \n", n);
        }
        irq1 = gpio_to_irq(pin[n]);
        printk("%s : requesting IRQ1 %d name = %s \n", __func__, irq1, "irq1");
        ret = request_irq(irq1, vdev_irq1_handler,
                IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND , "irq1", vdev_dev);
        if(ret < 0) {
            printk("request irq1 error\n");
            return -1;
        }
    } else if(n == 7) {
        trigger2_type = t;
        ret = pinctrl_select_state(pinctrl, pin_irq2);
        if(ret<0) {
            printk("pinctrl select state pin irq[%d] error \n", n);
        }
        irq2 = gpio_to_irq(pin[n]);
        printk("%s : requesting IRQ2 %d name = %s \n", __func__, irq2, "irq2");
        ret = request_irq(irq2, vdev_irq2_handler,
                IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND , "irq2", vdev_dev);
        if(ret < 0) {
            printk("request irq2 error\n");
            return -1;
        }

    } else if(n == 9) {
        trigger3_type = t;
        ret = pinctrl_select_state(pinctrl, pin_irq3);
        if(ret<0) {
            printk("pinctrl select state pin irq[%d] error \n", n);
        }
        irq3 = gpio_to_irq(pin[n]);
        printk("%s : requesting IRQ3 %d name = %s \n", __func__, irq3, "irq3");
        ret = request_irq(irq3, vdev_irq3_handler,
                IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND , "irq3", vdev_dev);
        if(ret < 0) {
            printk("request irq3 error\n");
            return -1;
        }
    }

    device_init_wakeup(&pn547_dev->client->dev, 1);
    
    return ret;
}
开发者ID:chengyake,项目名称:karch,代码行数:53,代码来源:virtual_devices.c


示例7: c55_ctrl_suspend

static int c55_ctrl_suspend(struct platform_device *dev, pm_message_t state)
{
	struct c55_ctrl_data *cdata = dev_get_drvdata(&dev->dev);
	struct m4sensorhub_data *m4sensorhub = m4sensorhub_client_get_drvdata();

	if (cdata->c55_mode != C55_OFF) {
		dev_warn(&dev->dev, "C55 still ON when going into suspend\n");

		/* Disable C55->AP IRQ when turning off C55 */
		if (cdata->c55_ap_int_enabled) {
			disable_irq_nosync(
				__gpio_to_irq(cdata->c55_ap_int_gpio));
			cdata->c55_ap_int_enabled = 0;
		}

		if (m4sensorhub_reg_write_1byte
		    (m4sensorhub, M4SH_REG_USERSETTINGS_AUDIOSTATUS,
		    AUDIO_STATUS_OFF, 0xFF) != 1) {
			dev_err(&dev->dev,
				"Unable to set screen status to 0x00\n");
		}

		/* AP->C55 interrupt needs to be set low when C55 is off
		 * for current drain reasons */
		gpio_set_value(cdata->ap_c55_int_gpio, 0);

		cdata->c55_mode = C55_OFF;
	}

	pinctrl_select_state(cdata->pctrl, cdata->states[C55_OFF]);

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


示例8: 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


示例9: select_pin_ctl

/**
 * Will try to select the set of pins (GPIOS) defined in a pin control node of
 * the device tree named @p name.
 *
 * The node can contain several eg. GPIOs that is controlled when selecting it.
 * The node may activate or deactivate the pins it contains, the action is
 * defined in the device tree node itself and not here. The states used
 * internally is fetched at probe time.
 *
 * @see pctl_names
 * @see fpc1020_probe
 */
static int select_pin_ctl(struct fpc1020_data *fpc1020, const char *name)
{
	struct device *dev = fpc1020->dev;
	size_t i;
	int rc;

	for (i = 0; i < ARRAY_SIZE(fpc1020->pinctrl_state); i++) {
		const char *n = pctl_names[i];
		if (!strncmp(n, name, strlen(n))) {
			rc = pinctrl_select_state(fpc1020->fingerprint_pinctrl,
					fpc1020->pinctrl_state[i]);
			if (rc)
				dev_err(dev, "cannot select '%s'\n", name);
			else
				dev_dbg(dev, "Selected '%s'\n", name);

			goto exit;
		}
	}
	rc = -EINVAL;
	dev_err(dev, "%s:'%s' not found\n", __func__, name);

exit:
	return rc;
}
开发者ID:chrisc93,项目名称:android_kernel_bullhead,代码行数:37,代码来源:fpc1020_tee.c


示例10: 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


示例11: 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


示例12: msm_flash_lm3642_i2c_remove

static int msm_flash_lm3642_i2c_remove(struct i2c_client *client)
{
	struct msm_camera_sensor_board_info *flashdata = NULL;
	struct msm_camera_power_ctrl_t *power_info = NULL;
	int rc = 0 ;
	LM3642_DBG("%s entry\n", __func__);
	flashdata = fctrl.flashdata;
	power_info = &flashdata->power_info;

	rc = msm_camera_request_gpio_table(
		power_info->gpio_conf->cam_gpio_req_tbl,
		power_info->gpio_conf->cam_gpio_req_tbl_size, 0);
	if (rc < 0) {
		pr_err("%s: request gpio failed\n", __func__);
		return rc;
	}

	if (fctrl.pinctrl_info.use_pinctrl == true) {
		rc = pinctrl_select_state(fctrl.pinctrl_info.pinctrl,
				fctrl.pinctrl_info.gpio_state_suspend);
		if (rc)
			pr_err("%s:%d cannot set pin to suspend state",
				__func__, __LINE__);
	}
	return rc;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:26,代码来源:lm3642.c


示例13: 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


示例14: dummy_codec_device_init

static void dummy_codec_device_init(void)
{
#ifdef CONFIG_USE_OF
	int ret;
	struct pinctrl_state *s;
	p = pinctrl_get(dummy_codec_dev);

	if (IS_ERR(p))
		return;
			
	s = pinctrl_lookup_state(p, "dummy_codec_audio");
	if (IS_ERR(s)) {
		pinctrl_put(p);
		return;
	}
		
	ret = pinctrl_select_state(p, s);
	if (ret < 0) {
		pinctrl_put(p);
		return;
	}
	printk("=%s==,dummy_codec_audio init done\n",__func__);
#else
    /* audio pinmux */
//    pinmux_set(&rt5631_pinmux_set);

    /* GPIOA_19 PULL_UP_REG0 bit19 */
//    aml_set_reg32_bits(P_PAD_PULL_UP_REG0, 1, 19, 1);
#endif
}
开发者ID:enmaca,项目名称:linux-amlogic,代码行数:30,代码来源:aml_m_dummy.c


示例15: msm_gpioset_activate

int msm_gpioset_activate(enum pinctrl_client client, char *keyword)
{
	int ret = 0;
	int gp_set = 0;
	int active_set = 0;

	gp_set = msm_get_gpioset_index(client, keyword);
	if (gp_set < 0) {
		pr_err("%s: gpio set name does not exist\n",
				__func__);
		return gp_set;
	}

	if (!gpioset_info[client].gpioset_state[gp_set]) {
		/*
		 * If pinctrl pointer is not valid,
		 * no need to proceed further
		 */
		active_set = pinctrl_info[client].active_set;
		if (IS_ERR(pinctrl_info[client].cdc_lines[active_set]))
			return 0;

		pinctrl_info[client].active_set |= (1 << gp_set);
		active_set = pinctrl_info[client].active_set;
		pr_debug("%s: pinctrl.active_set: %d\n", __func__, active_set);

		/* Select the appropriate pinctrl state */
		ret =  pinctrl_select_state(pinctrl_info[client].pinctrl,
			pinctrl_info[client].cdc_lines[active_set]);
	}
	gpioset_info[client].gpioset_state[gp_set]++;

	return ret;
}
开发者ID:moonlightly,项目名称:NX523J_kernel,代码行数:34,代码来源:msm-audio-pinctrl.c


示例16: htc_config_bt_off

static void htc_config_bt_off(void)
{
    int rc = 0;

    if (gpio_bt_reg_on < 0) {
        printk(KERN_INFO "[BT]bt_reg_on:%d !!\n", gpio_bt_reg_on);
    }


    bluesleep_set_bt_pwr_state(0);


    rc = gpio_direction_output(gpio_bt_reg_on, 0);
    if (rc) printk(KERN_INFO "[BT]set REG_ON 0 fail! %d\n", rc);


    rc = pinctrl_select_state(bt_pinctrl, bt_wake_host_set_state_off);
    if (rc) printk("[BT] cannot set BT pinctrl gpio state off\n");

    mdelay(2);


    msm_hs_uart_gpio_config_ext(0);

    printk(KERN_INFO "[BT]== R OFF ==\n");
}
开发者ID:boa19861105,项目名称:android_kernel_htc_b3uhl-JP,代码行数:26,代码来源:board-8994-rfkill.c


示例17: usdhi6_set_pinstates

static int usdhi6_set_pinstates(struct usdhi6_host *host, int voltage)
{
	if (IS_ERR(host->pins_uhs))
		return 0;

	switch (voltage) {
	case MMC_SIGNAL_VOLTAGE_180:
	case MMC_SIGNAL_VOLTAGE_120:
		return pinctrl_select_state(host->pinctrl,
					    host->pins_uhs);

	default:
		return pinctrl_select_state(host->pinctrl,
					    host->pins_default);
	}
}
开发者ID:513855417,项目名称:linux,代码行数:16,代码来源:usdhi6rol0.c


示例18: gpio_keys_pinctrl_configure

static int gpio_keys_pinctrl_configure(struct gpio_keys_drvdata *ddata,
							bool active)
{
	struct pinctrl_state *set_state;
	int retval;

	if (active) {
		set_state =
			pinctrl_lookup_state(ddata->key_pinctrl,
						"tlmm_gpio_key_active");
		if (IS_ERR(set_state)) {
			dev_err(&ddata->input->dev,
				"cannot get ts pinctrl active state\n");
			return PTR_ERR(set_state);
		}
	} else {
		set_state =
			pinctrl_lookup_state(ddata->key_pinctrl,
						"tlmm_gpio_key_suspend");
		if (IS_ERR(set_state)) {
			dev_err(&ddata->input->dev,
				"cannot get gpiokey pinctrl sleep state\n");
			return PTR_ERR(set_state);
		}
	}
	retval = pinctrl_select_state(ddata->key_pinctrl, set_state);
	if (retval) {
		dev_err(&ddata->input->dev,
				"cannot set ts pinctrl active state\n");
		return retval;
	}

	return 0;
}
开发者ID:DestructoSphere,项目名称:android_kernel_huawei_msm8909,代码行数:34,代码来源:gpio_keys.c


示例19: 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


示例20: mdss_dsi_pinctrl_set_state

static int mdss_dsi_pinctrl_set_state(
	struct mdss_dsi_ctrl_pdata *ctrl_pdata,
	bool active)
{
	struct pinctrl_state *pin_state;
	int rc = -EFAULT;

	if (IS_ERR_OR_NULL(ctrl_pdata->pin_res.pinctrl))
		return PTR_ERR(ctrl_pdata->pin_res.pinctrl);

	pin_state = active ? ctrl_pdata->pin_res.gpio_state_active
				: ctrl_pdata->pin_res.gpio_state_suspend;
	if (!IS_ERR_OR_NULL(pin_state)) {
		rc = pinctrl_select_state(ctrl_pdata->pin_res.pinctrl,
				pin_state);
		if (rc)
			pr_err("%s: can not set %s pins\n", __func__,
			       active ? MDSS_PINCTRL_STATE_DEFAULT
			       : MDSS_PINCTRL_STATE_SLEEP);
	} else {
		pr_err("%s: invalid '%s' pinstate\n", __func__,
		       active ? MDSS_PINCTRL_STATE_DEFAULT
		       : MDSS_PINCTRL_STATE_SLEEP);
	}
	return rc;
}
开发者ID:netqer,项目名称:android_kernel_N958St,代码行数:26,代码来源:mdss_dsi.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ping函数代码示例发布时间:2022-05-30
下一篇:
C++ pinctrl_lookup_state函数代码示例发布时间: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