Date: Sun, 3 Jul 2016 16:46:48 GMT From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r305694 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve Message-ID: <201607031646.u63GkmNY073672@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: iateaca Date: Sun Jul 3 16:46:47 2016 New Revision: 305694 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305694 Log: fix the hda_write_reg: for one offset allow writes of sizes 1, 2, 3, 4 bytes M bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun Jul 3 15:00:12 2016 (r305693) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun Jul 3 16:46:47 2016 (r305694) @@ -120,7 +120,7 @@ static uint32_t hda_read(struct hda_softc *sc, uint32_t offset); static int -hda_write(struct hda_softc *sc, uint32_t offset, uint32_t value); +hda_write(struct hda_softc *sc, uint32_t offset, uint8_t size, uint32_t value); static void hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p); @@ -616,12 +616,13 @@ } static int -hda_write(struct hda_softc *sc, uint32_t offset, uint32_t value) +hda_write(struct hda_softc *sc, uint32_t offset, uint8_t size, uint32_t value) { uint32_t old = hda_get_reg_by_offset(sc, offset); + uint32_t masks[] = {0x00000000, 0x000000ff, 0x0000ffff, 0x00ffffff, 0xffffffff}; hda_set_reg_handler set_reg_handler = hda_set_reg_table[offset]; - hda_set_reg_by_offset(sc, offset, value); + hda_set_field_by_offset(sc, offset, masks[size], value); if (set_reg_handler) set_reg_handler(sc, offset, old); @@ -853,8 +854,6 @@ DPRINTF("stream_ind: 0x%x old: 0x%x value: 0x%x\n", stream_ind, old, value); - hda_set_field_by_offset(sc, offset, 0x00ffff00, old); - if (value & HDAC_SDCTL_SRST) { hda_stream_reset(sc, stream_ind); } @@ -1069,7 +1068,7 @@ DPRINTF("offset: 0x%lx value: 0x%lx\n", offset, value); - err = hda_write(sc, offset, value); + err = hda_write(sc, offset, size, value); assert(!err); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607031646.u63GkmNY073672>