Example #1
0
static int __init ps3_register_sound_devices(void)
{
    int result;
    struct layout {
        struct ps3_system_bus_device dev;
        struct ps3_dma_region d_region;
        struct ps3_mmio_region m_region;
    } *p;

    pr_debug(" -> %s:%d\n", __func__, __LINE__);

    p = kzalloc(sizeof(*p), GFP_KERNEL);
    if (!p)
        return -ENOMEM;

    p->dev.match_id = PS3_MATCH_ID_SOUND;
    p->dev.dev_type = PS3_DEVICE_TYPE_IOC0;
    p->dev.d_region = &p->d_region;
    p->dev.m_region = &p->m_region;

    result = ps3_system_bus_device_register(&p->dev);

    if (result)
        pr_debug("%s:%d ps3_system_bus_device_register failed\n",
                 __func__, __LINE__);

    pr_debug(" <- %s:%d\n", __func__, __LINE__);
    return result;
}
Example #2
0
static int mtk_uldlloopbackpcm_close(struct snd_pcm_substream *substream)
{
    pr_debug("%s \n", __func__);
    if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
    {
        pr_debug("%s  with SNDRV_PCM_STREAM_CAPTURE \n", __func__);
        return 0;
    }

    // interconnection setting
    SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I03, Soc_Aud_InterConnectionOutput_O00);
    SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I04, Soc_Aud_InterConnectionOutput_O01);
    SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I03, Soc_Aud_InterConnectionOutput_O03);
    SetConnection(Soc_Aud_InterCon_DisConnect, Soc_Aud_InterConnectionInput_I04, Soc_Aud_InterConnectionOutput_O04);

    // stop I2S
    Afe_Set_Reg(AFE_I2S_CON3, 0x0, 0x1);
    SetMemoryPathEnable(Soc_Aud_Digital_Block_I2S_OUT_DAC, false);
    SetMemoryPathEnable(Soc_Aud_Digital_Block_I2S_IN_ADC, false);

    EnableAfe (false);

    AudDrv_Clk_Off();
    AudDrv_ADC_Clk_Off();

    return 0;
}
Example #3
0
static int __init ps3_setup_vuart_device(enum ps3_match_id match_id,
        unsigned int port_number)
{
    int result;
    struct layout {
        struct ps3_system_bus_device dev;
    } *p;

    pr_debug(" -> %s:%d: match_id %u, port %u\n", __func__, __LINE__,
             match_id, port_number);

    p = kzalloc(sizeof(struct layout), GFP_KERNEL);

    if (!p)
        return -ENOMEM;

    p->dev.match_id = match_id;
    p->dev.dev_type = PS3_DEVICE_TYPE_VUART;
    p->dev.port_number = port_number;

    result = ps3_system_bus_device_register(&p->dev);

    if (result)
        pr_debug("%s:%d ps3_system_bus_device_register failed\n",
                 __func__, __LINE__);

    pr_debug(" <- %s:%d\n", __func__, __LINE__);
    return result;
}
Example #4
0
static int sffsdr_hw_params(struct snd_pcm_substream *substream,
                            struct snd_pcm_hw_params *params)
{
    struct snd_soc_pcm_runtime *rtd = substream->private_data;
    struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
    int fs;
    int ret = 0;

    /* Fsref can be 32000, 44100 or 48000. */
    fs = params_rate(params);

#ifndef CONFIG_SFFSDR_FPGA
    /* Without the FPGA module, the Fs is fixed at 44100 Hz */
    if (fs != 44100) {
        pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n");
        return -EINVAL;
    }
#endif

    /* set cpu DAI configuration */
    ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
    if (ret < 0)
        return ret;

    pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);

#ifndef CONFIG_SFFSDR_FPGA
    return 0;
#else
    return sffsdr_fpga_set_codec_fs(fs);
