Commit 8876d94b authored by Jeremy Linton's avatar Jeremy Linton Committed by David S. Miller

net: smc91x: ACPI Enable lan91x adapters

Enable lan91x adapters in some ARM machines and models
when booted with an ACPI kernel.
Signed-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e5de25dc
...@@ -2195,6 +2195,12 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device * ...@@ -2195,6 +2195,12 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device *
} }
} }
static const struct acpi_device_id smc91x_acpi_match[] = {
{ "LNRO0003", 0 },
{ }
};
MODULE_DEVICE_TABLE(acpi, smc91x_acpi_match);
#if IS_BUILTIN(CONFIG_OF) #if IS_BUILTIN(CONFIG_OF)
static const struct of_device_id smc91x_match[] = { static const struct of_device_id smc91x_match[] = {
{ .compatible = "smsc,lan91c94", }, { .compatible = "smsc,lan91c94", },
...@@ -2274,7 +2280,6 @@ static int smc_drv_probe(struct platform_device *pdev) ...@@ -2274,7 +2280,6 @@ static int smc_drv_probe(struct platform_device *pdev)
#if IS_BUILTIN(CONFIG_OF) #if IS_BUILTIN(CONFIG_OF)
match = of_match_device(of_match_ptr(smc91x_match), &pdev->dev); match = of_match_device(of_match_ptr(smc91x_match), &pdev->dev);
if (match) { if (match) {
struct device_node *np = pdev->dev.of_node;
u32 val; u32 val;
/* Optional pwrdwn GPIO configured? */ /* Optional pwrdwn GPIO configured? */
...@@ -2300,7 +2305,8 @@ static int smc_drv_probe(struct platform_device *pdev) ...@@ -2300,7 +2305,8 @@ static int smc_drv_probe(struct platform_device *pdev)
usleep_range(750, 1000); usleep_range(750, 1000);
/* Combination of IO widths supported, default to 16-bit */ /* Combination of IO widths supported, default to 16-bit */
if (!of_property_read_u32(np, "reg-io-width", &val)) { if (!device_property_read_u32(&pdev->dev, "reg-io-width",
&val)) {
if (val & 1) if (val & 1)
lp->cfg.flags |= SMC91X_USE_8BIT; lp->cfg.flags |= SMC91X_USE_8BIT;
if ((val == 0) || (val & 2)) if ((val == 0) || (val & 2))
...@@ -2479,6 +2485,7 @@ static struct platform_driver smc_driver = { ...@@ -2479,6 +2485,7 @@ static struct platform_driver smc_driver = {
.name = CARDNAME, .name = CARDNAME,
.pm = &smc_drv_pm_ops, .pm = &smc_drv_pm_ops,
.of_match_table = of_match_ptr(smc91x_match), .of_match_table = of_match_ptr(smc91x_match),
.acpi_match_table = smc91x_acpi_match,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment