コード例 #1
0
ファイル: shifter.c プロジェクト: Konovalets/mtPaint
		uSPIN(sfd[0], 0, 255), EVENT(CHANGE, shifter_moved),
	TLLABELx(_("Finish"), 2, 0, 0, 0, 5),
		uSPIN(sfd[1], 0, 255), EVENT(CHANGE, shifter_moved),
	TLLABELx(_("Delay"), 3, 0, 0, 0, 5),
		uSPIN(sfd[2], 0, 255), EVENT(CHANGE, shifter_moved),
	DEFBORDER(LABEL),
	TLTEXT("0\n1\n2\n3\n4\n5\n6\n7", 0, 1),
	REF(spinpack), TLSPINPACKv(spins, 3 * NSHIFT, shifter_moved, 3, 1, 1),
	TRIGGER,
	WDONE,
	HBOX,
	UTOGGLEv(_("Play"), shift_play_state, shift_btn), UNNAME,
	BORDER(LABEL, 0),
	REF(label), XLABELcr(""),
	WDONE,
	REF(slider), SPINSLIDEa(frame), OPNAME("Play"),
	EVENT(CHANGE, shifter_slider_moved),
	HSEP,
	HBOX,
	REF(clear), BUTTONs(_("Clear"), shift_btn),
	REF(fix), BUTTONs(_("Fix Palette"), shift_btn),
	REF(create), BUTTONs(_("Create Frames"), shift_btn),
	CANCELBTN(_("Close"), shift_btn), uOKBTN(shift_btn),
	WDONE,
// !!! Transient windows cannot be minimized; don't know if that's desirable here
	ONTOP0,
	WSHOW
};
#undef WBbase

#undef _
コード例 #2
0
ファイル: kml_unpack.c プロジェクト: JBTech/ralink_rt5350
                __u32 *i = (__u32 *)ptr;
                if (*i)
                        break;
                ptr += sizeof(*i);
        }
	*buf = ptr;
	return 0;
}


#ifndef __KERNEL__
#define STR(ptr) ((ptr))? (ptr) : ""