#endif
}
Example #5
0
static int __init ps3_register_devices(void)
{
    int result;

    if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
        return -ENODEV;

    pr_debug(" -> %s:%d\n", __func__, __LINE__);

    /* ps3_repository_dump_bus_info(); */

    result = ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);

    ps3_register_vuart_devices();

    ps3_register_graphics_devices();

    ps3_repository_find_devices(PS3_BUS_TYPE_SB,
                                ps3_register_repository_device);

    ps3_register_sound_devices();

    pr_debug(" <- %s:%d\n", __func__, __LINE__);
    return 0;
}
static void gs_close(struct tty_struct *tty, struct file *file)
{
    struct gs_port *port = tty->driver_data;
    struct gserial	*gser;

    spin_lock_irq(&port->port_lock);

    if (port->port.count != 1) {
        if (port->port.count == 0)
            WARN_ON(1);
        else
            --port->port.count;
        goto exit;
    }

    pr_debug("gs_close: ttyGS%d (%p,%p) ...\n", port->port_num, tty, file);

    /* mark port as closing but in use; we can drop port lock
     * and sleep if necessary
     */
    port->openclose = true;
    port->port.count = 0;

    gser = port->port_usb;
    if (gser && gser->disconnect)
        gser->disconnect(gser);

    /* wait for circular write buffer to drain, disconnect, or at
     * most GS_CLOSE_TIMEOUT seconds; then discard the rest
     */
    if (gs_buf_data_avail(&port->port_write_buf) > 0 && gser) {
        spin_unlock_irq(&port->port_lock);
        wait_event_interruptible_timeout(port->drain_wait,
                                         gs_writes_finished(port),
                                         GS_CLOSE_TIMEOUT * HZ);
        spin_lock_irq(&port->port_lock);
        gser = port->port_usb;
    }

    /* Iff we're disconnected, there can be no I/O in flight so it's
     * ok to free the circular buffer; else just scrub it.  And don't
     * let the push tasklet fire again until we're re-opened.
     */
    if (gser == NULL)
        gs_buf_free(&port->port_write_buf);
    else
        gs_buf_clear(&port->port_write_buf);

    tty->driver_data = NULL;
    port->port.tty = NULL;

    port->openclose = false;

    pr_debug("gs_close: ttyGS%d (%p,%p) done!\n",
             port->port_num, tty, file);

    wake_up(&port->port.close_wait);
exit:
    spin_unlock_irq(&port->port_lock);
}
static int sprdfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fb)
{
    int32_t ret;
    struct sprdfb_device *dev = fb->par;

    /* dev->pending_addr = fb->fix.smem_start + fb->fix.line_length * var->yoffset; */
    pr_debug("sprdfb: [%s]\n", __FUNCTION__);

    /* wait for vsync done */
    dev->vsync_waiter ++;
    if (dev->ctrl->sync(dev) != 0) {/* time out??? disable ?? */
        dev->vsync_waiter = 0;
        /* dev->pending_addr = 0; */
        pr_debug("sprdfb can not do pan_display !!!!\n");
        return 0;
    }

    /* TODO: set pending address and do refreshing */
    /* dev->pending_addr = 0; */
    ret = dev->ctrl->refresh(dev);
    if (ret) {
        printk(KERN_ERR "sprdfb failed to refresh !!!!\n");
    }

    return 0;
}
static void toppoly_lcd_power(int on, struct fb_var_screeninfo *si)
{
    pr_debug("Toppoly LCD power\n");

    if (on) {
        pr_debug("on\n");
        gpio_set_value(EGPIO_MAGICIAN_TOPPOLY_POWER, 1);
        gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
        udelay(2000);
        gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
        udelay(2000);
        /* FIXME: enable LCDC here */
        udelay(2000);
        gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
        udelay(2000);
        gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
    } else {
        pr_debug("off\n");
        msleep(15);
        gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
        udelay(500);
        gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
        udelay(1000);
        gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
        gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
    }
}
static int throughput_set_target_fps(unsigned long arg)
{
    int disable;

    pr_debug("%s: target fps %lu requested\n", __func__, arg);

    disable = multiple_app_disable;

    if (disable) {
        pr_debug("%s: %d active apps, disabling fps usage\n",
                 __func__, throughput_active_app_count);
        return 0;
    }

    if (arg == 0)
        reset_target_frame_time();
    else {
        unsigned long frame_time = (1000000 / arg);

        if (frame_time > USHRT_MAX)
            frame_time = USHRT_MAX;

        target_frame_time = (unsigned short) frame_time;
    }

    return 0;
}
static void __init sec_logger_ram_console_init(void)
{
    const char *console[] = {
        "ram_console_write",
        "sec_log_buf_write",
    };
    int i;

    sec_platform_log_en = true;

    sec_logger_create_sysfs();

    for (i = 0; i < ARRAY_SIZE(console); i++) {
        sec_ram_console_write_ext =
            (void *)kallsyms_lookup_name(console[i]);

        if (sec_ram_console_write_ext) {
            pr_debug("(%s): init success - %s (0x%p)\n",
                     __func__, console[i], sec_ram_console_write_ext);
            return;
        }
    }

    pr_debug("(%s): init fail - printk\n", __func__);
}
static void samsung_lcd_power(int on, struct fb_var_screeninfo *si)
{
    pr_debug("Samsung LCD power\n");

    if (on) {
        pr_debug("on\n");
        if (system_rev < 3)
            gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 1);
        else
            gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
        mdelay(10);
        gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
        mdelay(10);
        gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
        mdelay(30);
        gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
        mdelay(10);
    } else {
        pr_debug("off\n");
        mdelay(10);
        gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
        mdelay(30);
        gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
        mdelay(10);
        gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
        mdelay(10);
        if (system_rev < 3)
            gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 0);
        else
            gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
    }
}
Example #12
0
static void mmc_bus_shutdown(struct device *dev)
{
    struct mmc_driver *drv = to_mmc_driver(dev->driver);
    struct mmc_card *card = mmc_dev_to_card(dev);
    struct mmc_host *host = card->host;
    int ret;

    if (!drv) {
        pr_debug("%s: %s: drv is NULL\n", dev_name(dev), __func__);
        return;
    }

    if (!card) {
        pr_debug("%s: %s: card is NULL\n", dev_name(dev), __func__);
        return;
    }

    if (dev->driver && drv->shutdown)
        drv->shutdown(card);

    if (host->bus_ops->shutdown) {
        ret = host->bus_ops->shutdown(host);
        if (ret)
            pr_warn("%s: error %d during shutdown\n",
                    mmc_hostname(host), ret);
    }
}
Example #13
0
static int __init ps3_register_vuart_devices(void)
{
    int result;
    unsigned int port_number;

    pr_debug(" -> %s:%d\n", __func__, __LINE__);

    result = ps3_repository_read_vuart_av_port(&port_number);
    if (result)
        port_number = 0; /* av default */

    result = ps3_setup_vuart_device(PS3_MATCH_ID_AV_SETTINGS, port_number);
    WARN_ON(result);

    result = ps3_repository_read_vuart_sysmgr_port(&port_number);
    if (result)
        port_number = 2; /* sysmgr default */

    result = ps3_setup_vuart_device(PS3_MATCH_ID_SYSTEM_MANAGER,
                                    port_number);
    WARN_ON(result);

    pr_debug(" <- %s:%d\n", __func__, __LINE__);
    return result;
}
Example #14
0
static int __init ps3_register_graphics_devices(void)
{
    int result;
    struct layout {
        struct ps3_system_bus_device dev;
    } *p;

    pr_debug(" -> %s:%d\n", __func__, __LINE__);

    p = kzalloc(sizeof(struct layout), GFP_KERNEL);

    if (!p)
        return -ENOMEM;

    p->dev.match_id = PS3_MATCH_ID_GRAPHICS;
    p->dev.dev_type = PS3_DEVICE_TYPE_IOC0;

    result = ps3_system_bus_device_register(&p->dev);

    if (result)
        pr_debug("%s:%d ps3_system_bus_device_register failed\n",
                 __func__, __LINE__);

    pr_debug(" <- %s:%d\n", __func__, __LINE__);
    return result;
}
Example #15
0
static int __init ohci_hcd_ppc_soc_init(void)
{
    pr_debug(DRIVER_INFO " (PPC SOC)\n");
    pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed),
             sizeof(struct td));

    return platform_driver_register(&ohci_hcd_ppc_soc_driver);
}
Example #16
0
static void
mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{
#ifdef CONFIG_MMC_DEBUG
    unsigned int i, sz;
    struct scatterlist *sg;
#endif

    pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
             mmc_hostname(host), mrq->cmd->opcode,
             mrq->cmd->arg, mrq->cmd->flags);

    if (mrq->data) {
        pr_debug("%s:     blksz %d blocks %d flags %08x "
                 "tsac %d ms nsac %d\n",
                 mmc_hostname(host), mrq->data->blksz,
                 mrq->data->blocks, mrq->data->flags,
                 mrq->data->timeout_ns / 1000000,
                 mrq->data->timeout_clks);
    }

    if (mrq->stop) {
        pr_debug("%s:     CMD%u arg %08x flags %08x\n",
                 mmc_hostname(host), mrq->stop->opcode,
                 mrq->stop->arg, mrq->stop->flags);
    }

    WARN_ON(!host->claimed);

    led_trigger_event(host->led, LED_FULL);

    mrq->cmd->error = 0;
    mrq->cmd->mrq = mrq;
    if (mrq->data) {
        BUG_ON(mrq->data->blksz > host->max_blk_size);
        BUG_ON(mrq->data->blocks > host->max_blk_count);
        BUG_ON(mrq->data->blocks * mrq->data->blksz >
               host->max_req_size);

#ifdef CONFIG_MMC_DEBUG
        sz = 0;
        for_each_sg(mrq->data->sg, sg, mrq->data->sg_len, i)
        sz += sg->length;
        BUG_ON(sz != mrq->data->blocks * mrq->data->blksz);
#endif

        mrq->cmd->data = mrq->data;
        mrq->data->error = 0;
        mrq->data->mrq = mrq;
        if (mrq->stop) {
            mrq->data->stop = mrq->stop;
            mrq->stop->error = 0;
            mrq->stop->mrq = mrq;
        }
    }
    host->ops->request(host, mrq);
}
Example #17
0
static int
lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
{
    u8 tmp;

    if (!uh)
        goto err;

    if (lowpan_fetch_skb_u8(skb, &tmp))
        goto err;

    if ((tmp & LOWPAN_NHC_UDP_MASK) == LOWPAN_NHC_UDP_ID) {
        pr_debug("UDP header uncompression\n");
        switch (tmp & LOWPAN_NHC_UDP_CS_P_11) {
        case LOWPAN_NHC_UDP_CS_P_00:
            memcpy(&uh->source, &skb->data[0], 2);
            memcpy(&uh->dest, &skb->data[2], 2);
            skb_pull(skb, 4);
            break;
        case LOWPAN_NHC_UDP_CS_P_01:
            memcpy(&uh->source, &skb->data[0], 2);
            uh->dest =
                skb->data[2] + LOWPAN_NHC_UDP_8BIT_PORT;
            skb_pull(skb, 3);
            break;
        case LOWPAN_NHC_UDP_CS_P_10:
            uh->source = skb->data[0] + LOWPAN_NHC_UDP_8BIT_PORT;
            memcpy(&uh->dest, &skb->data[1], 2);
            skb_pull(skb, 3);
            break;
        case LOWPAN_NHC_UDP_CS_P_11:
            uh->source =
                LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0] >> 4);
            uh->dest =
                LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0] & 0x0f);
            skb_pull(skb, 1);
            break;
        default:
            pr_debug("ERROR: unknown UDP format\n");
            goto err;
        }

        pr_debug("uncompressed UDP ports: src = %d, dst = %d\n",
                 uh->source, uh->dest);

        /* copy checksum */
        memcpy(&uh->check, &skb->data[0], 2);
        skb_pull(skb, 2);

        /*
         * UDP lenght needs to be infered from the lower layers
         * here, we obtain the hint from the remaining size of the
         * frame
         */
        uh->len = htons(skb->len + sizeof(struct udphdr));
        pr_debug("uncompressed UDP length: src = %d", uh->len);
    } else {
static int nc_get_mute(int dev_id, u8 *value)
{
    int retval = 0, mask = 0;
    struct sc_reg_access sc_access = {0,};

    if (snd_pmic_ops_nc.card_status == SND_CARD_UN_INIT)
        retval = nc_init_card();
    if (retval)
        return retval;

    pr_debug("get mute::%d\n", dev_id);

    switch (dev_id) {
    case PMIC_SND_AMIC_MUTE:
        pr_debug("PMIC_SND_INPUT_MUTE_MIC1\n");
        sc_access.reg_addr = LILSEL;
        mask = MASK6;
        break;
    case PMIC_SND_HP_MIC_MUTE:
        pr_debug("PMIC_SND_INPUT_MUTE_MIC2\n");
        sc_access.reg_addr = LIRSEL;
        mask = MASK6;
        break;
    case PMIC_SND_LEFT_HP_MUTE:
    case PMIC_SND_RIGHT_HP_MUTE:
        mask = MASK2;
        pr_debug("PMIC_SN_LEFT/RIGHT_HP_MUTE\n");
        if (dev_id == PMIC_SND_RIGHT_HP_MUTE)
            sc_access.reg_addr = RMUTE;
        else
            sc_access.reg_addr = LMUTE;
        break;

    case PMIC_SND_LEFT_SPEAKER_MUTE:
        pr_debug("PMIC_MONO_EARPIECE_MUTE\n");
        sc_access.reg_addr = RMUTE;
        mask = MASK1;
        break;
    case PMIC_SND_DMIC_MUTE:
        pr_debug("PMIC_SND_INPUT_MUTE_DMIC\n");
        sc_access.reg_addr = 0x105;
        mask = MASK6;
        break;
    default:
        return -EINVAL;

    }
    retval = sst_sc_reg_access(&sc_access, PMIC_READ, 1);
    pr_debug("reg value = %d\n", sc_access.value);
    if (retval)
        return retval;
    *value = (sc_access.value) & mask;
    pr_debug("masked value = %d\n", *value);
    if (*value)
        *value = 0;
    else
        *value = 1;
    pr_debug("value returned = 0x%x\n", *value);
    return retval;
}
static int nc_set_vol(int dev_id, int value)
{
    struct sc_reg_access sc_access[3];
    int retval = 0, entries = 0;

    if (snd_pmic_ops_nc.card_status == SND_CARD_UN_INIT)
        retval = nc_init_card();
    if (retval)
        return retval;

    pr_debug("set volume:%d\n", dev_id);
    switch (dev_id) {
    case PMIC_SND_CAPTURE_VOL:
        pr_debug("PMIC_SND_CAPTURE_VOL:value::%d\n", value);
        sc_access[0].value = sc_access[1].value =
                                 sc_access[2].value = -value;
        sc_access[0].mask = sc_access[1].mask = sc_access[2].mask =
                (MASK0|MASK1|MASK2|MASK3|MASK4|MASK5);
        sc_access[0].reg_addr = 0x10a;
        sc_access[1].reg_addr = 0x109;
        sc_access[2].reg_addr = 0x105;
        entries = 3;
        break;

    case PMIC_SND_LEFT_PB_VOL:
        pr_debug("PMIC_SND_LEFT_HP_VOL %d\n", value);
        sc_access[0].value = -value;
        sc_access[0].reg_addr  = AUDIOLVOL;
        sc_access[0].mask =
            (MASK0|MASK1|MASK2|MASK3|MASK4|MASK5|MASK6);
        entries = 1;
        break;

    case PMIC_SND_RIGHT_PB_VOL:
        pr_debug("PMIC_SND_RIGHT_HP_VOL value %d\n", value);
        if (snd_pmic_ops_nc.num_channel == 1) {
            sc_access[0].value = 0x04;
            sc_access[0].reg_addr = RMUTE;
            sc_access[0].mask = MASK2;
        } else {
            sc_access[0].value = -value;
            sc_access[0].reg_addr  = AUDIORVOL;
            sc_access[0].mask =
                (MASK0|MASK1|MASK2|MASK3|MASK4|MASK5|MASK6);
            entries = 1;
        }
        break;

    default:
        return -EINVAL;

    }
    return sst_sc_reg_access(sc_access, PMIC_READ_MODIFY, entries);
}
Example #20
0
/* Uncompress function for multicast destination address,
 * when M bit is set.
 */
static int
lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
                                  struct in6_addr *ipaddr,
                                  const u8 dam)
{
    bool fail;

    switch (dam) {
    case LOWPAN_IPHC_DAM_00:
        /* 00:  128 bits.  The full address
         * is carried in-line.
         */
        fail = lowpan_fetch_skb(skb, ipaddr->s6_addr, 16);
        break;
    case LOWPAN_IPHC_DAM_01:
        /* 01:  48 bits.  The address takes
         * the form ffXX::00XX:XXXX:XXXX.
         */
        ipaddr->s6_addr[0] = 0xFF;
        fail = lowpan_fetch_skb(skb, &ipaddr->s6_addr[1], 1);
        fail |= lowpan_fetch_skb(skb, &ipaddr->s6_addr[11], 5);
        break;
    case LOWPAN_IPHC_DAM_10:
        /* 10:  32 bits.  The address takes
         * the form ffXX::00XX:XXXX.
         */
        ipaddr->s6_addr[0] = 0xFF;
        fail = lowpan_fetch_skb(skb, &ipaddr->s6_addr[1], 1);
        fail |= lowpan_fetch_skb(skb, &ipaddr->s6_addr[13], 3);
        break;
    case LOWPAN_IPHC_DAM_11:
        /* 11:  8 bits.  The address takes
         * the form ff02::00XX.
         */
        ipaddr->s6_addr[0] = 0xFF;
        ipaddr->s6_addr[1] = 0x02;
        fail = lowpan_fetch_skb(skb, &ipaddr->s6_addr[15], 1);
        break;
    default:
        pr_debug("DAM value has a wrong value: 0x%x\n", dam);
        return -EINVAL;
    }

    if (fail) {
        pr_debug("Failed to fetch skb data\n");
        return -EIO;
    }

    lowpan_raw_dump_inline(NULL, "Reconstructed ipv6 multicast addr is:\n",
                           ipaddr->s6_addr, 16);

    return 0;
}
Example #21
0
static int mtk_uldlloopback_probe(struct platform_device *pdev)
{
    pr_debug("mtk_uldlloopback_probe\n");
    if (pdev->dev.of_node)
    {
        dev_set_name(&pdev->dev, "%s", MT_SOC_ULDLLOOPBACK_PCM);
    }

    pr_debug("%s: dev name %s\n", __func__, dev_name(&pdev->dev));
    return snd_soc_register_platform(&pdev->dev,
                                     &mtk_soc_dummy_platform);
}
int mdss_dsi_cont_splash_on(struct mdss_panel_data *pdata)
{
    int ret = 0;
    struct mipi_panel_info *mipi;
    struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;

    pr_info("%s:%d DSI on for continuous splash.\n", __func__, __LINE__);

    if (pdata == NULL) {
        pr_err("%s: Invalid input data\n", __func__);
        return -EINVAL;
    }

    mipi = &pdata->panel_info.mipi;

    ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
                              panel_data);

    pr_debug("%s+: ctrl=%p ndx=%d\n", __func__,
             ctrl_pdata, ctrl_pdata->ndx);

    /*                                                   */
    if (pdata->panel_info.type == MIPI_VIDEO_PANEL)
        WARN((ctrl_pdata->ctrl_state & CTRL_STATE_PANEL_INIT),
             "Incorrect Ctrl state=0x%x\n", ctrl_pdata->ctrl_state);

    mdss_dsi_sw_reset(pdata);
    mdss_dsi_host_init(mipi, pdata);

    if (ctrl_pdata->on_cmds.link_state == DSI_LP_MODE) {
        mdss_dsi_op_mode_config(DSI_CMD_MODE, pdata);
        ret = mdss_dsi_unblank(pdata);
        if (ret) {
            pr_err("%s: unblank failed\n", __func__);
            return ret;
        }
    }

    /* FixMe AU_106 */
