type
stringclasses
5 values
content
stringlengths
9
163k
functions
void intel_find_lvds_downclock(struct drm_device *dev, struct drm_connector *connector) { struct drm_i915_private *dev_priv = dev->dev_private; struct drm_display_mode *scan, *panel_fixed_mode; int temp_downclock; panel_fixed_mode = dev_priv->panel_fixed_mode; temp_downclock = panel_fixed_mode->clock; mutex...
functions
int lvds_is_present_in_vbt(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; struct child_device_config *p_child; int i, ret; if (!dev_priv->child_dev_num) return 1; ret = 0; for (i = 0; i < dev_priv->child_dev_num; i++) { p_child = dev_priv->child_dev + i; /* * If the dev...
functions
void intel_lvds_init(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; struct intel_encoder *intel_encoder; struct intel_connector *intel_connector; struct drm_connector *connector; struct drm_encoder *encoder; struct drm_display_mode *scan; /* *modes, *bios_mode; */ struct drm_crtc...
includes
#include <linux/clk.h>
includes
#include <linux/clockchips.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/irq.h>
includes
#include <linux/irqreturn.h>
includes
#include <linux/of.h>
includes
#include <linux/of_address.h>
includes
#include <linux/of_irq.h>
includes
#include <linux/sched_clock.h>
includes
#include <linux/slab.h>
defines
#define GPT_IRQ_EN_REG 0x00
defines
#define GPT_IRQ_ENABLE(val) BIT((val) - 1)
defines
#define GPT_IRQ_ACK_REG 0x08
defines
#define GPT_IRQ_ACK(val) BIT((val) - 1)
defines
#define TIMER_CTRL_REG(val) (0x10 * (val))
defines
#define TIMER_CTRL_OP(val) (((val) & 0x3) << 4)
defines
#define TIMER_CTRL_OP_ONESHOT (0)
defines
#define TIMER_CTRL_OP_REPEAT (1)
defines
#define TIMER_CTRL_OP_FREERUN (3)
defines
#define TIMER_CTRL_CLEAR (2)
defines
#define TIMER_CTRL_ENABLE (1)
defines
#define TIMER_CTRL_DISABLE (0)
defines
#define TIMER_CLK_REG(val) (0x04 + (0x10 * (val)))
defines
#define TIMER_CLK_SRC(val) (((val) & 0x1) << 4)
defines
#define TIMER_CLK_SRC_SYS13M (0)
defines
#define TIMER_CLK_SRC_RTC32K (1)
defines
#define TIMER_CLK_DIV1 (0x0)
defines
#define TIMER_CLK_DIV2 (0x1)
defines
#define TIMER_CNT_REG(val) (0x08 + (0x10 * (val)))
defines
#define TIMER_CMP_REG(val) (0x0C + (0x10 * (val)))
defines
#define GPT_CLK_EVT 1
defines
#define GPT_CLK_SRC 2
structs
struct mtk_clock_event_device { void __iomem *gpt_base; u32 ticks_per_jiffy; struct clock_event_device dev; };
functions
notrace mtk_read_sched_clock(void) { return readl_relaxed(gpt_sched_reg); }
functions
void mtk_clkevt_time_stop(struct mtk_clock_event_device *evt, u8 timer) { u32 val; val = readl(evt->gpt_base + TIMER_CTRL_REG(timer)); writel(val & ~TIMER_CTRL_ENABLE, evt->gpt_base + TIMER_CTRL_REG(timer)); }
functions
void mtk_clkevt_time_setup(struct mtk_clock_event_device *evt, unsigned long delay, u8 timer) { writel(delay, evt->gpt_base + TIMER_CMP_REG(timer)); }
functions
void mtk_clkevt_time_start(struct mtk_clock_event_device *evt, bool periodic, u8 timer) { u32 val; /* Acknowledge interrupt */ writel(GPT_IRQ_ACK(timer), evt->gpt_base + GPT_IRQ_ACK_REG); val = readl(evt->gpt_base + TIMER_CTRL_REG(timer)); /* Clear 2 bit timer operation mode field */ val &= ~TIMER_CTRL_OP(0x...
functions
int mtk_clkevt_shutdown(struct clock_event_device *clk) { mtk_clkevt_time_stop(to_mtk_clk(clk), GPT_CLK_EVT); return 0; }
functions
int mtk_clkevt_set_periodic(struct clock_event_device *clk) { struct mtk_clock_event_device *evt = to_mtk_clk(clk); mtk_clkevt_time_stop(evt, GPT_CLK_EVT); mtk_clkevt_time_setup(evt, evt->ticks_per_jiffy, GPT_CLK_EVT); mtk_clkevt_time_start(evt, true, GPT_CLK_EVT); return 0; }
functions
int mtk_clkevt_next_event(unsigned long event, struct clock_event_device *clk) { struct mtk_clock_event_device *evt = to_mtk_clk(clk); mtk_clkevt_time_stop(evt, GPT_CLK_EVT); mtk_clkevt_time_setup(evt, event, GPT_CLK_EVT); mtk_clkevt_time_start(evt, false, GPT_CLK_EVT); return 0; }
functions
irqreturn_t mtk_timer_interrupt(int irq, void *dev_id) { struct mtk_clock_event_device *evt = dev_id; /* Acknowledge timer0 irq */ writel(GPT_IRQ_ACK(GPT_CLK_EVT), evt->gpt_base + GPT_IRQ_ACK_REG); evt->dev.event_handler(&evt->dev); return IRQ_HANDLED; }
functions
void mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option) { writel(TIMER_CTRL_CLEAR | TIMER_CTRL_DISABLE, evt->gpt_base + TIMER_CTRL_REG(timer)); writel(TIMER_CLK_SRC(TIMER_CLK_SRC_SYS13M) | TIMER_CLK_DIV1, evt->gpt_base + TIMER_CLK_REG(timer)); writel(0x0, evt->gpt_base + TIMER_CMP_REG(ti...
functions
void mtk_timer_enable_irq(struct mtk_clock_event_device *evt, u8 timer) { u32 val; /* Disable all interrupts */ writel(0x0, evt->gpt_base + GPT_IRQ_EN_REG); /* Acknowledge all spurious pending interrupts */ writel(0x3f, evt->gpt_base + GPT_IRQ_ACK_REG); val = readl(evt->gpt_base + GPT_IRQ_EN_REG); writel(val ...
functions
__init mtk_timer_init(struct device_node *node) { struct mtk_clock_event_device *evt; struct resource res; unsigned long rate = 0; struct clk *clk; evt = kzalloc(sizeof(*evt), GFP_KERNEL); if (!evt) { pr_warn("Can't allocate mtk clock event driver struct"); return; }
includes
#include <linux/module.h>
includes
#include <linux/kernel.h>
includes
#include <linux/i2c.h>
includes
#include <linux/fb.h>
includes
#include <linux/uaccess.h>
includes
#include <linux/of_device.h>
includes
#include <linux/of_gpio.h>
includes
#include <linux/pwm.h>
includes
#include <linux/delay.h>
defines
#define SSD1307FB_DATA 0x40
defines
#define SSD1307FB_COMMAND 0x80
defines
#define SSD1307FB_SET_ADDRESS_MODE 0x20
defines
#define SSD1307FB_SET_ADDRESS_MODE_HORIZONTAL (0x00)
defines
#define SSD1307FB_SET_ADDRESS_MODE_VERTICAL (0x01)
defines
#define SSD1307FB_SET_ADDRESS_MODE_PAGE (0x02)
defines
#define SSD1307FB_SET_COL_RANGE 0x21
defines
#define SSD1307FB_SET_PAGE_RANGE 0x22
defines
#define SSD1307FB_CONTRAST 0x81
defines
#define SSD1307FB_CHARGE_PUMP 0x8d
defines
#define SSD1307FB_SEG_REMAP_ON 0xa1
defines
#define SSD1307FB_DISPLAY_OFF 0xae
defines
#define SSD1307FB_SET_MULTIPLEX_RATIO 0xa8
defines
#define SSD1307FB_DISPLAY_ON 0xaf
defines
#define SSD1307FB_START_PAGE_ADDRESS 0xb0
defines
#define SSD1307FB_SET_DISPLAY_OFFSET 0xd3
defines
#define SSD1307FB_SET_CLOCK_FREQ 0xd5
defines
#define SSD1307FB_SET_PRECHARGE_PERIOD 0xd9
defines
#define SSD1307FB_SET_COM_PINS_CONFIG 0xda
defines
#define SSD1307FB_SET_VCOMH 0xdb
structs
struct ssd1307fb_ops { int (*init)(struct ssd1307fb_par *); int (*remove)(struct ssd1307fb_par *); };
structs
struct ssd1307fb_par { struct i2c_client *client; u32 height; struct fb_info *info; struct ssd1307fb_ops *ops; u32 page_offset; struct pwm_device *pwm; u32 pwm_period; int reset; u32 width; };
structs
struct ssd1307fb_array { u8 type; u8 data[0]; };
functions
int ssd1307fb_write_array(struct i2c_client *client, struct ssd1307fb_array *array, u32 len) { int ret; len += sizeof(struct ssd1307fb_array); ret = i2c_master_send(client, (u8 *)array, len); if (ret != len) { dev_err(&client->dev, "Couldn't send I2C command.\n"); return ret; }
functions
int ssd1307fb_write_cmd(struct i2c_client *client, u8 cmd) { struct ssd1307fb_array *array; int ret; array = ssd1307fb_alloc_array(1, SSD1307FB_COMMAND); if (!array) return -ENOMEM; array->data[0] = cmd; ret = ssd1307fb_write_array(client, array, 1); kfree(array); return ret; }
functions
int ssd1307fb_write_data(struct i2c_client *client, u8 data) { struct ssd1307fb_array *array; int ret; array = ssd1307fb_alloc_array(1, SSD1307FB_DATA); if (!array) return -ENOMEM; array->data[0] = data; ret = ssd1307fb_write_array(client, array, 1); kfree(array); return ret; }
functions
void ssd1307fb_update_display(struct ssd1307fb_par *par) { struct ssd1307fb_array *array; u8 *vmem = par->info->screen_base; int i, j, k; array = ssd1307fb_alloc_array(par->width * par->height / 8, SSD1307FB_DATA); if (!array) return; /* * The screen is divided in pages, each having a height of 8 ...
functions
ssize_t ssd1307fb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos) { struct ssd1307fb_par *par = info->par; unsigned long total_size; unsigned long p = *ppos; u8 __iomem *dst; total_size = info->fix.smem_len; if (p > total_size) return -EINVAL; if (count + p > total_size) ...
functions
void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct ssd1307fb_par *par = info->par; sys_fillrect(info, rect); ssd1307fb_update_display(par); }
functions
void ssd1307fb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { struct ssd1307fb_par *par = info->par; sys_copyarea(info, area); ssd1307fb_update_display(par); }
functions
void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *image) { struct ssd1307fb_par *par = info->par; sys_imageblit(info, image); ssd1307fb_update_display(par); }
functions
void ssd1307fb_deferred_io(struct fb_info *info, struct list_head *pagelist) { ssd1307fb_update_display(info->par); }
functions
int ssd1307fb_ssd1307_init(struct ssd1307fb_par *par) { int ret; par->pwm = pwm_get(&par->client->dev, NULL); if (IS_ERR(par->pwm)) { dev_err(&par->client->dev, "Could not get PWM from device tree!\n"); return PTR_ERR(par->pwm); }
functions
int ssd1307fb_ssd1307_remove(struct ssd1307fb_par *par) { pwm_disable(par->pwm); pwm_put(par->pwm); return 0; }
functions
int ssd1307fb_ssd1306_init(struct ssd1307fb_par *par) { int ret; /* Set initial contrast */ ret = ssd1307fb_write_cmd(par->client, SSD1307FB_CONTRAST); ret = ret & ssd1307fb_write_cmd(par->client, 0x7f); if (ret < 0) return ret; /* Set COM direction */ ret = ssd1307fb_write_cmd(par->client, 0xc8); if (ret <...
functions
int ssd1307fb_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct fb_info *info; struct device_node *node = client->dev.of_node; u32 vmem_size; struct ssd1307fb_par *par; u8 *vmem; int ret; if (!node) { dev_err(&client->dev, "No device tree data found!\n"); return -EINVAL; }
functions
int ssd1307fb_remove(struct i2c_client *client) { struct fb_info *info = i2c_get_clientdata(client); struct ssd1307fb_par *par = info->par; unregister_framebuffer(info); if (par->ops->remove) par->ops->remove(par); fb_deferred_io_cleanup(info); framebuffer_release(info); return 0; }
includes
#include <linux/init.h>
includes
#include <linux/errno.h>
includes
#include <linux/delay.h>
includes
#include <linux/device.h>
includes
#include <linux/jiffies.h>
includes
#include <linux/smp.h>
includes
#include <asm/cacheflush.h>