当前位置: 首页>>代码示例>>C++>>正文


C++ platform_driver_register函数代码示例

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


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

示例1: of_pci_phb_init

static __init int of_pci_phb_init(void)
{
	return platform_driver_register(&of_pci_phb_driver);
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:4,代码来源:of_platform.c

示例2: apollon_panel_drv_init

static int __init apollon_panel_drv_init(void)
{
	return platform_driver_register(&apollon_panel_driver);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:4,代码来源:lcd_apollon.c

示例3: attiny_init

static int __init attiny_init(void) {
	return platform_driver_register(&attiny_driver);
}
开发者ID:brinlyaus,项目名称:P810D02_ZTE_T792_KitKat_3.4,代码行数:3,代码来源:attiny44a.c

示例4: omap_pwm_led_init

static int __init omap_pwm_led_init(void)
{
	return platform_driver_register(&omap_pwm_led_driver);
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:4,代码来源:leds-omap-pwm.c

示例5: aml_m8_audio_init

static int __init aml_m8_audio_init(void)
{
    return platform_driver_register(&aml_m8_audio_driver);
}
开发者ID:nmadrane,项目名称:linux-meson,代码行数:4,代码来源:aml_m8_rt5616.c

示例6: msi_init

static int __init msi_init(void)
{
	int ret;

	if (acpi_disabled)
		return -ENODEV;

	if (force || dmi_check_system(msi_dmi_table))
		old_ec_model = 1;

	if (!old_ec_model)
		get_threeg_exists();

	if (!old_ec_model && dmi_check_system(msi_load_scm_models_dmi_table))
		load_scm_model = 1;

	if (auto_brightness < 0 || auto_brightness > 2)
		return -EINVAL;

	

	if (acpi_video_backlight_support()) {
		pr_info("Brightness ignored, must be controlled by ACPI video driver\n");
	} else {
		struct backlight_properties props;
		memset(&props, 0, sizeof(struct backlight_properties));
		props.type = BACKLIGHT_PLATFORM;
		props.max_brightness = MSI_LCD_LEVEL_MAX - 1;
		msibl_device = backlight_device_register("msi-laptop-bl", NULL,
							 NULL, &msibl_ops,
							 &props);
		if (IS_ERR(msibl_device))
			return PTR_ERR(msibl_device);
	}

	ret = platform_driver_register(&msipf_driver);
	if (ret)
		goto fail_backlight;

	

	msipf_device = platform_device_alloc("msi-laptop-pf", -1);
	if (!msipf_device) {
		ret = -ENOMEM;
		goto fail_platform_driver;
	}

	ret = platform_device_add(msipf_device);
	if (ret)
		goto fail_platform_device1;

	if (load_scm_model && (load_scm_model_init(msipf_device) < 0)) {
		ret = -EINVAL;
		goto fail_platform_device1;
	}

	ret = sysfs_create_group(&msipf_device->dev.kobj,
				 &msipf_attribute_group);
	if (ret)
		goto fail_platform_device2;

	if (!old_ec_model) {
		if (threeg_exists)
			ret = device_create_file(&msipf_device->dev,
						&dev_attr_threeg);
		if (ret)
			goto fail_platform_device2;
	}


	if (auto_brightness != 2)
		set_auto_brightness(auto_brightness);

	pr_info("driver " MSI_DRIVER_VERSION " successfully loaded\n");

	return 0;

fail_platform_device2:

	if (load_scm_model) {
		i8042_remove_filter(msi_laptop_i8042_filter);
		cancel_delayed_work_sync(&msi_rfkill_work);
		rfkill_cleanup();
	}
	platform_device_del(msipf_device);

fail_platform_device1:

	platform_device_put(msipf_device);

fail_platform_driver:

	platform_driver_unregister(&msipf_driver);

fail_backlight:

	backlight_device_unregister(msibl_device);

	return ret;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:100,代码来源:msi-laptop.c

示例7: htc_headset_1wire_init

static int __init htc_headset_1wire_init(void)
{
	return platform_driver_register(&htc_headset_1wire_driver);
}
开发者ID:FrozenCow,项目名称:FIRE-ICE,代码行数:4,代码来源:htc_headset_one_wire.c

示例8: wifi_ctrlfunc_register_drv

static int wifi_ctrlfunc_register_drv(void)
{
	int err = 0;
	struct device *dev1, *dev2;
	wifi_adapter_info_t *adapter;

	dev1 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME, wifi_platdev_match);
	dev2 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME2, wifi_platdev_match);

#if !defined(CONFIG_DTS)
	if (!dts_enabled) {
		if (dev1 == NULL && dev2 == NULL) {
			DHD_ERROR(("no wifi platform data, skip\n"));
			return -ENXIO;
		}
	}
#endif /* !defined(CONFIG_DTS) */

	/* multi-chip support not enabled, build one adapter information for
	 * DHD (either SDIO, USB or PCIe)
	 */
	adapter = kzalloc(sizeof(wifi_adapter_info_t), GFP_KERNEL);
	if (adapter == NULL) {
		DHD_ERROR(("%s:adapter alloc failed", __FUNCTION__));
		return ENOMEM;
	}
	adapter->name = "DHD generic adapter";
	adapter->bus_type = -1;
	adapter->bus_num = -1;
	adapter->slot_num = -1;
	adapter->irq_num = -1;
	is_power_on = FALSE;
	wifi_plat_dev_probe_ret = 0;
	dhd_wifi_platdata = kzalloc(sizeof(bcmdhd_wifi_platdata_t), GFP_KERNEL);
	dhd_wifi_platdata->num_adapters = 1;
	dhd_wifi_platdata->adapters = adapter;

	if (dev1) {
		err = platform_driver_register(&wifi_platform_dev_driver);
		if (err) {
			DHD_ERROR(("%s: failed to register wifi ctrl func driver\n",
				__FUNCTION__));
			return err;
		}
	}
	if (dev2) {
		err = platform_driver_register(&wifi_platform_dev_driver_legacy);
		if (err) {
			DHD_ERROR(("%s: failed to register wifi ctrl func legacy driver\n",
				__FUNCTION__));
			return err;
		}
	}

#if !defined(CONFIG_DTS)
	if (dts_enabled) {
		struct resource *resource;
		adapter->wifi_plat_data = (void *)&dhd_wlan_control;
		resource = &dhd_wlan_resources;
		adapter->irq_num = resource->start;
		adapter->intr_flags = resource->flags & IRQF_TRIGGER_MASK;
		wifi_plat_dev_probe_ret = dhd_wifi_platform_load();
	}
#endif /* !defined(CONFIG_DTS) */


#ifdef CONFIG_DTS
	wifi_plat_dev_probe_ret = platform_driver_register(&wifi_platform_dev_driver);
#endif /* CONFIG_DTS */

	/* return probe function's return value if registeration succeeded */
	return wifi_plat_dev_probe_ret;
}
开发者ID:HRTKernel,项目名称:samsung_exynos_7420,代码行数:73,代码来源:dhd_linux_platdev.c

示例9: mdio_gpio_init

static int __init mdio_gpio_init(void)
{
	return platform_driver_register(&mdio_gpio_driver);
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:4,代码来源:mdio-gpio.c

示例10: mmi_factory_init

static int __init mmi_factory_init(void)
{
	return platform_driver_register(&mmi_factory_driver);
}
开发者ID:ReflexBow,项目名称:android_kernel_motorola_ghost,代码行数:4,代码来源:mmi-factory.c

示例11: hall_init

static int __init hall_init(void)
{
	printk("%s start\n", __func__);
	return platform_driver_register(&hall_device_driver);
}
开发者ID:Eudemony,项目名称:note4_kernel_test,代码行数:5,代码来源:hall.c

示例12: fimg2d_register

static int __init fimg2d_register(void)
{
	pr_info("%s", banner);
	return platform_driver_register(&fimg2d_driver);
}
开发者ID:Jovy23,项目名称:N920TUVU2COJ5_Kernel,代码行数:5,代码来源:fimg2d_drv.c

示例13: rk3036_tve_init

static int __init rk3036_tve_init(void)
{
	return platform_driver_register(&rk3036_tve_driver);
}
开发者ID:jack-ma,项目名称:popmetal-android-kernel-3.10,代码行数:4,代码来源:rk3036_tve.c

示例14: tegra_camera_init

static int __init tegra_camera_init(void)
{
	return platform_driver_register(&tegra_camera_driver);
}
开发者ID:LeeDroid-,项目名称:bricked-endeavoru,代码行数:4,代码来源:tegra_camera.c

示例15: pcf50633_regulator_init

static int __init pcf50633_regulator_init(void)
{
	return platform_driver_register(&pcf50633_regulator_driver);
}
开发者ID:Cool-Joe,项目名称:imx23-audio,代码行数:4,代码来源:pcf50633-regulator.c


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