#ifndef CONFIG_OLED_SUPPORT
    /* because of redish issue */
    ctrl_pdata->ctrl_state = CTRL_STATE_MDP_ACTIVE;
#endif

#if defined(CONFIG_MACH_LGE)
    pdata_base = pdata;
#endif

    pr_debug("%s-:End\n", __func__);
    return ret;
}
Example #23
0
/*
 * swp_handler logs the id of calling process, dissects the instruction, sanity
 * checks the memory location, calls emulate_swpX for the actual operation and
 * deals with fixup/error handling before returning
 */
static int swp_handler(struct pt_regs *regs, unsigned int instr)
{
    unsigned int address, destreg, data, type;
    unsigned int res = 0;

    perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);

    if (current->pid != previous_pid) {
        pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
                 current->comm, (unsigned long)current->pid);
        previous_pid = current->pid;
    }

    address = regs->uregs[EXTRACT_REG_NUM(instr, RN_OFFSET)];
    data	= regs->uregs[EXTRACT_REG_NUM(instr, RT2_OFFSET)];
    destreg = EXTRACT_REG_NUM(instr, RT_OFFSET);

    type = instr & TYPE_SWPB;

    pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
             EXTRACT_REG_NUM(instr, RN_OFFSET), address,
             destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data);

    /* Check access in reasonable access range for both SWP and SWPB */
    if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) {
        pr_debug("SWP{B} emulation: access to %p not allowed!\n",
                 (void *)address);
        res = -EFAULT;
    } else {
        res = emulate_swpX(address, &data, type);
    }

    if (res == 0) {
        /*
         * On successful emulation, revert the adjustment to the PC
         * made in kernel/traps.c in order to resume execution at the
         * instruction following the SWP{B}.
         */
        regs->ARM_pc += 4;
        regs->uregs[destreg] = data;
    } else if (res == -EFAULT) {
        /*
         * Memory errors do not mean emulation failed.
         * Set up signal info to return SEGV, then return OK
         */
        set_segfault(regs, address);
    }

    return 0;
}
Example #24
0
static void do_afsync_work(struct work_struct *work)
{
    struct fsync_work *fwork =
        container_of(work, struct fsync_work, work);
    int ret = -EBADF;

    pr_debug("afsync: %s\n", fwork->pathname);
    ret = do_async_fsync(fwork->pathname);
    if (ret != 0 && ret != -EBADF)
        pr_info("afsync return %d\n", ret);
    else
        pr_debug("afsync: %s done\n", fwork->pathname);
    kfree(fwork);
}
static int really_probe(struct device *dev, struct device_driver *drv)
{
    int ret = 0;

    atomic_inc(&probe_count);
    pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
             drv->bus->name, __func__, drv->name, dev_name(dev));
    WARN_ON(!list_empty(&dev->devres_head));

    dev->driver = drv;
    if (driver_sysfs_add(dev)) {
        printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
               __func__, dev_name(dev));
        goto probe_failed;
    }

    if (dev->bus->probe) {
        ret = dev->bus->probe(dev);
        if (ret)
            goto probe_failed;
    } else if (drv->probe) {
        ret = drv->probe(dev);
        if (ret)
            goto probe_failed;
    }

    driver_bound(dev);
    ret = 1;
    pr_debug("bus: '%s': %s: bound device %s to driver %s\n",
             drv->bus->name, __func__, dev_name(dev), drv->name);
    goto done;

