Chameleon

Chameleon Commit Details

Date:2015-07-13 00:31:17 (4 years 10 days ago)
Author:ErmaC
Commit:2735
Parents: 2734
Message:Skip case also for GFX audio (ATi/AMD and nVidia).
Changes:
M/trunk/i386/libsaio/hda.c

File differences

trunk/i386/libsaio/hda.c
662662
663663
664664
665
666
667
668
669
670
665671
666672
667673
......
773779
774780
775781
776
777
778
782
779783
780
781
784
785
786
787
788
789
782790
783
784
791
792
793
794
795
796
797
798
799
800
801
785802
786803
804
805
806
807
808
809
787810
788
789
790
791
792
793
794
795
796
797
798
799811
800812
801813
......
828840
829841
830842
831
832
833
843
834844
835
836
845
846
847
848
849
850
837851
838
839
852
853
854
855
856
857
858
859
860
861
862
840863
841864
865
866
867
868
842869
843
844
845
846
847
848
849
850
851
852870
853871
854872
uint16_tcontroller_device_id = hda_dev->device_id;
const char*value;
// Skip keys
bool do_skip_n_devprop = false;
bool do_skip_a_devprop = false;
getBoolForKey(kSkipNvidiaGfx, &do_skip_n_devprop, &bootInfo->chameleonConfig);
getBoolForKey(kSkipAtiGfx, &do_skip_a_devprop, &bootInfo->chameleonConfig);
verbose("\tClass code: [%04X]\n", hda_dev->class_id);
devicepath = get_pci_dev_path(hda_dev);
case HDA_NVIDIA_0BE4:
case HDA_NVIDIA_0BE3:
case HDA_NVIDIA_0BE2:
/* if the key value kHDAULayoutID as a value set that value, if not will assign a default layout */
if (getValueForKey(kHDAULayoutID, &value, &len, &bootInfo->chameleonConfig) && len == HDAU_LEN * 2)
if ( do_skip_n_devprop )
{
uint8_t new_HDAU_layout_id[HDAU_LEN];
if (hex2bin(value, new_HDAU_layout_id, HDAU_LEN) == 0)
verbose("Skip Nvidia audio device!\n");
}
else
{
/* if the key value kHDAULayoutID as a value set that value, if not will assign a default layout */
if (getValueForKey(kHDAULayoutID, &value, &len, &bootInfo->chameleonConfig) && len == HDAU_LEN * 2)
{
memcpy(default_HDAU_layout_id, new_HDAU_layout_id, HDAU_LEN);
verbose("\tUsing user supplied HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
uint8_t new_HDAU_layout_id[HDAU_LEN];
if (hex2bin(value, new_HDAU_layout_id, HDAU_LEN) == 0)
{
memcpy(default_HDAU_layout_id, new_HDAU_layout_id, HDAU_LEN);
verbose("\tUsing user supplied HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
}
else
{
verbose("\tUsing default HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
devprop_add_value(device, "layout-id", default_HDAU_layout_id, HDAU_LEN); /*FIX ME*/
devprop_add_value(device, "@0,connector-type", connector_type_value, 4);
devprop_add_value(device, "@1,connector-type", connector_type_value, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-2", sizeof("onboard-2"));
devprop_add_value(device, "built-in", &BuiltIn, 1);
}
else
{
verbose("\tUsing default HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
devprop_add_value(device, "layout-id", default_HDAU_layout_id, HDAU_LEN); /*FIX ME*/
devprop_add_value(device, "@0,connector-type", connector_type_value, 4);
devprop_add_value(device, "@1,connector-type", connector_type_value, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-2", sizeof("onboard-2"));
devprop_add_value(device, "built-in", &BuiltIn, 1);
break;
/**************************************************************************************************************
case HDA_ATI_R1000:
case HDA_ATI_SI:
case HDA_ATI_VERDE:
/* if the key value kHDAULayoutID as a value set that value, if not will assign a default layout */
if (getValueForKey(kHDAULayoutID, &value, &len, &bootInfo->chameleonConfig) && len == HDAU_LEN * 2)
if ( do_skip_a_devprop )
{
uint8_t new_HDAU_layout_id[HDAU_LEN];
if (hex2bin(value, new_HDAU_layout_id, HDAU_LEN) == 0)
verbose("Skip ATi/AMD audio device!\n");
}
else
{
/* if the key value kHDAULayoutID as a value set that value, if not will assign a default layout */
if (getValueForKey(kHDAULayoutID, &value, &len, &bootInfo->chameleonConfig) && len == HDAU_LEN * 2)
{
memcpy(default_HDAU_layout_id, new_HDAU_layout_id, HDAU_LEN);
verbose("\tUsing user supplied HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
uint8_t new_HDAU_layout_id[HDAU_LEN];
if (hex2bin(value, new_HDAU_layout_id, HDAU_LEN) == 0)
{
memcpy(default_HDAU_layout_id, new_HDAU_layout_id, HDAU_LEN);
verbose("\tUsing user supplied HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
}
else
{
verbose("\tUsing default HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
devprop_add_value(device, "layout-id", default_HDAU_layout_id, HDAU_LEN); /*FIX ME*/
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-2", 10);
devprop_add_value(device, "built-in", &BuiltIn, 1);
}
else
{
verbose("\tUsing default HDAU layout-id: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
default_HDAU_layout_id[0], default_HDAU_layout_id[1], default_HDAU_layout_id[2], default_HDAU_layout_id[3]);
}
devprop_add_value(device, "layout-id", default_HDAU_layout_id, HDAU_LEN); /*FIX ME*/
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-2", 10);
devprop_add_value(device, "built-in", &BuiltIn, 1);
break;
default:

Archive Download the corresponding diff file

Revision: 2735