From e80987c430326ce0e22f0eb61314bfb949e5f23a Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 10 Dec 2012 20:21:04 -0500 Subject: [PATCH] rename mxcfb_update_data51 to mxcfb_update_data as suggested by eureka@mobileread: http://www.mobileread.com/forums/showthread.php?p=2337061#post2337061 --- einkfb.c | 9 +++++---- include/mxcfb.h | 14 ++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/einkfb.c b/einkfb.c index f4a10a8bb..af237db63 100644 --- a/einkfb.c +++ b/einkfb.c @@ -96,7 +96,7 @@ inline void fillUpdateAreaT(update_area_t *myarea, FBInfo *fb, lua_State *L) { myarea->which_fx = fxtype ? fx_update_partial : fx_update_full; } -inline void fillMxcfbUpdateData51(mxcfb_update_data51 *myarea, FBInfo *fb, lua_State *L) { +inline void fillMxcfbUpdateData(mxcfb_update_data *myarea, FBInfo *fb, lua_State *L) { myarea->update_region.top = luaL_optint(L, 3, 0); myarea->update_region.left = luaL_optint(L, 4, 0); myarea->update_region.width = luaL_optint(L, 5, fb->vinfo.xres); @@ -135,13 +135,14 @@ void kindle4einkUpdate(FBInfo *fb, lua_State *L) { ioctl(fb->fd, FBIO_EINK_UPDATE_DISPLAY_AREA, &myarea); } +/* for kindle firmware with version >= 5.1, 5.0 is not supported for now */ void kindle51einkUpdate(FBInfo *fb, lua_State *L) { - mxcfb_update_data51 myarea; + mxcfb_update_data myarea; fb4BppTo8Bpp(fb); - fillMxcfbUpdateData51(&myarea, fb, L); + fillMxcfbUpdateData(&myarea, fb, L); - ioctl(fb->fd, MXCFB_SEND_UPDATE51, &myarea); + ioctl(fb->fd, MXCFB_SEND_UPDATE, &myarea); } #endif diff --git a/include/mxcfb.h b/include/mxcfb.h index 4e313299b..a933ef1ad 100644 --- a/include/mxcfb.h +++ b/include/mxcfb.h @@ -1,7 +1,7 @@ /* * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved. * - * - Modified by houqp, added mxcfb_update_data51 struct from GeekMaster's + * - Modified by houqp, added mxcfb_update_data struct from GeekMaster's * video player, refer to: * http://www.mobileread.com/forums/showthread.php?t=177455&page=10 * @@ -107,7 +107,7 @@ struct mxcfb_alt_buffer_data { struct mxcfb_rect alt_update_region; /* region within buffer to update */ }; -struct mxcfb_update_data51 { +struct mxcfb_update_data { struct mxcfb_rect update_region; __u32 waveform_mode; __u32 update_mode; @@ -118,9 +118,11 @@ struct mxcfb_update_data51 { uint flags; struct mxcfb_alt_buffer_data alt_buffer_data; }; -typedef struct mxcfb_update_data51 mxcfb_update_data51; +typedef struct mxcfb_update_data mxcfb_update_data; -struct mxcfb_update_data { +/* this is only used in kindle firmware 5.0, later version (5.1) has changed + * the struct to mxcfb_update_data (see above) */ +struct mxcfb_update_data_50x { struct mxcfb_rect update_region; __u32 waveform_mode; __u32 update_mode; @@ -160,7 +162,7 @@ struct mxcfb_waveform_modes { #define MXCFB_SET_WAVEFORM_MODES _IOW('F', 0x2B, struct mxcfb_waveform_modes) #define MXCFB_SET_TEMPERATURE _IOW('F', 0x2C, int32_t) #define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32) -#define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data) +#define MXCFB_SEND_UPDATE_50X _IOW('F', 0x2E, struct mxcfb_update_data_50x) #define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOW('F', 0x2F, __u32) #define MXCFB_SET_PWRDOWN_DELAY _IOW('F', 0x30, int32_t) #define MXCFB_GET_PWRDOWN_DELAY _IOR('F', 0x31, int32_t) @@ -173,7 +175,7 @@ struct mxcfb_waveform_modes { #define MXCFB_SET_MERGE_ON_WAVEFORM_MISMATCH _IOW('F', 0x37, int32_t) /* IOCTLs for E-ink panel updates, kindle firmware version >= 5.1 */ -#define MXCFB_SEND_UPDATE51 _IOW('F', 0x2E, struct mxcfb_update_data51) +#define MXCFB_SEND_UPDATE _IOW('F', 0x2E, struct mxcfb_update_data) #ifdef __KERNEL__