linux/drivers/hid/hid-picolcd_fb.c

// SPDX-License-Identifier: GPL-2.0-only
/***************************************************************************
 *   Copyright (C) 2010-2012 by Bruno Prémont <[email protected]>  *
 *                                                                         *
 *   Based on Logitech G13 driver (v0.4)                                   *
 *     Copyright (C) 2009 by Rick L. Vinyard, Jr. <[email protected]>   *
 *                                                                         *
 ***************************************************************************/

#include <linux/hid.h>
#include <linux/vmalloc.h>

#include <linux/fb.h>
#include <linux/module.h>

#include "hid-picolcd.h"

/* Framebuffer
 *
 * The PicoLCD use a Topway LCD module of 256x64 pixel
 * This display area is tiled over 4 controllers with 8 tiles
 * each. Each tile has 8x64 pixel, each data byte representing
 * a 1-bit wide vertical line of the tile.
 *
 * The display can be updated at a tile granularity.
 *
 *       Chip 1           Chip 2           Chip 3           Chip 4
 * +----------------+----------------+----------------+----------------+
 * |     Tile 1     |     Tile 1     |     Tile 1     |     Tile 1     |
 * +----------------+----------------+----------------+----------------+
 * |     Tile 2     |     Tile 2     |     Tile 2     |     Tile 2     |
 * +----------------+----------------+----------------+----------------+
 *                                  ...
 * +----------------+----------------+----------------+----------------+
 * |     Tile 8     |     Tile 8     |     Tile 8     |     Tile 8     |
 * +----------------+----------------+----------------+----------------+
 */
#define PICOLCDFB_NAME
#define PICOLCDFB_WIDTH
#define PICOLCDFB_HEIGHT
#define PICOLCDFB_SIZE

#define PICOLCDFB_UPDATE_RATE_LIMIT
#define PICOLCDFB_UPDATE_RATE_DEFAULT

/* Framebuffer visual structures */
static const struct fb_fix_screeninfo picolcdfb_fix =;

static const struct fb_var_screeninfo picolcdfb_var =;

/* Send a given tile to PicoLCD */
static int picolcd_fb_send_tile(struct picolcd_data *data, u8 *vbitmap,
		int chip, int tile)
{}

/* Translate a single tile*/
static int picolcd_fb_update_tile(u8 *vbitmap, const u8 *bitmap, int bpp,
		int chip, int tile)
{}

void picolcd_fb_refresh(struct picolcd_data *data)
{}

/* Reconfigure LCD display */
int picolcd_fb_reset(struct picolcd_data *data, int clear)
{}

/* Update fb_vbitmap from the screen_buffer and send changed tiles to device */
static void picolcd_fb_update(struct fb_info *info)
{}

static int picolcd_fb_blank(int blank, struct fb_info *info)
{}

static void picolcd_fb_destroy(struct fb_info *info)
{}

static int picolcd_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{}

static int picolcd_set_par(struct fb_info *info)
{}

static void picolcdfb_ops_damage_range(struct fb_info *info, off_t off, size_t len)
{}

static void picolcdfb_ops_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
{}

FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(picolcdfb_ops,
				   picolcdfb_ops_damage_range,
				   picolcdfb_ops_damage_area)

static const struct fb_ops picolcdfb_ops =;


/* Callback from deferred IO workqueue */
static void picolcd_fb_deferred_io(struct fb_info *info, struct list_head *pagereflist)
{}

static const struct fb_deferred_io picolcd_fb_defio =;


/*
 * The "fb_update_rate" sysfs attribute
 */
static ssize_t picolcd_fb_update_rate_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{}

static ssize_t picolcd_fb_update_rate_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{}

static DEVICE_ATTR(fb_update_rate, 0664, picolcd_fb_update_rate_show,
		picolcd_fb_update_rate_store);

/* initialize Framebuffer device */
int picolcd_init_framebuffer(struct picolcd_data *data)
{}

void picolcd_exit_framebuffer(struct picolcd_data *data)
{}