Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af335a6c authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville
Browse files

ssb: pci: early fix for SPROM core index

parent 5890a3ca
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -414,6 +414,16 @@ static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
 * Workarounds.
 * Workarounds.
 **************************************************/
 **************************************************/


static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
{
	u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
	if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
		tmp &= ~0xF000;
		tmp |= (pc->dev->core_index << 12);
		pcicore_write16(pc, SSB_PCICORE_SPROM(0), tmp);
	}
}

static u8 ssb_pcicore_polarity_workaround(struct ssb_pcicore *pc)
static u8 ssb_pcicore_polarity_workaround(struct ssb_pcicore *pc)
{
{
	return (ssb_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80;
	return (ssb_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80;
@@ -521,6 +531,8 @@ void ssb_pcicore_init(struct ssb_pcicore *pc)
	if (!ssb_device_is_enabled(dev))
	if (!ssb_device_is_enabled(dev))
		ssb_device_enable(dev, 0);
		ssb_device_enable(dev, 0);


	ssb_pcicore_fix_sprom_core_index(pc);

#ifdef CONFIG_SSB_PCICORE_HOSTMODE
#ifdef CONFIG_SSB_PCICORE_HOSTMODE
	pc->hostmode = pcicore_is_in_hostmode(pc);
	pc->hostmode = pcicore_is_in_hostmode(pc);
	if (pc->hostmode)
	if (pc->hostmode)