Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8233
b: refs/heads/master
c: ba44cd2
h: refs/heads/master
i:
  8231: a4a7c74
v: v3
  • Loading branch information
Richard Purdie authored and Linus Torvalds committed Sep 9, 2005
1 parent dda2736 commit e787272
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61ab7903b8cd772d3bfb28bc26d02c599cfb0e5b
refs/heads/master: ba44cd2d8abc3271a608b42cdbf55e1e575e2ba5
32 changes: 32 additions & 0 deletions trunk/drivers/video/pxafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,36 @@ static inline unsigned int get_pcd(unsigned int pixclock)
return (unsigned int)pcd;
}

/*
* Some touchscreens need hsync information from the video driver to
* function correctly. We export it here.
*/
static inline void set_hsync_time(struct pxafb_info *fbi, unsigned int pcd)
{
unsigned long long htime;

if ((pcd == 0) || (fbi->fb.var.hsync_len == 0)) {
fbi->hsync_time=0;
return;
}

htime = (unsigned long long)get_lcdclk_frequency_10khz() * 10000;
do_div(htime, pcd * fbi->fb.var.hsync_len);
fbi->hsync_time = htime;
}

unsigned long pxafb_get_hsync_time(struct device *dev)
{
struct pxafb_info *fbi = dev_get_drvdata(dev);

/* If display is blanked/suspended, hsync isn't active */
if (!fbi || (fbi->state != C_ENABLE))
return 0;

return fbi->hsync_time;
}
EXPORT_SYMBOL(pxafb_get_hsync_time);

/*
* pxafb_activate_var():
* Configures LCD Controller based on entries in var parameter. Settings are
Expand Down Expand Up @@ -631,6 +661,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *
fbi->reg_lccr1 = new_regs.lccr1;
fbi->reg_lccr2 = new_regs.lccr2;
fbi->reg_lccr3 = new_regs.lccr3;
set_hsync_time(fbi, pcd);
local_irq_restore(flags);

/*
Expand Down Expand Up @@ -907,6 +938,7 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data)

case CPUFREQ_POSTCHANGE:
pcd = get_pcd(fbi->fb.var.pixclock);
set_hsync_time(fbi, pcd);
fbi->reg_lccr3 = (fbi->reg_lccr3 & ~0xff) | LCCR3_PixClkDiv(pcd);
set_ctrlr_state(fbi, C_ENABLE_CLKCHANGE);
break;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/video/pxafb.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ struct pxafb_info {
u_int reg_lccr2;
u_int reg_lccr3;

unsigned long hsync_time;

volatile u_char state;
volatile u_char task_state;
struct semaphore ctrlr_sem;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-arm/arch-pxa/pxafb.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ struct pxafb_mach_info {

};
void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
unsigned long pxafb_get_hsync_time(struct device *dev);

0 comments on commit e787272

Please sign in to comment.