probe_failed:
    devres_release_all(dev);
    driver_sysfs_remove(dev);
    dev->driver = NULL;

    if (ret != -ENODEV && ret != -ENXIO) {

        printk(KERN_WARNING
               "%s: probe of %s failed with error %d\n",
               drv->name, dev_name(dev), ret);
    }

    ret = 0;
done:
    atomic_dec(&probe_count);
    wake_up(&probe_waitqueue);
    return ret;
}
Example #26
0
/*
 * Set the IOS
 */
static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
    int clkdiv;
    struct at91mci_host *host = mmc_priv(mmc);
    unsigned long at91_master_clock = clk_get_rate(mci_clk);

    host->bus_mode = ios->bus_mode;

    if (ios->clock == 0) {
        /* Disable the MCI controller */
        at91_mci_write(AT91_MCI_CR, AT91_MCI_MCIDIS);
        clkdiv = 0;
    }
    else {
        /* Enable the MCI controller */
        at91_mci_write(AT91_MCI_CR, AT91_MCI_MCIEN);

        if ((at91_master_clock % (ios->clock * 2)) == 0)
            clkdiv = ((at91_master_clock / ios->clock) / 2) - 1;
        else
            clkdiv = (at91_master_clock / ios->clock) / 2;

        pr_debug("clkdiv = %d. mcck = %ld\n", clkdiv,
                 at91_master_clock / (2 * (clkdiv + 1)));
    }
    if (ios->bus_width == MMC_BUS_WIDTH_4 && host->board->wire4) {
        pr_debug("MMC: Setting controller bus width to 4\n");
        at91_mci_write(AT91_MCI_SDCR, at91_mci_read(AT91_MCI_SDCR) | AT91_MCI_SDCBUS);
    }
    else {
        pr_debug("MMC: Setting controller bus width to 1\n");
        at91_mci_write(AT91_MCI_SDCR, at91_mci_read(AT91_MCI_SDCR) & ~AT91_MCI_SDCBUS);
    }

    /* Set the clock divider */
    at91_mci_write(AT91_MCI_MR, (at91_mci_read(AT91_MCI_MR) & ~AT91_MCI_CLKDIV) | clkdiv);

    /* maybe switch power to the card */
    if (host->board->vcc_pin) {
        switch (ios->power_mode) {
        case MMC_POWER_OFF:
            at91_set_gpio_output(host->board->vcc_pin, 0);
            break;
        case MMC_POWER_UP:
        case MMC_POWER_ON:
            at91_set_gpio_output(host->board->vcc_pin, 1);
            break;
        }
    }
}
Example #27
0
void fsl_usb_xcvr_unregister(struct fsl_xcvr_ops *xcvr_ops)
{
    int i;

    pr_debug("%s\n", __func__);
    for (i = 0; i < MXC_NUMBER_USB_TRANSCEIVER; i++) {
        if (g_xc_ops[i] == xcvr_ops) {
            g_xc_ops[i] = NULL;
            return;
        }
    }

    pr_debug("Failed %s\n", __func__);
}
Example #28
0
static void print_job_struct(void *job)
{
    struct vce_launch_info_t *vce_info;
    vce_info = (struct vce_launch_info_t *) ((u32 *)job);
    pr_debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    pr_debug("datasize: 0x%x\n", vce_info->datasize);
    pr_debug("data_addr_phys: 0x%x\n", vce_info->data_addr_phys);
    pr_debug("codesize: 0x%x\n", vce_info->codesize);
    pr_debug("code_addr_phys: 0x%x\n", vce_info->code_addr_phys);
    pr_debug("startaddr: 0x%x\n", vce_info->startaddr);
    pr_debug("finaladdr: 0x%x\n", vce_info->finaladdr);
    pr_debug("endcode: 0x%x\n", vce_info->endcode);
    pr_debug("stop_reason: 0x%x\n", vce_info->stop_reason);
    pr_debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
}
Example #29
0
static void print_regs(struct vce_device_t *vce)
{
    pr_debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    pr_debug(" VCE_STATUS: 0x%x\n", vce_read(vce, VCE_STATUS_OFFSET));
    pr_debug(" VERSION: 0x%x\n", vce_read(vce, VCE_VERSION_OFFSET));
    pr_debug(" PC_PF0: 0x%x\n", vce_read(vce, VCE_PC_PF0_OFFSET));
    pr_debug(" PC_IF0: 0x%x\n", vce_read(vce, VCE_PC_IF0_OFFSET));
    pr_debug(" PC_RD0: 0x%x\n", vce_read(vce, VCE_PC_RD0_OFFSET));
    pr_debug(" PC_EX0: 0x%x\n", vce_read(vce, VCE_PC_EX0_OFFSET));
    pr_debug(" BAD_ADDR: 0x%x\n", vce_read(vce, VCE_BAD_ADDR_OFFSET));
    pr_debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
}
Example #30
0
/*
 * Handle a command that has been completed
 */
