Thread (25 messages) 25 messages, 2 authors, 2022-08-05

Re: [PATCH v15 mfd 9/9] mfd: ocelot: add support for the vsc7512 chip via spi

From: Andy Shevchenko <hidden>
Date: 2022-08-03 11:45:47
Also in: linux-arm-kernel, linux-devicetree, linux-gpio, lkml

On Wed, Aug 3, 2022 at 7:48 AM Colin Foster
[off-list ref] wrote:
The VSC7512 is a networking chip that contains several peripherals. Many of
these peripherals are currently supported by the VSC7513 and VSC7514 chips,
but those run on an internal CPU. The VSC7512 lacks this CPU, and must be
controlled externally.

Utilize the existing drivers by referencing the chip as an MFD. Add support
for the two MDIO buses, the internal phys, pinctrl, and serial GPIO.

...
+#include <asm/byteorder.h>
Not sure I see the user of this header.

...
+struct regmap *ocelot_spi_init_regmap(struct device *dev, const struct resource *res)
+{
+       struct regmap_config regmap_config;
+
+       memcpy(&regmap_config, &ocelot_spi_regmap_config, sizeof(regmap_config));
+
+       regmap_config.name = res->name;
+       regmap_config.max_register = res->end - res->start;
Hmm... First of all, resource_size() is for that (with - 1 to the
result). But don't you need to use stride in the calculations?
+       regmap_config.reg_base = res->start;
+
+       return devm_regmap_init(dev, &ocelot_spi_regmap_bus, dev, &regmap_config);
+}
-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help