Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] New ioctl OSD_GET_CAPABILITY/OSD_CAP_MEMSIZE
Hi,
I'd like to add a function to determine the size of OSD memory.
If nobody complains I will add this to DVB and dvb-kernel CVS.
Any comments?
Oliver
---------------------------- snip ---------------------------------
Index: drivers/media/dvb/ttpci/av7110.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/ttpci/av7110.c,v
retrieving revision 1.119
diff -p -u -r1.119 av7110.c
--- drivers/media/dvb/ttpci/av7110.c 6 Apr 2004 13:12:47 -0000 1.119
+++ drivers/media/dvb/ttpci/av7110.c 18 Jul 2004 16:42:33 -0000
@@ -641,6 +641,8 @@ static int dvb_osd_ioctl(struct inode *i
if (cmd == OSD_SEND_CMD)
return av7110_osd_cmd(av7110, (osd_cmd_t *) parg);
+ if (cmd == OSD_GET_CAPABILITY)
+ return av7110_osd_capability(av7110, (osd_cap_t *) parg);
return -EINVAL;
}
Index: drivers/media/dvb/ttpci/av7110_hw.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/ttpci/av7110_hw.c,v
retrieving revision 1.10.2.1
diff -p -u -r1.10.2.1 av7110_hw.c
--- drivers/media/dvb/ttpci/av7110_hw.c 13 Jun 2004 16:20:54 -0000 1.10.2.1
+++ drivers/media/dvb/ttpci/av7110_hw.c 18 Jul 2004 16:42:35 -0000
@@ -1035,4 +1035,18 @@ int av7110_osd_cmd(struct av7110 *av7110
return -EINVAL;
}
}
+
+int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap)
+{
+ switch (cap->cmd) {
+ case OSD_CAP_MEMSIZE:
+ if (FW_4M_SDRAM(av7110->arm_app))
+ cap->val = 1000000;
+ else
+ cap->val = 92000;
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
#endif /* CONFIG_DVB_AV7110_OSD */
Index: drivers/media/dvb/ttpci/av7110_hw.h
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/ttpci/av7110_hw.h,v
retrieving revision 1.6
diff -p -u -r1.6 av7110_hw.h
--- drivers/media/dvb/ttpci/av7110_hw.h 23 Mar 2004 17:56:53 -0000 1.6
+++ drivers/media/dvb/ttpci/av7110_hw.h 18 Jul 2004 16:42:36 -0000
@@ -388,6 +388,7 @@ extern void av7110_reset_arm(struct av71
extern int av7110_bootarm(struct av7110 *av7110);
extern int av7110_firmversion(struct av7110 *av7110);
#define FW_CI_LL_SUPPORT(arm_app) ((arm_app) & 0x80000000)
+#define FW_4M_SDRAM(arm_app) ((arm_app) & 0x40000000)
#define FW_VERSION(arm_app) ((arm_app) & 0x0000FFFF)
extern int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...);
@@ -510,6 +511,7 @@ extern int av7110_diseqc_send(struct av7
#ifdef CONFIG_DVB_AV7110_OSD
extern int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc);
+extern int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap);
#endif /* CONFIG_DVB_AV7110_OSD */
Index: include/linux/dvb/osd.h
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/include/linux/dvb/osd.h,v
retrieving revision 1.1
diff -p -u -r1.1 osd.h
--- include/linux/dvb/osd.h 17 Oct 2002 15:51:03 -0000 1.1
+++ include/linux/dvb/osd.h 18 Jul 2004 16:42:36 -0000
@@ -105,7 +105,15 @@ typedef struct osd_cmd_s {
} osd_cmd_t;
-#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
+typedef struct osd_cap_s {
+ int cmd;
+#define OSD_CAP_MEMSIZE 1 /* memory size */
+ long val;
+} osd_cap_t;
+
+
+#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
+#define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
#endif
Home |
Main Index |
Thread Index