#define OPNAME(n) [KML_OPCODE_##n] = #n
static char *opnames[KML_OPCODE_NUM] = {
	OPNAME(NOOP),
	OPNAME(CREATE),
	OPNAME(MKDIR), 
	OPNAME(UNLINK),
	OPNAME(RMDIR),
	OPNAME(CLOSE),
	OPNAME(SYMLINK),
	OPNAME(RENAME),
	OPNAME(SETATTR),
	OPNAME(LINK),
	OPNAME(OPEN),
	OPNAME(MKNOD),
	OPNAME(WRITE),
	OPNAME(RELEASE),
	OPNAME(TRUNC),
	OPNAME(SETEXTATTR),
コード例 #3
0
ファイル: audio.c プロジェクト: adegroote/netbsd-drmgem
int main(int argc, char **argv)
{
	I830Rec i830;
	I830Ptr pI830 = &i830;
	uint32_t dword;
	int i;

	do_self_tests();
	intel_i830rec_init(pI830);

	/* printf("%-18s   %8s  %s\n\n", "register name", "raw value", "description"); */

#if 0				/* enable HDMI audio bits */
	dump_reg(SDVOB, "Digital Display Port B Control Register");
	dword |= SDVO_ENABLE;
	dword |= SDVO_BORDER_ENABLE;
	dword |= SDVO_AUDIO_ENABLE;
	dword |= SDVO_NULL_PACKETS_DURING_VSYNC;
	OUTREG(SDVOB, dword);

	dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");
	OUTREG(PORT_HOTPLUG_EN, dword | AUDIO_HOTPLUG_EN);

	dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
	dword &= ~(VIDEO_DIP_ENABLE_AVI |
		   VIDEO_DIP_ENABLE_VENDOR | VIDEO_DIP_ENABLE_SPD);
	OUTREG(VIDEO_DIP_CTL, dword);
	dword |= VIDEO_DIP_ENABLE;
	OUTREG(VIDEO_DIP_CTL, dword);
#endif

#if 0				/* disable HDMI audio bits */
	dump_reg(SDVOB, "Digital Display Port B Control Register");
	dword &= ~SDVO_AUDIO_ENABLE;
	dword &= ~SDVO_NULL_PACKETS_DURING_VSYNC;
	OUTREG(SDVOB, dword);
#endif

	dump_reg(VIDEO_DIP_CTL, "Video DIP Control");
	dump_reg(SDVOB, "Digital Display Port B Control Register");
	dump_reg(SDVOC, "Digital Display Port C Control Register");
	dump_reg(PORT_HOTPLUG_EN, "Hot Plug Detect Enable");

	dump_reg(AUD_CONFIG, "Audio Configuration");
	dump_reg(AUD_DEBUG, "Audio Debug");
	dump_reg(AUD_VID_DID, "Audio Vendor ID / Device ID");
	dump_reg(AUD_RID, "Audio Revision ID");
	dump_reg(AUD_SUBN_CNT, "Audio Subordinate Node Count");
	dump_reg(AUD_FUNC_GRP, "Audio Function Group Type");
	dump_reg(AUD_SUBN_CNT2, "Audio Subordinate Node Count");
	dump_reg(AUD_GRP_CAP, "Audio Function Group Capabilities");
	dump_reg(AUD_PWRST, "Audio Power State");
	dump_reg(AUD_SUPPWR, "Audio Supported Power States");
	dump_reg(AUD_SID, "Audio Root Node Subsystem ID");
	dump_reg(AUD_OUT_CWCAP, "Audio Output Converter Widget Capabilities");
	dump_reg(AUD_OUT_PCMSIZE, "Audio PCM Size and Rates");
	dump_reg(AUD_OUT_STR, "Audio Stream Formats");
	dump_reg(AUD_OUT_DIG_CNVT, "Audio Digital Converter");
	dump_reg(AUD_OUT_CH_STR, "Audio Channel ID and Stream ID");
	dump_reg(AUD_OUT_STR_DESC, "Audio Stream Descriptor Format");
	dump_reg(AUD_PINW_CAP, "Audio Pin Complex Widget Capabilities");
	dump_reg(AUD_PIN_CAP, "Audio Pin Capabilities");
	dump_reg(AUD_PINW_CONNLNG, "Audio Connection List Length");
	dump_reg(AUD_PINW_CONNLST, "Audio Connection List Entry");
	dump_reg(AUD_PINW_CNTR, "Audio Pin Widget Control");
	dump_reg(AUD_PINW_UNSOLRESP, "Audio Unsolicited Response Enable");
	dump_reg(AUD_CNTL_ST, "Audio Control State Register");
	dump_reg(AUD_PINW_CONFIG, "Audio Configuration Default");
	dump_reg(AUD_HDMIW_STATUS, "Audio HDMI Status");
	dump_reg(AUD_HDMIW_HDMIEDID, "Audio HDMI Data EDID Block");
	dump_reg(AUD_HDMIW_INFOFR, "Audio HDMI Widget Data Island Packet");
	dump_reg(AUD_CONV_CHCNT, "Audio Converter Channel Count");
	dump_reg(AUD_CTS_ENABLE, "Audio CTS Programming Enable");

	printf("\nDetails:\n\n");

	dword = INREG(AUD_VID_DID);
	printf("AUD_VID_DID vendor id\t\t\t0x%x\n", dword >> 16);
	printf("AUD_VID_DID device id\t\t\t0x%x\n", dword & 0xffff);

	dword = INREG(AUD_RID);
	printf("AUD_RID major revision\t\t\t0x%lx\n", BITS(dword, 23, 20));
	printf("AUD_RID minor revision\t\t\t0x%lx\n", BITS(dword, 19, 16));
	printf("AUD_RID revision id\t\t\t0x%lx\n", BITS(dword, 15, 8));
	printf("AUD_RID stepping id\t\t\t0x%lx\n", BITS(dword, 7, 0));

	dword = INREG(SDVOB);
	printf("SDVOB enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
	printf("SDVOB HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
	printf("SDVOB SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
	printf("SDVOB null packets\t\t\t%u\n",
	       !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
	printf("SDVOB audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));

	dword = INREG(SDVOC);
	printf("SDVOC enable\t\t\t\t%u\n", !!(dword & SDVO_ENABLE));
	printf("SDVOC HDMI encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_HDMI));
	printf("SDVOC SDVO encoding\t\t\t%u\n", !!(dword & SDVO_ENCODING_SDVO));
	printf("SDVOC null packets\t\t\t%u\n",
	       !!(dword & SDVO_NULL_PACKETS_DURING_VSYNC));
	printf("SDVOC audio enabled\t\t\t%u\n", !!(dword & SDVO_AUDIO_ENABLE));

	dword = INREG(PORT_HOTPLUG_EN);
	printf("PORT_HOTPLUG_EN DisplayPort/HDMI port B\t%ld\n",
	       BIT(dword, 29)),
	    printf("PORT_HOTPLUG_EN DisplayPort/HDMI port C\t%ld\n",
		   BIT(dword, 28)),
	    printf("PORT_HOTPLUG_EN DisplayPort port D\t%ld\n", BIT(dword, 27)),
	    printf("PORT_HOTPLUG_EN SDVOB\t\t\t%ld\n", BIT(dword, 26)),
	    printf("PORT_HOTPLUG_EN SDVOC\t\t\t%ld\n", BIT(dword, 25)),
	    printf("PORT_HOTPLUG_EN audio\t\t\t%ld\n", BIT(dword, 24)),
	    printf("PORT_HOTPLUG_EN TV\t\t\t%ld\n", BIT(dword, 23)),
	    printf("PORT_HOTPLUG_EN CRT\t\t\t%ld\n", BIT(dword, 9)), dword =
	    INREG(VIDEO_DIP_CTL);
	printf("VIDEO_DIP_CTL enable graphics DIP\t%ld\n", BIT(dword, 31)),
	    printf("VIDEO_DIP_CTL port select\t\t[0x%lx] %s\n",
		   BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
	printf("VIDEO_DIP_CTL DIP buffer trans active\t%lu\n", BIT(dword, 28));
	printf("VIDEO_DIP_CTL AVI DIP enabled\t\t%lu\n", BIT(dword, 21));
	printf("VIDEO_DIP_CTL vendor DIP enabled\t%lu\n", BIT(dword, 22));
	printf("VIDEO_DIP_CTL SPD DIP enabled\t\t%lu\n", BIT(dword, 24));
	printf("VIDEO_DIP_CTL DIP buffer index\t\t[0x%lx] %s\n",
	       BITS(dword, 20, 19), video_dip_index[BITS(dword, 20, 19)]);
	printf("VIDEO_DIP_CTL DIP trans freq\t\t[0x%lx] %s\n",
	       BITS(dword, 17, 16), video_dip_trans[BITS(dword, 17, 16)]);
	printf("VIDEO_DIP_CTL DIP buffer size\t\t%lu\n", BITS(dword, 11, 8));
	printf("VIDEO_DIP_CTL DIP address\t\t%lu\n", BITS(dword, 3, 0));

	dword = INREG(AUD_CONFIG);
	printf("AUD_CONFIG pixel clock\t\t\t[0x%lx] %s\n", BITS(dword, 19, 16),
	       OPNAME(pixel_clock, BITS(dword, 19, 16)));
	printf("AUD_CONFIG fabrication enabled\t\t%lu\n", BITS(dword, 2, 2));
	printf("AUD_CONFIG professional use allowed\t%lu\n", BIT(dword, 1));
	printf("AUD_CONFIG fuse enabled\t\t\t%lu\n", BIT(dword, 0));

	dword = INREG(AUD_DEBUG);
	printf("AUD_DEBUG function reset\t\t%lu\n", BIT(dword, 0));

	dword = INREG(AUD_SUBN_CNT);
	printf("AUD_SUBN_CNT starting node number\t0x%lx\n",
	       BITS(dword, 23, 16));
	printf("AUD_SUBN_CNT total number of nodes\t0x%lx\n",
	       BITS(dword, 7, 0));

	dword = INREG(AUD_SUBN_CNT2);
	printf("AUD_SUBN_CNT2 starting node number\t0x%lx\n",
	       BITS(dword, 24, 16));
	printf("AUD_SUBN_CNT2 total number of nodes\t0x%lx\n",
	       BITS(dword, 7, 0));

	dword = INREG(AUD_FUNC_GRP);
	printf("AUD_FUNC_GRP unsol capable\t\t%lu\n", BIT(dword, 8));
	printf("AUD_FUNC_GRP node type\t\t\t0x%lx\n", BITS(dword, 7, 0));

	dword = INREG(AUD_GRP_CAP);
	printf("AUD_GRP_CAP beep 0\t\t\t%lu\n", BIT(dword, 16));
	printf("AUD_GRP_CAP input delay\t\t\t%lu\n", BITS(dword, 11, 8));
	printf("AUD_GRP_CAP output delay\t\t%lu\n", BITS(dword, 3, 0));

	dword = INREG(AUD_PWRST);
	printf("AUD_PWRST device power state\t\t%s\n",
	       power_state[BITS(dword, 5, 4)]);
	printf("AUD_PWRST device power state setting\t%s\n",
	       power_state[BITS(dword, 1, 0)]);

	dword = INREG(AUD_SUPPWR);
	printf("AUD_SUPPWR support D0\t\t\t%lu\n", BIT(dword, 0));
	printf("AUD_SUPPWR support D1\t\t\t%lu\n", BIT(dword, 1));
	printf("AUD_SUPPWR support D2\t\t\t%lu\n", BIT(dword, 2));
	printf("AUD_SUPPWR support D3\t\t\t%lu\n", BIT(dword, 3));

	dword = INREG(AUD_OUT_CWCAP);
	printf("AUD_OUT_CWCAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
	printf("AUD_OUT_CWCAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
	printf("AUD_OUT_CWCAP channel count\t\t%lu\n",
	       BITS(dword, 15, 13) * 2 + BIT(dword, 0) + 1);
	printf("AUD_OUT_CWCAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
	printf("AUD_OUT_CWCAP power control\t\t%lu\n", BIT(dword, 10));
	printf("AUD_OUT_CWCAP digital\t\t\t%lu\n", BIT(dword, 9));
	printf("AUD_OUT_CWCAP conn list\t\t\t%lu\n", BIT(dword, 8));
	printf("AUD_OUT_CWCAP unsol\t\t\t%lu\n", BIT(dword, 7));
	printf("AUD_OUT_CWCAP mute\t\t\t%lu\n", BIT(dword, 5));
	printf("AUD_OUT_CWCAP format override\t\t%lu\n", BIT(dword, 4));
	printf("AUD_OUT_CWCAP amp param override\t%lu\n", BIT(dword, 3));
	printf("AUD_OUT_CWCAP out amp present\t\t%lu\n", BIT(dword, 2));
	printf("AUD_OUT_CWCAP in amp present\t\t%lu\n", BIT(dword, 1));

	dword = INREG(AUD_OUT_DIG_CNVT);
	printf("AUD_OUT_DIG_CNVT SPDIF category\t\t0x%lx\n",
	       BITS(dword, 14, 8));
	printf("AUD_OUT_DIG_CNVT SPDIF level\t\t%lu\n", BIT(dword, 7));
	printf("AUD_OUT_DIG_CNVT professional\t\t%lu\n", BIT(dword, 6));
	printf("AUD_OUT_DIG_CNVT non PCM\t\t%lu\n", BIT(dword, 5));
	printf("AUD_OUT_DIG_CNVT copyright asserted\t%lu\n", BIT(dword, 4));
	printf("AUD_OUT_DIG_CNVT filter preemphasis\t%lu\n", BIT(dword, 3));
	printf("AUD_OUT_DIG_CNVT validity config\t%lu\n", BIT(dword, 2));
	printf("AUD_OUT_DIG_CNVT validity flag\t\t%lu\n", BIT(dword, 1));
	printf("AUD_OUT_DIG_CNVT digital enable\t\t%lu\n", BIT(dword, 0));

	dword = INREG(AUD_OUT_CH_STR);
	printf("AUD_OUT_CH_STR stream id\t\t0x%lx\n", BITS(dword, 7, 4));
	printf("AUD_OUT_CH_STR lowest channel\t\t0x%lx\n", BITS(dword, 3, 0));

	dword = INREG(AUD_OUT_STR_DESC);
	printf("AUD_OUT_STR_DESC stream channels\t0x%lx\n", BITS(dword, 3, 0));

	dword = INREG(AUD_PINW_CAP);
	printf("AUD_PINW_CAP widget type\t\t0x%lx\n", BITS(dword, 23, 20));
	printf("AUD_PINW_CAP sample delay\t\t0x%lx\n", BITS(dword, 19, 16));
	printf("AUD_PINW_CAP channel count\t\t0x%lx\n",
	       BITS(dword, 15, 13) * 2 + BIT(dword, 0));
	printf("AUD_PINW_CAP HDCP\t\t\t%lu\n", BIT(dword, 12));
	printf("AUD_PINW_CAP L-R swap\t\t\t%lu\n", BIT(dword, 11));
	printf("AUD_PINW_CAP power control\t\t%lu\n", BIT(dword, 10));
	printf("AUD_PINW_CAP digital\t\t\t%lu\n", BIT(dword, 9));
	printf("AUD_PINW_CAP conn list\t\t\t%lu\n", BIT(dword, 8));
	printf("AUD_PINW_CAP unsol\t\t\t%lu\n", BIT(dword, 7));
	printf("AUD_PINW_CAP mute\t\t\t%lu\n", BIT(dword, 5));
	printf("AUD_PINW_CAP format override\t\t%lu\n", BIT(dword, 4));
	printf("AUD_PINW_CAP amp param override\t\t%lu\n", BIT(dword, 3));
	printf("AUD_PINW_CAP out amp present\t\t%lu\n", BIT(dword, 2));
	printf("AUD_PINW_CAP in amp present\t\t%lu\n", BIT(dword, 1));

	dword = INREG(AUD_PIN_CAP);
	printf("AUD_PIN_CAP EAPD\t\t\t%lu\n", BIT(dword, 16));
	printf("AUD_PIN_CAP HDMI\t\t\t%lu\n", BIT(dword, 7));
	printf("AUD_PIN_CAP output\t\t\t%lu\n", BIT(dword, 4));
	printf("AUD_PIN_CAP presence detect\t\t%lu\n", BIT(dword, 2));

	dword = INREG(AUD_PINW_CNTR);
	printf("AUD_PINW_CNTR mute status\t\t%lu\n", BIT(dword, 8));
	printf("AUD_PINW_CNTR out enable\t\t%lu\n", BIT(dword, 6));
	printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
	printf("AUD_PINW_CNTR amp mute status\t\t%lu\n", BIT(dword, 8));
	printf("AUD_PINW_CNTR stream type\t\t[0x%lx] %s\n",
	       BITS(dword, 2, 0), OPNAME(stream_type, BITS(dword, 2, 0)));

	dword = INREG(AUD_PINW_UNSOLRESP);
	printf("AUD_PINW_UNSOLRESP enable unsol resp\t%lu\n", BIT(dword, 31));

	dword = INREG(AUD_CNTL_ST);
	printf("AUD_CNTL_ST DIP audio enabled\t\t%lu\n", BIT(dword, 21));
	printf("AUD_CNTL_ST DIP ACP enabled\t\t%lu\n", BIT(dword, 22));
	printf("AUD_CNTL_ST DIP ISRCx enabled\t\t%lu\n", BIT(dword, 23));
	printf("AUD_CNTL_ST DIP port select\t\t[0x%lx] %s\n",
	       BITS(dword, 30, 29), dip_port[BITS(dword, 30, 29)]);
	printf("AUD_CNTL_ST DIP buffer index\t\t[0x%lx] %s\n",
	       BITS(dword, 20, 18), OPNAME(dip_index, BITS(dword, 20, 18)));
	printf("AUD_CNTL_ST DIP trans freq\t\t[0x%lx] %s\n",
	       BITS(dword, 17, 16), dip_trans[BITS(dword, 17, 16)]);
	printf("AUD_CNTL_ST DIP address\t\t\t%lu\n", BITS(dword, 3, 0));
	printf("AUD_CNTL_ST CP ready\t\t\t%lu\n", BIT(dword, 15));
	printf("AUD_CNTL_ST ELD valid\t\t\t%lu\n", BIT(dword, 14));
	printf("AUD_CNTL_ST ELD ack\t\t\t%lu\n", BIT(dword, 4));
	printf("AUD_CNTL_ST ELD bufsize\t\t\t%lu\n", BITS(dword, 13, 9));
	printf("AUD_CNTL_ST ELD address\t\t\t%lu\n", BITS(dword, 8, 5));

	dword = INREG(AUD_HDMIW_STATUS);
	printf("AUD_HDMIW_STATUS CDCLK/DOTCLK underrun\t%lu\n", BIT(dword, 31));
	printf("AUD_HDMIW_STATUS CDCLK/DOTCLK overrun\t%lu\n", BIT(dword, 30));
	printf("AUD_HDMIW_STATUS BCLK/CDCLK underrun\t%lu\n", BIT(dword, 29));
	printf("AUD_HDMIW_STATUS BCLK/CDCLK overrun\t%lu\n", BIT(dword, 28));

	dword = INREG(AUD_CONV_CHCNT);
	printf("AUD_CONV_CHCNT HDMI HBR enabled\t\t%lu\n", BITS(dword, 15, 14));
	printf("AUD_CONV_CHCNT HDMI channel count\t%lu\n",
	       BITS(dword, 11, 8) + 1);

	printf("AUD_CONV_CHCNT HDMI channel mapping:\n");
	for (i = 0; i < 8; i++) {
		OUTREG(AUD_CONV_CHCNT, i);
		dword = INREG(AUD_CONV_CHCNT);
		printf("\t\t\t\t\t[0x%x] %u => %lu \n", dword, i,
		       BITS(dword, 7, 4));
	}

	return 0;
}