type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <linux/dma-buf.h>
includes
#include <drm/drmP.h>
includes
#include <drm/drm_crtc.h>
includes
#include <drm/drm_crtc_helper.h>
includes
#include <drm/drm_fb_helper.h>
defines
#define DL_DEFIO_WRITE_DELAY (HZ/20) /* fb_deferred_io.delay in jiffies */
defines
#define DL_ALIGN_UP(x, a) ALIGN(x, a)
defines
#define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a)
defines
#define DLO_RGB_GETRED(col) (uint8_t)((col) & 0xFF)
defines
#define DLO_RGB_GETGRN(col) (uint8_t)(((col) >> 8) & 0xFF)
defines
#define DLO_RGB_GETBLU(col) (uint8_t)(((col) >> 16) & 0xFF)
defines
#define DLO_RG16(red, grn) (uint8_t)((((red) & 0xF8) | ((grn) >> 5)) & 0xFF)
defines
#define DLO_GB16(grn, blu) (uint8_t)(((((grn) & 0x1C) << 3) | ((blu) >> 3)) & 0xFF)
defines
#define DLO_RGB8(red, grn, blu) ((((red) << 5) | (((grn) & 3) << 3) | ((blu) & 7)) & 0xFF)
structs
struct udl_fbdev { struct drm_fb_helper helper; struct udl_framebuffer ufb; int fb_count; };
functions
uint8_t rgb8(uint32_t col) { uint8_t red = DLO_RGB_GETRED(col); uint8_t grn = DLO_RGB_GETGRN(col); uint8_t blu = DLO_RGB_GETBLU(col); return DLO_RGB8(red, grn, blu); }
functions
uint16_t rgb16(uint32_t col) { uint8_t red = DLO_RGB_GETRED(col); uint8_t grn = DLO_RGB_GETGRN(col); uint8_t blu = DLO_RGB_GETBLU(col); return (DLO_RG16(red, grn) << 8) + DLO_GB16(grn, blu); }
functions
int udl_handle_damage(struct udl_framebuffer *fb, int x, int y, int width, int height) { struct drm_device *dev = fb->base.dev; struct udl_device *udl = dev->dev_private; int i, ret; char *cmd; cycles_t start_cycles, end_cycles; int bytes_sent = 0; int bytes_identical = 0; struct urb *urb; int aligned_...
functions
int udl_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { unsigned long start = vma->vm_start; unsigned long size = vma->vm_end - vma->vm_start; unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; unsigned long page, pos; if (offset + size > info->fix.smem_len) return -EINVAL; pos = (unsigned long)i...
functions
int udl_fb_open(struct fb_info *info, int user) { struct udl_fbdev *ufbdev = info->par; struct drm_device *dev = ufbdev->ufb.base.dev; struct udl_device *udl = dev->dev_private; /* If the USB device is gone, we don't accept new opens */ if (drm_device_is_unplugged(udl->ddev)) return -ENODEV; ufbdev->fb_count+...
functions
int udl_fb_release(struct fb_info *info, int user) { struct udl_fbdev *ufbdev = info->par; ufbdev->fb_count--; #ifdef CONFIG_DRM_FBDEV_EMULATION if ((ufbdev->fb_count == 0) && (info->fbdefio)) { fb_deferred_io_cleanup(info); kfree(info->fbdefio); info->fbdefio = NULL; info->fbops->fb_mmap = udl_fb_mmap; }
functions
int udl_user_framebuffer_dirty(struct drm_framebuffer *fb, struct drm_file *file, unsigned flags, unsigned color, struct drm_clip_rect *clips, unsigned num_clips) { struct udl_framebuffer *ufb = to_udl_fb(fb); int i; int ret = 0; drm_modeset_lock_all(fb->dev); if (!ufb->ac...
functions
void udl_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct udl_framebuffer *ufb = to_udl_fb(fb); if (ufb->obj) drm_gem_object_unreference_unlocked(&ufb->obj->base); drm_framebuffer_cleanup(fb); kfree(ufb); }
functions
int udl_framebuffer_init(struct drm_device *dev, struct udl_framebuffer *ufb, const struct drm_mode_fb_cmd2 *mode_cmd, struct udl_gem_object *obj) { int ret; ufb->obj = obj; drm_helper_mode_fill_fb_struct(&ufb->base, mode_cmd); ret = drm_framebuffer_init(dev, &ufb->base, &udlfb_funcs); return...
functions
int udlfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct udl_fbdev *ufbdev = container_of(helper, struct udl_fbdev, helper); struct drm_device *dev = ufbdev->helper.dev; struct fb_info *info; struct drm_framebuffer *fb; struct drm_mode_fb_cmd2 mode_cmd; struct udl_gem...
functions
void udl_fbdev_destroy(struct drm_device *dev, struct udl_fbdev *ufbdev) { drm_fb_helper_unregister_fbi(&ufbdev->helper); drm_fb_helper_release_fbi(&ufbdev->helper); drm_fb_helper_fini(&ufbdev->helper); drm_framebuffer_unregister_private(&ufbdev->ufb.base); drm_framebuffer_cleanup(&ufbdev->ufb.base); drm...
functions
int udl_fbdev_init(struct drm_device *dev) { struct udl_device *udl = dev->dev_private; int bpp_sel = fb_bpp; struct udl_fbdev *ufbdev; int ret; ufbdev = kzalloc(sizeof(struct udl_fbdev), GFP_KERNEL); if (!ufbdev) return -ENOMEM; udl->fbdev = ufbdev; drm_fb_helper_prepare(dev, &ufbdev->helper, &udl_fb_help...
functions
void udl_fbdev_cleanup(struct drm_device *dev) { struct udl_device *udl = dev->dev_private; if (!udl->fbdev) return; udl_fbdev_destroy(dev, udl->fbdev); kfree(udl->fbdev); udl->fbdev = NULL; }
functions
void udl_fbdev_unplug(struct drm_device *dev) { struct udl_device *udl = dev->dev_private; struct udl_fbdev *ufbdev; if (!udl->fbdev) return; ufbdev = udl->fbdev; drm_fb_helper_unlink_fbi(&ufbdev->helper); }
includes
#include <linux/kernel.h>
functions
u8 solo_i2c_readbyte(struct solo6010_dev *solo_dev, int id, u8 addr, u8 off) { struct i2c_msg msgs[2]; u8 data; msgs[0].flags = 0; msgs[0].addr = addr; msgs[0].len = 1; msgs[0].buf = &off; msgs[1].flags = I2C_M_RD; msgs[1].addr = addr; msgs[1].len = 1; msgs[1].buf = &data; i2c_transfer(&solo_dev->i2c_adap...
functions
void solo_i2c_writebyte(struct solo6010_dev *solo_dev, int id, u8 addr, u8 off, u8 data) { struct i2c_msg msgs; u8 buf[2]; buf[0] = off; buf[1] = data; msgs.flags = 0; msgs.addr = addr; msgs.len = 2; msgs.buf = buf; i2c_transfer(&solo_dev->i2c_adap[id], &msgs, 1); }
functions
void solo_i2c_flush(struct solo6010_dev *solo_dev, int wr) { u32 ctrl; ctrl = SOLO_IIC_CH_SET(solo_dev->i2c_id); if (solo_dev->i2c_state == IIC_STATE_START) ctrl |= SOLO_IIC_START; if (wr) { ctrl |= SOLO_IIC_WRITE; }
functions
void solo_i2c_start(struct solo6010_dev *solo_dev) { u32 addr = solo_dev->i2c_msg->addr << 1; if (solo_dev->i2c_msg->flags & I2C_M_RD) addr |= 1; solo_dev->i2c_state = IIC_STATE_START; solo_reg_write(solo_dev, SOLO_IIC_TXD, addr); solo_i2c_flush(solo_dev, 1); }
functions
void solo_i2c_stop(struct solo6010_dev *solo_dev) { solo6010_irq_off(solo_dev, SOLO_IRQ_IIC); solo_reg_write(solo_dev, SOLO_IIC_CTRL, 0); solo_dev->i2c_state = IIC_STATE_STOP; wake_up(&solo_dev->i2c_wait); }
functions
int solo_i2c_handle_read(struct solo6010_dev *solo_dev) { prepare_read: if (solo_dev->i2c_msg_ptr != solo_dev->i2c_msg->len) { solo_i2c_flush(solo_dev, 0); return 0; }
functions
int solo_i2c_handle_write(struct solo6010_dev *solo_dev) { retry_write: if (solo_dev->i2c_msg_ptr != solo_dev->i2c_msg->len) { solo_reg_write(solo_dev, SOLO_IIC_TXD, solo_dev->i2c_msg->buf[solo_dev->i2c_msg_ptr]); solo_dev->i2c_msg_ptr++; solo_i2c_flush(solo_dev, 1); return 0; }
functions
int solo_i2c_isr(struct solo6010_dev *solo_dev) { u32 status = solo_reg_read(solo_dev, SOLO_IIC_CTRL); int ret = -EINVAL; solo_reg_write(solo_dev, SOLO_IRQ_STAT, SOLO_IRQ_IIC); if (status & (SOLO_IIC_STATE_TRNS & SOLO_IIC_STATE_SIG_ERR) || solo_dev->i2c_id < 0) { solo_i2c_stop(solo_dev); return -ENXIO; ...
functions
int solo_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) { struct solo6010_dev *solo_dev = adap->algo_data; unsigned long timeout; int ret; int i; DEFINE_WAIT(wait); for (i = 0; i < SOLO_I2C_ADAPTERS; i++) { if (&solo_dev->i2c_adap[i] == adap) break; }
functions
u32 solo_i2c_functionality(struct i2c_adapter *adap) { return I2C_FUNC_I2C; }
functions
int solo_i2c_init(struct solo6010_dev *solo_dev) { int i; int ret; solo_reg_write(solo_dev, SOLO_IIC_CFG, SOLO_IIC_PRESCALE(8) | SOLO_IIC_ENABLE); solo_dev->i2c_id = -1; solo_dev->i2c_state = IIC_STATE_IDLE; init_waitqueue_head(&solo_dev->i2c_wait); init_MUTEX(&solo_dev->i2c_sem); for (i = 0; i < SO...
functions
void solo_i2c_exit(struct solo6010_dev *solo_dev) { int i; for (i = 0; i < SOLO_I2C_ADAPTERS; i++) { if (!solo_dev->i2c_adap[i].algo_data) continue; i2c_del_adapter(&solo_dev->i2c_adap[i]); solo_dev->i2c_adap[i].algo_data = NULL; }
includes
#include <linux/kernel.h>
includes
#include <linux/module.h>
includes
#include <linux/device.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/pci.h>
includes
#include <linux/mfd/core.h>
defines
#define VX855_CFG_PMIO_OFFSET 0x88
defines
#define VX855_PMIO_ACPI 0x00
defines
#define VX855_PMIO_ACPI_LEN 0x0b
defines
#define VX855_PMIO_PPM 0x10
defines
#define VX855_PMIO_PPM_LEN 0x08
defines
#define VX855_PMIO_GPPM 0x20
defines
#define VX855_PMIO_R_GPI 0x48
defines
#define VX855_PMIO_R_GPO 0x4c
defines
#define VX855_PMIO_GPPM_LEN 0x33
defines
#define VSPIC_MMIO_SIZE 0x1000
functions
int vx855_probe(struct pci_dev *pdev, const struct pci_device_id *id) { int ret; u16 gpio_io_offset; ret = pci_enable_device(pdev); if (ret) return -ENODEV; pci_read_config_word(pdev, VX855_CFG_PMIO_OFFSET, &gpio_io_offset); if (!gpio_io_offset) { dev_warn(&pdev->dev, "BIOS did not assign PMIO base ...
functions
__devexit vx855_remove(struct pci_dev *pdev) { mfd_remove_devices(&pdev->dev); pci_disable_device(pdev); }
functions
int vx855_init(void) { return pci_register_driver(&vx855_pci_driver); }
functions
void vx855_exit(void) { pci_unregister_driver(&vx855_pci_driver); }
includes
#include <linux/init.h>
includes
#include <linux/pfn.h>
includes
#include <linux/slab.h>
includes
#include <linux/bootmem.h>
includes
#include <linux/export.h>
includes
#include <linux/kmemleak.h>
includes
#include <linux/range.h>
includes
#include <linux/memblock.h>
includes
#include <asm/bug.h>
includes
#include <asm/io.h>
includes
#include <asm/processor.h>
defines
#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
functions
__init __alloc_memory_core_early(int nid, u64 size, u64 align, u64 goal, u64 limit) { void *ptr; u64 addr; if (limit > memblock.current_limit) limit = memblock.current_limit; addr = memblock_find_in_range_node(goal, limit, size, align, nid); if (!addr) return NULL; ptr = phys_to_virt(addr); memset(pt...
functions
__init free_bootmem_late(unsigned long addr, unsigned long size) { unsigned long cursor, end; kmemleak_free_part(__va(addr), size); cursor = PFN_UP(addr); end = PFN_DOWN(addr + size); for (; cursor < end; cursor++) { __free_pages_bootmem(pfn_to_page(cursor), 0); totalram_pages++; }
functions
__init __free_pages_memory(unsigned long start, unsigned long end) { unsigned long i, start_aligned, end_aligned; int order = ilog2(BITS_PER_LONG); start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1); end_aligned = end & ~(BITS_PER_LONG - 1); if (end_aligned <= start_aligned) { for (i = start;...
functions
__init __free_memory_core(phys_addr_t start, phys_addr_t end) { unsigned long start_pfn = PFN_UP(start); unsigned long end_pfn = min_t(unsigned long, PFN_DOWN(end), max_low_pfn); if (start_pfn > end_pfn) return 0; __free_pages_memory(start_pfn, end_pfn); return end_pfn - start_pfn; }
functions
__init free_low_memory_core_early(int nodeid) { unsigned long count = 0; phys_addr_t start, end, size; u64 i; for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL) count += __free_memory_core(start, end); /* free range that is used for reserved array if we allocate it */ size = get_allocated_memblock_r...
functions
void reset_node_lowmem_managed_pages(pg_data_t *pgdat) { struct zone *z; /* * In free_area_init_core(), highmem zone's managed_pages is set to * present_pages, and bootmem allocator doesn't allocate from highmem * zones. So there's no need to recalculate managed_pages because all * highmem pages will be mana...
functions
__init free_all_bootmem_node(pg_data_t *pgdat) { register_page_bootmem_info_node(pgdat); reset_node_lowmem_managed_pages(pgdat); /* free_low_memory_core_early(MAX_NUMNODES) will be called later */ return 0; }
functions
__init free_all_bootmem(void) { struct pglist_data *pgdat; for_each_online_pgdat(pgdat) reset_node_lowmem_managed_pages(pgdat); /* * We need to use MAX_NUMNODES instead of NODE_DATA(0)->node_id * because in some case like Node0 doesn't have RAM installed * low ram will be on Node1 */ return free_low_m...
functions
__init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr, unsigned long size) { kmemleak_free_part(__va(physaddr), size); memblock_free(physaddr, size); }
functions
__init free_bootmem(unsigned long addr, unsigned long size) { kmemleak_free_part(__va(addr), size); memblock_free(addr, size); }
functions
__init ___alloc_bootmem_nopanic(unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) { void *ptr; if (WARN_ON_ONCE(slab_is_available())) return kzalloc(size, GFP_NOWAIT); restart: ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, goal, limit); if (ptr) re...
functions
__init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, unsigned long goal) { unsigned long limit = -1UL; return ___alloc_bootmem_nopanic(size, align, goal, limit); }
functions
__init ___alloc_bootmem(unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) { void *mem = ___alloc_bootmem_nopanic(size, align, goal, limit); if (mem) return mem; /* * Whoops, we cannot satisfy the allocation request. */ printk(KERN_ALERT "bootmem alloc of %lu bytes failed!...
functions
__init __alloc_bootmem(unsigned long size, unsigned long align, unsigned long goal) { unsigned long limit = -1UL; return ___alloc_bootmem(size, align, goal, limit); }
functions
__init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) { void *ptr; again: ptr = __alloc_memory_core_early(pgdat->node_id, size, align, goal, limit); if (ptr) return ptr; ptr = __alloc_memo...
functions
__init __alloc_bootmem_node_nopanic(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); return ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, 0); }
functions
__init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit) { void *ptr; ptr = ___alloc_bootmem_node_nopanic(pgdat, size, align, goal, limit); if (ptr) return ptr; printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size)...
functions
__init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); return ___alloc_bootmem_node(pgdat, size, align, goal, 0); }
functions
__init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { return __alloc_bootmem_node(pgdat, size, align, goal); }
functions
__init __alloc_bootmem_low(unsigned long size, unsigned long align, unsigned long goal) { return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT); }
functions
__init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); return ___alloc_bootmem_node(pgdat, size, align, goal, ARCH_LOW_ADDRESS_LIMIT); }
includes
#include <sys/time.h>
includes
#include <time.h>
includes
#include <stdlib.h>
includes
#include <sys/syscall.h>
includes
#include <unistd.h>