diff options
| author | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
|---|---|---|
| committer | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
| commit | c74a7469f97c0f40b46e82ee979f9fb1bb6e847c (patch) | |
| tree | f2690a1a916b73ef94657fbf0e0141ae57701825 /sound/firewire/dice/dice-transaction.c | |
| parent | 6f15a7de86c8cf2dc09fc9e6d07047efa40ef809 (diff) | |
| parent | 500775074f88d9cf5416bed2ca19592812d62c41 (diff) | |
Merge drm/drm-next into drm-intel-next-queued
We need a backmerge to get DP_DPCD_REV_14 before we push other
i915 changes to dinq that could break compilation.
Signed-off-by: Rodrigo Vivi <[email protected]>
Diffstat (limited to 'sound/firewire/dice/dice-transaction.c')
| -rw-r--r-- | sound/firewire/dice/dice-transaction.c | 49 | 
1 files changed, 28 insertions, 21 deletions
| diff --git a/sound/firewire/dice/dice-transaction.c b/sound/firewire/dice/dice-transaction.c index 0f0350320ae8..b7e138b5abcf 100644 --- a/sound/firewire/dice/dice-transaction.c +++ b/sound/firewire/dice/dice-transaction.c @@ -265,7 +265,7 @@ int snd_dice_transaction_reinit(struct snd_dice *dice)  static int get_subaddrs(struct snd_dice *dice)  {  	static const int min_values[10] = { -		10, 0x64 / 4, +		10, 0x60 / 4,  		10, 0x18 / 4,  		10, 0x18 / 4,  		0, 0, @@ -301,33 +301,40 @@ static int get_subaddrs(struct snd_dice *dice)  		}  	} -	/* -	 * Check that the implemented DICE driver specification major version -	 * number matches. -	 */ -	err = snd_fw_transaction(dice->unit, TCODE_READ_QUADLET_REQUEST, -				 DICE_PRIVATE_SPACE + -				 be32_to_cpu(pointers[0]) * 4 + GLOBAL_VERSION, -				 &version, sizeof(version), 0); -	if (err < 0) -		goto end; +	if (be32_to_cpu(pointers[1]) > 0x18) { +		/* +		 * Check that the implemented DICE driver specification major +		 * version number matches. +		 */ +		err = snd_fw_transaction(dice->unit, TCODE_READ_QUADLET_REQUEST, +				DICE_PRIVATE_SPACE + +				be32_to_cpu(pointers[0]) * 4 + GLOBAL_VERSION, +				&version, sizeof(version), 0); +		if (err < 0) +			goto end; -	if ((version & cpu_to_be32(0xff000000)) != cpu_to_be32(0x01000000)) { -		dev_err(&dice->unit->device, -			"unknown DICE version: 0x%08x\n", be32_to_cpu(version)); -		err = -ENODEV; -		goto end; +		if ((version & cpu_to_be32(0xff000000)) != +						cpu_to_be32(0x01000000)) { +			dev_err(&dice->unit->device, +				"unknown DICE version: 0x%08x\n", +				be32_to_cpu(version)); +			err = -ENODEV; +			goto end; +		} + +		/* Set up later. */ +		dice->clock_caps = 1;  	}  	dice->global_offset = be32_to_cpu(pointers[0]) * 4;  	dice->tx_offset = be32_to_cpu(pointers[2]) * 4;  	dice->rx_offset = be32_to_cpu(pointers[4]) * 4; -	dice->sync_offset = be32_to_cpu(pointers[6]) * 4; -	dice->rsrv_offset = be32_to_cpu(pointers[8]) * 4; -	/* Set up later. */ -	if (be32_to_cpu(pointers[1]) * 4 >= GLOBAL_CLOCK_CAPABILITIES + 4) -		dice->clock_caps = 1; +	/* Old firmware doesn't support these fields. */ +	if (pointers[7]) +		dice->sync_offset = be32_to_cpu(pointers[6]) * 4; +	if (pointers[9]) +		dice->rsrv_offset = be32_to_cpu(pointers[8]) * 4;  end:  	kfree(pointers);  	return err; |