static void at91mci_completed_command(struct at91mci_host *host)
{
    struct mmc_command *cmd = host->cmd;
    unsigned int status;

    at91_mci_write(AT91_MCI_IDR, 0xffffffff);

    cmd->resp[0] = at91_mci_read(AT91_MCI_RSPR(0));
    cmd->resp[1] = at91_mci_read(AT91_MCI_RSPR(1));
    cmd->resp[2] = at91_mci_read(AT91_MCI_RSPR(2));
    cmd->resp[3] = at91_mci_read(AT91_MCI_RSPR(3));

    if (host->buffer) {
        dma_free_coherent(NULL, host->total_length, host->buffer, host->physical_address);
        host->buffer = NULL;
    }

    status = at91_mci_read(AT91_MCI_SR);

    pr_debug("Status = %08X [%08X %08X %08X %08X]\n",
             status, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);

    if (status & (AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE |
                  AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE |
                  AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)) {
        if ((status & AT91_MCI_RCRCE) &&
                ((cmd->opcode == MMC_SEND_OP_COND) || (cmd->opcode == SD_APP_OP_COND))) {
            cmd->error = MMC_ERR_NONE;
        }
        else {
            if (status & (AT91_MCI_RTOE | AT91_MCI_DTOE))
                cmd->error = MMC_ERR_TIMEOUT;
            else if (status & (AT91_MCI_RCRCE | AT91_MCI_DCRCE))
                cmd->error = MMC_ERR_BADCRC;
            else if (status & (AT91_MCI_OVRE | AT91_MCI_UNRE))
                cmd->error = MMC_ERR_FIFO;
            else
                cmd->error = MMC_ERR_FAILED;

            pr_debug("Error detected and set to %d (cmd = %d, retries = %d)\n",
                     cmd->error, cmd->opcode, cmd->retries);
        }
    }
    else
        cmd->error = MMC_ERR_NONE;

    at91mci_process_next(host);
}