C++ (Cpp) printk Examples

C++ (Cpp) printk - 30 examples found. These are the top rated real world C++ (Cpp) examples of printk extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
static void acc_i2c_write_bytes(int slave_addr,char *data,int len)
{
    int i;

    mt_set_gpio_mode(accele_gpio_scl,GPIO_MODE_00);
    mt_set_gpio_mode(accele_gpio_sda,GPIO_MODE_00);
    mt_set_gpio_out(accele_gpio_scl,GPIO_OUT_ONE);
    mt_set_gpio_out(accele_gpio_sda,GPIO_OUT_ONE);

    memsic_acc_i2c_start();
    if(acc_i2c_putbyte(slave_addr)) {
        printk("[ACCESS: mxc622x] %s put address no ack!\n", __FUNCTION__);
        memsic_acc_i2c_stop();
        return;
    }

    for(i=0; i<len; i++)
    {
        if(acc_i2c_putbyte(data[i])) {
            printk("[ACCESS: mxc622x] %s put data no ack!\n", __FUNCTION__);
            memsic_acc_i2c_stop();
            return;
        }
    }

    memsic_acc_i2c_stop();
}
/**
 * hsi_read_cancel - Cancel pending read request.
 * @dev: hsi device channel where to cancel the pending read.
 *
 * read_done() callback will not be called after sucess of this function.
 */
void hsi_read_cancel(struct hsi_device *dev)
{
    struct hsi_channel *ch;

    if (dev->ctrlrid != 0x1) {
        printk(KERN_INFO "HSI Controller not enabled for read\n");
        return;
    }

    if (unlikely(!dev || !dev->ch)) {
        printk(KERN_INFO "Wrong HSI device %p\n", dev);
        return;
    }

    if (unlikely(!(dev->ch->flags & HSI_CH_OPEN))) {
        printk(KERN_INFO "HSI device NOT open\n");
        return;
    }

    ch=dev->ch;
    spin_lock_bh(&ch->hsi_ch_lock);
    __hsi_read_cancel(dev->ch, dev->curr_mode);
    dev->ch->flags &= ~HSI_CH_OPEN;
    spin_unlock_bh(&ch->hsi_ch_lock);
}
static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
{
    struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
    struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
    unsigned char *pg_buf;
    int ret;

    D2(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT));

    BUG_ON(!PageLocked(pg));

    pg_buf = kmap(pg);
    /* FIXME: Can kmap fail? */

    ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_CACHE_SHIFT, PAGE_CACHE_SIZE);

    if (ret) {
        ClearPageUptodate(pg);
        SetPageError(pg);
    } else {
        SetPageUptodate(pg);
        ClearPageError(pg);
    }

    flush_dcache_page(pg);
    kunmap(pg);

    D2(printk(KERN_DEBUG "readpage finished\n"));
    return 0;
}
static int __init jpeg_init(void)
{
    int ret;

    printk("JPEG Codec initialize\n");

    printk("Register the JPEG Codec device\n");
    if(platform_device_register(&jpeg_device))
    {
        printk("failed to register jpeg codec device\n");
        ret = -ENODEV;
        return ret;
    }

    printk("Register the JPEG Codec driver\n");
    if(platform_driver_register(&jpeg_driver))
    {
        printk("failed to register jpeg codec driver\n");
        platform_device_unregister(&jpeg_device);
        ret = -ENODEV;
        return ret;
    }

    return 0;
}
Example #5
0
void *dma_memcpy(void *pdst,
                 const void *psrc,
                 unsigned int pn)
{
    static etrax_dma_descr indma, outdma;

    D(printk("dma_memcpy %d bytes... ", pn));

#if 0
    *R_GEN_CONFIG = genconfig_shadow =
                        (genconfig_shadow & ~0x3c0000) |
                        IO_STATE(R_GEN_CONFIG, dma6, intdma7) |
                        IO_STATE(R_GEN_CONFIG, dma7, intdma6);
#endif
    indma.sw_len = outdma.sw_len = pn;
    indma.ctrl = d_eol | d_eop;
    outdma.ctrl = d_eol;
    indma.buf = psrc;
    outdma.buf = pdst;

    *R_DMA_CH6_FIRST = &indma;
    *R_DMA_CH7_FIRST = &outdma;
    *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start);
    *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start);

    while(*R_DMA_CH7_CMD == 1) /* wait for completion */ ;

    D(printk("done\n"));

}
Example #6
0
/*
 *	This handles all restart and diagnostic frames.
 */
void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigned short frametype)
{
    struct sk_buff *skbn;

    switch (frametype) {
    case ROSE_RESTART_REQUEST:
        rose_stop_t0timer(neigh);
        neigh->restarted = 1;
        neigh->dce_mode  = (skb->data[3] == ROSE_DTE_ORIGINATED);
        rose_transmit_restart_confirmation(neigh);
        break;

    case ROSE_RESTART_CONFIRMATION:
        rose_stop_t0timer(neigh);
        neigh->restarted = 1;
        break;

    case ROSE_DIAGNOSTIC:
        printk(KERN_WARNING "ROSE: received diagnostic #%d - %02X %02X %02X\n", skb->data[3], skb->data[4], skb->data[5], skb->data[6]);
        break;

    default:
        printk(KERN_WARNING "ROSE: received unknown %02X with LCI 000\n", frametype);
        break;
    }

    if (neigh->restarted) {
        while ((skbn = skb_dequeue(&neigh->queue)) != NULL)
            if (!rose_send_frame(skbn, neigh))
                kfree_skb(skbn);
    }
}