aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libahci.c
diff options
context:
space:
mode:
authorAntoine Ténart <antoine.tenart@free-electrons.com>2014-07-30 14:13:56 -0400
committerTejun Heo <tj@kernel.org>2014-07-30 15:39:46 -0400
commit725c7b570fda4207e465ff8856c2c12c2645a685 (patch)
treeef05a418f09a519190a584581ca85c7ee049cec5 /drivers/ata/libahci.c
parente8f781836dc3335b5533f6e177a105bbe3ee7345 (diff)
ata: libahci_platform: move port_map parameters into the AHCI structure
This patch moves force_port_map and mask_port_map into the ahci_host_priv structure. This allows to modify them into the AHCI framework. This is needed by the new dt bindings representing ports as the port_map mask is computed automatically. Parameters modifying force_port_map, mask_port_map and flags have been removed from the ahci_platform_init_host() function, and inputs in the ahci_host_priv structure are now directly filed. Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r--drivers/ata/libahci.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index d72ce0470309..b784e9de426a 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -382,8 +382,6 @@ static ssize_t ahci_show_em_supported(struct device *dev,
382 * ahci_save_initial_config - Save and fixup initial config values 382 * ahci_save_initial_config - Save and fixup initial config values
383 * @dev: target AHCI device 383 * @dev: target AHCI device
384 * @hpriv: host private area to store config values 384 * @hpriv: host private area to store config values
385 * @force_port_map: force port map to a specified value
386 * @mask_port_map: mask out particular bits from port map
387 * 385 *
388 * Some registers containing configuration info might be setup by 386 * Some registers containing configuration info might be setup by
389 * BIOS and might be cleared on reset. This function saves the 387 * BIOS and might be cleared on reset. This function saves the
@@ -398,10 +396,7 @@ static ssize_t ahci_show_em_supported(struct device *dev,
398 * LOCKING: 396 * LOCKING:
399 * None. 397 * None.
400 */ 398 */
401void ahci_save_initial_config(struct device *dev, 399void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
402 struct ahci_host_priv *hpriv,
403 unsigned int force_port_map,
404 unsigned int mask_port_map)
405{ 400{
406 void __iomem *mmio = hpriv->mmio; 401 void __iomem *mmio = hpriv->mmio;
407 u32 cap, cap2, vers, port_map; 402 u32 cap, cap2, vers, port_map;
@@ -468,17 +463,17 @@ void ahci_save_initial_config(struct device *dev,
468 cap &= ~HOST_CAP_FBS; 463 cap &= ~HOST_CAP_FBS;
469 } 464 }
470 465
471 if (force_port_map && port_map != force_port_map) { 466 if (hpriv->force_port_map && port_map != hpriv->force_port_map) {
472 dev_info(dev, "forcing port_map 0x%x -> 0x%x\n", 467 dev_info(dev, "forcing port_map 0x%x -> 0x%x\n",
473 port_map, force_port_map); 468 port_map, hpriv->force_port_map);
474 port_map = force_port_map; 469 port_map = hpriv->force_port_map;
475 } 470 }
476 471
477 if (mask_port_map) { 472 if (hpriv->mask_port_map) {
478 dev_warn(dev, "masking port_map 0x%x -> 0x%x\n", 473 dev_warn(dev, "masking port_map 0x%x -> 0x%x\n",
479 port_map, 474 port_map,
480 port_map & mask_port_map); 475 port_map & hpriv->mask_port_map);
481 port_map &= mask_port_map; 476 port_map &= hpriv->mask_port_map;
482 } 477 }
483 478
484 /* cross check port_map and cap.n_ports */ 479 /* cross check port_map and cap.n_ports */