Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344525
b: refs/heads/master
c: e95c17e
h: refs/heads/master
i:
  344523: 8038a7a
v: v3
  • Loading branch information
Timur Tabi committed Nov 26, 2012
1 parent 7875acb commit 49b62ec
Show file tree
Hide file tree
Showing 3 changed files with 27 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: 2867173572d5ca5084e8836c8a1d0cafa95b729b
refs/heads/master: e95c17e9caff4b106cc95b761f3e07964a5a0d9f
17 changes: 17 additions & 0 deletions trunk/drivers/video/fsl-diu-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,23 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
ad->ckmin_b = ck.blue_min;
}
break;
#ifdef CONFIG_PPC_MPC512x
case MFB_SET_GAMMA: {
struct fsl_diu_data *data = mfbi->parent;

if (copy_from_user(data->gamma, buf, sizeof(data->gamma)))
return -EFAULT;
setbits32(&data->diu_reg->gamma, 0); /* Force table reload */
break;
}
case MFB_GET_GAMMA: {
struct fsl_diu_data *data = mfbi->parent;

if (copy_to_user(buf, data->gamma, sizeof(data->gamma)))
return -EFAULT;
break;
}
#endif
default:
dev_err(info->dev, "unknown ioctl command (0x%08X)\n", cmd);
return -ENOIOCTLCMD;
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/fsl-diu-fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ struct aoi_display_offset {
#define MFB_SET_PIXFMT _IOW('M', 8, __u32)
#define MFB_GET_PIXFMT _IOR('M', 8, __u32)

/*
* The MPC5121 BSP comes with a gamma_set utility that initializes the
* gamma table. Unfortunately, it uses bad values for the IOCTL commands,
* but there's nothing we can do about it now. These ioctls are only
* supported on the MPC5121.
*/
#define MFB_SET_GAMMA _IOW('M', 1, __u8)
#define MFB_GET_GAMMA _IOR('M', 1, __u8)

/*
* The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
* wrong value for 'size' field of the ioctl. The current macros above use the
Expand Down

0 comments on commit 49b62ec

Please sign in to comment.