本文整理汇总了C++中platform_get_drvdata函数的典型用法代码示例。如果您正苦于以下问题:C++ platform_get_drvdata函数的具体用法?C++ platform_get_drvdata怎么用?C++ platform_get_drvdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了platform_get_drvdata函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ieee802154fake_remove
static int ieee802154fake_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
unregister_netdev(dev);
return 0;
}
开发者ID:AiWinters,项目名称:linux,代码行数:6,代码来源:fakehard.c
示例2: pcsp_shutdown
static void pcsp_shutdown(struct platform_device *dev)
{
struct snd_pcsp *chip = platform_get_drvdata(dev);
pcsp_stop_beep(chip);
}
开发者ID:33d,项目名称:linux-2.6.21-hh20,代码行数:5,代码来源:pcsp.c
示例3: nvhost_gr3d_prepare_power_off
int nvhost_gr3d_prepare_power_off(struct platform_device *dev)
{
struct nvhost_device_data *pdata = platform_get_drvdata(dev);
return nvhost_channel_save_context(pdata->channel);
}
开发者ID:Lloir,项目名称:nvidia-linux-3.10,代码行数:5,代码来源:gr3d.c
示例4: pm8058_othc_probe
static int __devinit pm8058_othc_probe(struct platform_device *pd)
{
int rc;
struct pm8058_othc *dd;
struct pm8058_chip *chip;
struct resource *res;
struct pmic8058_othc_config_pdata *pdata = pd->dev.platform_data;
chip = platform_get_drvdata(pd);
if (chip == NULL) {
pr_err("Invalid driver information\n");
return -EINVAL;
}
/* Check PMIC8058 version. A0 version is not supported */
if (pm8058_rev(chip) == PM_8058_REV_1p0) {
pr_err("PMIC8058 version not supported\n");
return -ENODEV;
}
if (pdata == NULL) {
pr_err("Platform data not present\n");
return -EINVAL;
}
dd = kzalloc(sizeof(*dd), GFP_KERNEL);
if (dd == NULL) {
pr_err("Unable to allocate memory\n");
return -ENOMEM;
}
/* Enable runtime PM ops, start in ACTIVE mode */
rc = pm_runtime_set_active(&pd->dev);
if (rc < 0)
dev_dbg(&pd->dev, "unable to set runtime pm state\n");
pm_runtime_enable(&pd->dev);
res = platform_get_resource_byname(pd, IORESOURCE_IO, "othc_base");
if (res == NULL) {
pr_err("othc resource:Base address absent\n");
rc = -ENXIO;
goto fail_get_res;
}
dd->othc_pdata = pdata;
dd->pm_chip = chip;
dd->othc_base = res->start;
platform_set_drvdata(pd, dd);
if (pdata->micbias_capability == OTHC_MICBIAS_HSED) {
/* HSED to be supported on this MICBIAS line */
if (pdata->hsed_config != NULL) {
rc = othc_configure_hsed(dd, pd);
if (rc < 0)
goto fail_get_res;
} else {
pr_err("HSED config data not present\n");
rc = -EINVAL;
goto fail_get_res;
}
}
/* Store the local driver data structure */
if (dd->othc_pdata->micbias_select < OTHC_MICBIAS_MAX)
config[dd->othc_pdata->micbias_select] = dd;
pr_debug("Device %s:%d successfully registered\n",
pd->name, pd->id);
return 0;
fail_get_res:
pm_runtime_set_suspended(&pd->dev);
pm_runtime_disable(&pd->dev);
kfree(dd);
return rc;
}
开发者ID:Alex163,项目名称:htc-kernel-pyramid,代码行数:78,代码来源:pmic8058-othc.c
示例5: zmii_attach
int zmii_attach(struct platform_device *ofdev, int input, int *mode)
{
struct zmii_instance *dev = platform_get_drvdata(ofdev);
struct zmii_regs __iomem *p = dev->base;
ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode);
if (!zmii_valid_mode(*mode)) {
/* Probably an EMAC connected to RGMII,
* but it still may need ZMII for MDIO so
* we don't fail here.
*/
dev->users++;
return 0;
}
mutex_lock(&dev->lock);
/* Autodetect ZMII mode if not specified.
* This is only for backward compatibility with the old driver.
* Please, always specify PHY mode in your board port to avoid
* any surprises.
*/
if (dev->mode == PHY_MODE_NA) {
if (*mode == PHY_MODE_NA) {
u32 r = dev->fer_save;
ZMII_DBG(dev, "autodetecting mode, FER = 0x%08x" NL, r);
if (r & (ZMII_FER_MII(0) | ZMII_FER_MII(1)))
dev->mode = PHY_MODE_MII;
else if (r & (ZMII_FER_RMII(0) | ZMII_FER_RMII(1)))
dev->mode = PHY_MODE_RMII;
else
dev->mode = PHY_MODE_SMII;
} else
dev->mode = *mode;
printk(KERN_NOTICE "%s: bridge in %s mode\n",
ofdev->dev.of_node->full_name,
zmii_mode_name(dev->mode));
} else {
/* All inputs must use the same mode */
if (*mode != PHY_MODE_NA && *mode != dev->mode) {
printk(KERN_ERR
"%s: invalid mode %d specified for input %d\n",
ofdev->dev.of_node->full_name, *mode, input);
mutex_unlock(&dev->lock);
return -EINVAL;
}
}
/* Report back correct PHY mode,
* it may be used during PHY initialization.
*/
*mode = dev->mode;
/* Enable this input */
out_be32(&p->fer, in_be32(&p->fer) | zmii_mode_mask(dev->mode, input));
++dev->users;
mutex_unlock(&dev->lock);
return 0;
}
开发者ID:383530895,项目名称:linux,代码行数:65,代码来源:zmii.c
示例6: pil_q6v3_driver_exit
static int __devexit pil_q6v3_driver_exit(struct platform_device *pdev)
{
struct q6v3_data *drv = platform_get_drvdata(pdev);
msm_pil_unregister(drv->pil);
return 0;
}
开发者ID:jshafer817,项目名称:sailfish_kernel_hp_tenderloin,代码行数:6,代码来源:pil-q6v3.c
示例7: exynos4x12_tmu_irq_handler
//.........这里部分代码省略.........
err_sysfs_file3:
device_remove_file(&pdev->dev, &dev_attr_tmu_state);
err_sysfs_file2:
device_remove_file(&pdev->dev, &dev_attr_temperature);
err_sysfs_file1:
if (info->irq >= 0)
free_irq(info->irq, info);
err_irq:
destroy_workqueue(tmu_monitor_wq);
err_wq:
iounmap(info->tmu_base);
err_nomap:
release_resource(info->ioarea);
kfree(info->ioarea);
err_nores:
kfree(info);
info = NULL;
err_nomem:
dev_err(&pdev->dev, "initialization failed.\n");
return ret;
}
static int __devinit s5p_tmu_remove(struct platform_device *pdev)
{
struct s5p_tmu_info *info = platform_get_drvdata(pdev);
cancel_delayed_work(&info->polling);
destroy_workqueue(tmu_monitor_wq);
device_remove_file(&pdev->dev, &dev_attr_temperature);
device_remove_file(&pdev->dev, &dev_attr_tmu_state);
if (info->irq >= 0)
free_irq(info->irq, info);
iounmap(info->tmu_base);
release_resource(info->ioarea);
kfree(info->ioarea);
kfree(info);
info = NULL;
pr_info("%s is removed\n", dev_name(&pdev->dev));
return 0;
}
#ifdef CONFIG_PM
static int s5p_tmu_suspend(struct platform_device *pdev, pm_message_t state)
{
struct s5p_tmu_info *info = platform_get_drvdata(pdev);
if (!info)
return -EAGAIN;
/* save register value */
info->reg_save[0] = __raw_readl(info->tmu_base + EXYNOS4_TMU_CONTROL);
开发者ID:Entropy512,项目名称:I9300_N8013_Changes,代码行数:67,代码来源:tmu.c
示例8: gpu_resume
static int gpu_resume(struct platform_device *dev)
{
gceSTATUS status;
gckGALDEVICE device;
gctINT i;
gceCHIPPOWERSTATE statesStored;
device = platform_get_drvdata(dev);
for (i = 0; i < gcdMAX_GPU_COUNT; i++)
{
if (device->kernels[i] != gcvNULL)
{
#if gcdENABLE_VG
if (i == gcvCORE_VG)
{
status = gckVGHARDWARE_SetPowerManagementState(device->kernels[i]->vg->hardware, gcvPOWER_ON);
}
else
#endif
{
status = gckHARDWARE_SetPowerManagementState(device->kernels[i]->hardware, gcvPOWER_ON);
}
if (gcmIS_ERROR(status))
{
return -1;
}
/* Convert global state to crossponding internal state. */
switch(device->statesStored[i])
{
case gcvPOWER_OFF:
statesStored = gcvPOWER_OFF_BROADCAST;
break;
case gcvPOWER_IDLE:
statesStored = gcvPOWER_IDLE_BROADCAST;
break;
case gcvPOWER_SUSPEND:
statesStored = gcvPOWER_SUSPEND_BROADCAST;
break;
case gcvPOWER_ON:
statesStored = gcvPOWER_ON_AUTO;
break;
default:
statesStored = device->statesStored[i];
break;
}
/* Restore states. */
#if gcdENABLE_VG
if (i == gcvCORE_VG)
{
status = gckVGHARDWARE_SetPowerManagementState(device->kernels[i]->vg->hardware, statesStored);
}
else
#endif
{
status = gckHARDWARE_SetPowerManagementState(device->kernels[i]->hardware, statesStored);
}
if (gcmIS_ERROR(status))
{
return -1;
}
}
}
return 0;
}
开发者ID:develersrl,项目名称:winmate-kernel,代码行数:70,代码来源:gc_hal_kernel_driver.c
示例9: dtv_probe
static int dtv_probe(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
struct fb_info *fbi;
struct platform_device *mdp_dev = NULL;
struct msm_fb_panel_data *pdata = NULL;
int rc;
if (pdev->id == 0) {
dtv_pdata = pdev->dev.platform_data;
#ifdef CONFIG_MSM_BUS_SCALING
if (!dtv_bus_scale_handle && dtv_pdata &&
dtv_pdata->bus_scale_table) {
dtv_bus_scale_handle =
msm_bus_scale_register_client(
dtv_pdata->bus_scale_table);
if (!dtv_bus_scale_handle) {
pr_err("%s not able to get bus scale\n",
__func__);
}
}
#else
ebi1_clk = clk_get(&pdev->dev, "mem_clk");
if (IS_ERR(ebi1_clk)) {
ebi1_clk = NULL;
pr_warning("%s: Couldn't get ebi1 clock\n", __func__);
}
#endif
tv_src_clk = clk_get(&pdev->dev, "src_clk");
if (IS_ERR(tv_src_clk)) {
pr_err("error: can't get tv_src_clk!\n");
return IS_ERR(tv_src_clk);
}
hdmi_clk = clk_get(&pdev->dev, "hdmi_clk");
if (IS_ERR(hdmi_clk)) {
pr_err("error: can't get hdmi_clk!\n");
return IS_ERR(hdmi_clk);
}
mdp_tv_clk = clk_get(&pdev->dev, "mdp_clk");
if (IS_ERR(mdp_tv_clk))
mdp_tv_clk = NULL;
return 0;
}
dtv_work_queue = create_singlethread_workqueue("dtv_work");
INIT_WORK(&dtv_off_work, dtv_off_work_func);
mfd = platform_get_drvdata(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
if (pdev_list_cnt >= MSM_FB_MAX_DEV_LIST)
return -ENOMEM;
mdp_dev = platform_device_alloc("mdp", pdev->id);
if (!mdp_dev)
return -ENOMEM;
/*
* link to the latest pdev
*/
mfd->pdev = mdp_dev;
mfd->dest = DISPLAY_LCDC;
/*
* alloc panel device data
*/
if (platform_device_add_data
(mdp_dev, pdev->dev.platform_data,
sizeof(struct msm_fb_panel_data))) {
pr_err("dtv_probe: platform_device_add_data failed!\n");
platform_device_put(mdp_dev);
return -ENOMEM;
}
/*
* data chain
*/
pdata = (struct msm_fb_panel_data *)mdp_dev->dev.platform_data;
pdata->on = dtv_on;
pdata->off = dtv_off;
pdata->next = pdev;
/*
* get/set panel specific fb info
*/
mfd->panel_info = pdata->panel_info;
if (hdmi_prim_display)
mfd->fb_imgType = MSMFB_DEFAULT_TYPE;
else
mfd->fb_imgType = MDP_RGB_565;
fbi = mfd->fbi;
fbi->var.pixclock = mfd->panel_info.clk_rate;
fbi->var.left_margin = mfd->panel_info.lcdc.h_back_porch;
//.........这里部分代码省略.........
开发者ID:ISTweak,项目名称:android_kernel_sony_blue_hayabusa,代码行数:101,代码来源:mdp4_dtv.c
示例10: ufshcd_pltfrm_shutdown
void ufshcd_pltfrm_shutdown(struct platform_device *pdev)
{
ufshcd_shutdown((struct ufs_hba *)platform_get_drvdata(pdev));
}
开发者ID:020gzh,项目名称:linux,代码行数:4,代码来源:ufshcd-pltfrm.c
示例11: pcf50633_mbc_usb_curlim_set
int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
{
struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
int ret = 0;
u8 bits;
u8 mbcs2, chgmod;
unsigned int mbcc5;
if (ma >= 1000) {
bits = PCF50633_MBCC7_USB_1000mA;
ma = 1000;
} else if (ma >= 500) {
bits = PCF50633_MBCC7_USB_500mA;
ma = 500;
} else if (ma >= 100) {
bits = PCF50633_MBCC7_USB_100mA;
ma = 100;
} else {
bits = PCF50633_MBCC7_USB_SUSPEND;
ma = 0;
}
ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC7,
PCF50633_MBCC7_USB_MASK, bits);
if (ret)
dev_err(pcf->dev, "error setting usb curlim to %d mA\n", ma);
else
dev_info(pcf->dev, "usb curlim to %d mA\n", ma);
/*
* We limit the charging current to be the USB current limit.
* The reason is that on pcf50633, when it enters PMU Standby mode,
* which it does when the device goes "off", the USB current limit
* reverts to the variant default. In at least one common case, that
* default is 500mA. By setting the charging current to be the same
* as the USB limit we set here before PMU standby, we enforce it only
* using the correct amount of current even when the USB current limit
* gets reset to the wrong thing
*/
if (mbc->pcf->pdata->charger_reference_current_ma) {
mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma;
if (mbcc5 > 255)
mbcc5 = 255;
pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5);
}
mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2);
chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK);
/* If chgmod == BATFULL, setting chgena has no effect.
* Datasheet says we need to set resume instead but when autoresume is
* used resume doesn't work. Clear and set chgena instead.
*/
if (chgmod != PCF50633_MBCS2_MBC_BAT_FULL)
pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
else {
pcf50633_reg_clear_bits(pcf, PCF50633_REG_MBCC1,
PCF50633_MBCC1_CHGENA);
pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
}
power_supply_changed(mbc->usb);
return ret;
}
开发者ID:Lyude,项目名称:linux,代码行数:68,代码来源:pcf50633-charger.c
示例12: store_ehci_power
static ssize_t store_ehci_power(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
struct s5p_ehci_hcd *s5p_ehci = platform_get_drvdata(pdev);
struct usb_hcd *hcd = s5p_ehci->hcd;
int power_on;
int irq;
int retval;
if (sscanf(buf, "%d", &power_on) != 1)
return -EINVAL;
device_lock(dev);
if (!power_on && s5p_ehci->power_on) {
printk(KERN_DEBUG "%s: EHCI turns off\n", __func__);
pm_runtime_forbid(dev);
s5p_ehci->power_on = 0;
usb_remove_hcd(hcd);
if (pdata && pdata->phy_exit)
pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB)
/*HSIC IPC control the ACTIVE_STATE*/
if (pdata && pdata->noti_host_states)
pdata->noti_host_states(pdev, S5P_HOST_OFF);
#endif
} else if (power_on) {
printk(KERN_DEBUG "%s: EHCI turns on\n", __func__);
if (s5p_ehci->power_on) {
pm_runtime_forbid(dev);
usb_remove_hcd(hcd);
#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB)
/*HSIC IPC control the ACTIVE_STATE*/
if (pdata && pdata->noti_host_states)
pdata->noti_host_states(pdev, S5P_HOST_OFF);
#endif
} else
s5p_ehci_phy_init(pdev);
irq = platform_get_irq(pdev, 0);
retval = usb_add_hcd(hcd, irq,
IRQF_DISABLED | IRQF_SHARED);
if (retval < 0) {
dev_err(dev, "Power On Fail\n");
goto exit;
}
s5p_ehci->power_on = 1;
#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB)
/* Sometimes XMM6262 send remote wakeup when hub enter suspend
* So, set the hub waiting 500ms autosuspend delay*/
if (hcd->self.root_hub)
pm_runtime_set_autosuspend_delay(
&hcd->self.root_hub->dev,
msecs_to_jiffies(500));
/*HSIC IPC control the ACTIVE_STATE*/
if (pdata && pdata->noti_host_states)
pdata->noti_host_states(pdev, S5P_HOST_ON);
#endif
pm_runtime_allow(dev);
}
exit:
device_unlock(dev);
return count;
}
开发者ID:ARMP,项目名称:ARMP-i9300,代码行数:71,代码来源:ehci-s5p.c
示例13: rpckbd_remove
static int __devexit rpckbd_remove(struct platform_device *dev)
{
struct serio *serio = platform_get_drvdata(dev);
serio_unregister_port(serio);
return 0;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:6,代码来源:rpckbd.c
示例14: snd_virmidi_remove
static int __devexit snd_virmidi_remove(struct platform_device *devptr)
{
snd_card_free(platform_get_drvdata(devptr));
platform_set_drvdata(devptr, NULL);
return 0;
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:6,代码来源:virmidi.c
示例15: mdp4_dtv_off
int mdp4_dtv_off(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
int ret = 0;
int cndx = 0;
int undx;
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
struct vsync_update *vp;
int mixer = 0;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
mutex_lock(&mfd->dma->ov_mutex);
vctrl = &vsync_ctrl_db[cndx];
mdp4_dtv_wait4vsync(cndx);
wake_up_interruptible_all(&vctrl->wait_queue);
pipe = vctrl->base_pipe;
if (pipe != NULL) {
mixer = pipe->mixer_num;
/* sanity check, free pipes besides base layer */
mdp4_overlay_unset_mixer(mixer);
if (hdmi_prim_display && mfd->ref_cnt == 0) {
/* adb stop */
if (pipe->pipe_type == OVERLAY_TYPE_BF)
mdp4_overlay_borderfill_stage_down(pipe);
/* pipe == rgb2 */
vctrl->base_pipe = NULL;
} else {
mdp4_mixer_stage_down(pipe, 1);
mdp4_overlay_pipe_free(pipe, 1);
vctrl->base_pipe = NULL;
}
}
mdp4_dtv_tg_off(vctrl);
atomic_set(&vctrl->suspend, 1);
mdp4_overlay_panel_mode_unset(MDP4_MIXER1, MDP4_PANEL_DTV);
undx = vctrl->update_ndx;
vp = &vctrl->vlist[undx];
if (vp->update_cnt) {
/*
* pipe's iommu will be freed at next overlay play
* and iommu_drop statistic will be increased by one
*/
pr_warn("%s: update_cnt=%d\n", __func__, vp->update_cnt);
mdp4_dtv_pipe_clean(vp);
}
ret = panel_next_off(pdev);
mdp_footswitch_ctrl(FALSE);
/*
* clean up ion freelist
* there need two stage to empty ion free list
* therefore need call unmap freelist twice
*/
mdp4_overlay_iommu_unmap_freelist(mixer);
mdp4_overlay_iommu_unmap_freelist(mixer);
/* Mdp clock disable */
mdp_clk_ctrl(0);
mutex_unlock(&mfd->dma->ov_mutex);
pr_info("%s:\n", __func__);
return ret;
}
开发者ID:davidmueller13,项目名称:efficientkernel,代码行数:76,代码来源:mdp4_overlay_dtv.c
示例16: lcdc_probe
static int lcdc_probe(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
struct fb_info *fbi;
struct platform_device *mdp_dev = NULL;
struct msm_fb_panel_data *pdata = NULL;
int rc;
if (pdev->id == 0) {
lcdc_pdata = pdev->dev.platform_data;
return 0;
}
mfd = platform_get_drvdata(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
if (pdev_list_cnt >= MSM_FB_MAX_DEV_LIST)
return -ENOMEM;
mdp_dev = platform_device_alloc("mdp", pdev->id);
if (!mdp_dev)
return -ENOMEM;
/*
* link to the latest pdev
*/
mfd->pdev = mdp_dev;
mfd->dest = DISPLAY_LCDC;
/*
* alloc panel device data
*/
if (platform_device_add_data
(mdp_dev, pdev->dev.platform_data,
sizeof(struct msm_fb_panel_data))) {
printk(KERN_ERR "lcdc_probe: platform_device_add_data failed!\n");
platform_device_put(mdp_dev);
return -ENOMEM;
}
/*
* data chain
*/
pdata = (struct msm_fb_panel_data *)mdp_dev->dev.platform_data;
pdata->on = lcdc_on;
pdata->off = lcdc_off;
pdata->next = pdev;
/*
* get/set panel specific fb info
*/
mfd->panel_info = pdata->panel_info;
#ifdef CONFIG_MSM_FB_RGB565
#ifdef MSMFB_FRAMEBUF_32
mfd->fb_imgType = MDP_RGBA_8888;
#else
mfd->fb_imgType = MDP_RGB_565;
#endif
#else
mfd->fb_imgType = MDP_ARGB_8888;
#endif
fbi = mfd->fbi;
fbi->var.pixclock = mfd->panel_info.clk_rate;
fbi->var.left_margin = mfd->panel_info.lcdc.h_back_porch;
fbi->var.right_margin = mfd->panel_info.lcdc.h_front_porch;
fbi->var.upper_margin = mfd->panel_info.lcdc.v_back_porch;
fbi->var.lower_margin = mfd->panel_info.lcdc.v_front_porch;
fbi->var.hsync_len = mfd->panel_info.lcdc.h_pulse_width;
fbi->var.vsync_len = mfd->panel_info.lcdc.v_pulse_width;
/*
* set driver data
*/
platform_set_drvdata(mdp_dev, mfd);
/*
* register in mdp driver
*/
rc = platform_device_add(mdp_dev);
if (rc)
goto lcdc_probe_err;
pdev_list[pdev_list_cnt++] = pdev;
return 0;
lcdc_probe_err:
platform_device_put(mdp_dev);
return rc;
}
开发者ID:Sikyou,项目名称:s7_kernel,代码行数:95,代码来源:lcdc.c
示例17: earjack_debugger_shutdown
static void earjack_debugger_shutdown(struct platform_device *pdev)
{
struct earjack_debugger_device *adev = platform_get_drvdata(pdev);
disable_irq(adev->irq);
}
开发者ID:TheRealTruth,项目名称:LGLS995_Gflex_Kikat_ZV9_Kernel,代码行数:6,代码来源:lge_earjack_debugger.c
示例18: uhci_hcd_platform_shutdown
/* Make sure the controller is quiescent and that we're not using it
* any more. This is mainly for the benefit of programs which, like kexec,
* expect the hardware to be idle: not doing DMA or generating IRQs.
*
* This routine may be called in a damaged or failing kernel. Hence we
* do not acquire the spinlock before shutting down the controller.
*/
static void uhci_hcd_platform_shutdown(struct platform_device *op)
{
struct usb_hcd *hcd = platform_get_drvdata(op);
uhci_hc_died(hcd_to_uhci(hcd));
}
开发者ID:19Dan01,项目名称:linux,代码行数:13,代码来源:uhci-platform.c
示例19: omap_mcbsp_init
int __devinit omap_mcbsp_init(struct platform_device *pdev)
{
struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
struct resource *res;
int ret = 0;
spin_lock_init(&mcbsp->lock);
mcbsp->free = true;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
if (!res) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(mcbsp->dev, "invalid memory resource\n");
return -ENOMEM;
}
}
if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
dev_name(&pdev->dev))) {
dev_err(mcbsp->dev, "memory region already claimed\n");
return -ENODEV;
}
mcbsp->phys_base = res->start;
mcbsp->reg_cache_size = resource_size(res);
mcbsp->io_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!mcbsp->io_base)
return -ENOMEM;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
if (!res)
mcbsp->phys_dma_base = mcbsp->phys_base;
else
mcbsp->phys_dma_base = res->start;
mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx");
mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx");
if (mcbsp->tx_irq == -ENXIO) {
mcbsp->tx_irq = platform_get_irq(pdev, 0);
mcbsp->rx_irq = 0;
}
res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
if (!res) {
dev_err(&pdev->dev, "invalid rx DMA channel\n");
return -ENODEV;
}
mcbsp->dma_data[1].name = "Audio Capture";
mcbsp->dma_data[1].dma_req = res->start;
mcbsp->dma_data[1].port_addr = omap_mcbsp_dma_reg_params(mcbsp, 1);
res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
if (!res) {
dev_err(&pdev->dev, "invalid tx DMA channel\n");
return -ENODEV;
}
mcbsp->dma_data[0].name = "Audio Playback";
mcbsp->dma_data[0].dma_req = res->start;
mcbsp->dma_data[0].port_addr = omap_mcbsp_dma_reg_params(mcbsp, 0);
mcbsp->fclk = clk_get(&pdev->dev, "fck");
if (IS_ERR(mcbsp->fclk)) {
ret = PTR_ERR(mcbsp->fclk);
dev_err(mcbsp->dev, "unable to get fck: %d\n", ret);
return ret;
}
mcbsp->dma_op_mode = MCBSP_DMA_MODE_ELEMENT;
if (mcbsp->pdata->buffer_size) {
mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10;
mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10;
ret = sysfs_create_group(&mcbsp->dev->kobj,
&additional_attr_group);
if (ret) {
dev_err(mcbsp->dev,
"Unable to create additional controls\n");
goto err_thres;
}
} else {
mcbsp->max_tx_thres = -EINVAL;
mcbsp->max_rx_thres = -EINVAL;
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sidetone");
if (res) {
ret = omap_st_add(mcbsp, res);
if (ret) {
dev_err(mcbsp->dev,
"Unable to create sidetone controls\n");
goto err_st;
}
}
return 0;
//.........这里部分代码省略.........
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:101,代码来源:mcbsp.c
示例20: mdp4_dtv_on
int mdp4_dtv_on(struct platform_device *pdev)
{
int dtv_width;
int dtv_height;
int dtv_bpp;
int dtv_border_clr;
int dtv_underflow_clr;
int dtv_hsync_skew;
int hsync_period;
int hsync_ctrl;
int vsync_period;
int display_hctl;
int display_v_start;
int display_v_end;
int active_hctl;
int active_h_start;
int active_h_end;
int active_v_start;
int active_v_end;
int ctrl_polarity;
int h_back_porch;
int h_front_porch;
int v_back_porch;
int v_front_porch;
int hsync_pulse_width;
int vsync_pulse_width;
int hsync_polarity;
int vsync_polarity;
int data_en_polarity;
int hsync_start_x;
int hsync_end_x;
uint8 *buf;
int bpp, ptype;
uint32 format;
struct fb_info *fbi;
struct fb_var_screeninfo *var;
struct msm_fb_data_type *mfd;
struct mdp4_overlay_pipe *pipe;
int ret;
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
if (!mfd)
return -ENODEV;
if (mfd->key != MFD_KEY)
return -EINVAL;
fbi = mfd->fbi;
var = &fbi->var;
bpp = fbi->var.bits_per_pixel / 8;
buf = (uint8 *) fbi->fix.smem_start;
buf += fbi->var.xoffset * bpp +
fbi->var.yoffset * fbi->fix.line_length;
if (bpp == 2)
format = MDP_RGB_565;
else if (bpp == 3)
format = MDP_RGB_888;
else
format = MDP_ARGB_8888;
if (dtv_pipe == NULL) {
ptype = mdp4_overlay_format2type(format);
if (ptype < 0)
printk(KERN_INFO "%s: format2type failed\n", __func__);
pipe = mdp4_overlay_pipe_alloc(ptype, MDP4_MIXER1, 0);
if (pipe == NULL) {
printk(KERN_INFO "%s: pipe_alloc failed\n", __func__);
return -EBUSY;
}
pipe->pipe_used++;
pipe->mixer_stage = MDP4_MIXER_STAGE_BASE;
pipe->mixer_num = MDP4_MIXER1;
pipe->src_format = format;
mdp4_overlay_panel_mode(pipe->mixer_num, MDP4_PANEL_DTV);
ret = mdp4_overlay_format2pipe(pipe);
if (ret < 0)
printk(KERN_INFO "%s: format2type failed\n", __func__);
dtv_pipe = pipe; /* keep it */
} else {
pipe = dtv_pipe;
}
/* MDP cmd block enable */
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
pipe->src_height = fbi->var.yres;
pipe->src_width = fbi->var.xres;
pipe->src_h = fbi->var.yres;
pipe->src_w = fbi->var.xres;
pipe->src_y = 0;
pipe->src_x = 0;
pipe->srcp0_addr = (uint32) buf;
pipe->srcp0_ystride = fbi->fix.line_length;
mdp4_overlay_dmae_xy(pipe); /* dma_e */
//.........这里部分代码省略.........
开发者ID:RepoBackups,项目名称:bricked-shooteru-ics-sense,代码行数:101,代码来源:mdp4_overlay_dtv.c
注:本文中的platform_get_drvdata函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论