* Make fsl-quaspi assign different names to MTD devices connected
to the same QSPI controller * Remove an unneeded driver.bus assigned in the fsl-qspi driver -----BEGIN PGP SIGNATURE----- iQI5BAABCAAjBQJave/9HBxib3Jpcy5icmV6aWxsb25AYm9vdGxpbi5jb20ACgkQ Ze02AX4ItwDmHA//aTyORv01HibZYWnCfVBVe4InP5SkaY7CBLJIU9bNhAzMc29p E31CjAUD2dPB+lm3VEv3/qEKpWlDkNeJr0eA84wVq9N+7HbAVCcWg8QaGQ2XFW6V Qbuu7dLKWrpe+CjFn+llfgdfmFdIfkA9ANBIh95WUo7+Y/v5/AfzCplnoDTnHDui Wl8i3+2uQ86yC1WQpRBWxqv6gHk/nlfMoJLPu6FFNSFCEQLncV2IJ4AmLFYS9n+t 83eu+uqdwe3oBDD6hBKT17VL67AYMdORvYofdB7AZ5Hkg7/MNoJ98Pz/5UKaWHpC tnc21CSduwb+7Sd6l5Ln3kceGGskcqvrfqYdxJpoY99JY1WTIYLy+MLPSnKDEaxj u2fjI0mrzX/FWIswEWl5oCpbHh0pmpuLzfD1tUU3qbpIVnr/FIgU3umBBqprrfbh nUVj9On1MBLghjd+u0c8iGpbVe8+XqGTDGmD5Xcxg1MJdTJqtbRLTF56f/E2dwxN 1DdWSxNnvF8KIUMKbVWBX5H2pA5pHo8kI6ZHDhYq9TF5fJaOq1250tG5COJAaBdc i7SiUZinnixnKmNVtZSmdD1rWZ3gIXi0BzKQXLmVyraEw1rbhezYQG8ivjP4VC0C onbHTEPS2eli/g4iSMlV6iR+ePnK6qEjJYWkNC4gVOlUXePQ/hy05kGyYTo= =Wrxi -----END PGP SIGNATURE----- Merge tag 'spi-nor/for-4.17' of git://git.infradead.org/linux-mtd into mtd/next * Make fsl-quaspi assign different names to MTD devices connected to the same QSPI controller * Remove an unneeded driver.bus assigned in the fsl-qspi driver
This commit is contained in:
commit
7c0ed565d2
|
@ -39,3 +39,27 @@ qspi0: quadspi@40044000 {
|
||||||
....
|
....
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Example showing the usage of two SPI NOR devices:
|
||||||
|
|
||||||
|
&qspi2 {
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pinctrl_qspi2>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
flash0: n25q256a@0 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
compatible = "micron,n25q256a", "jedec,spi-nor";
|
||||||
|
spi-max-frequency = <29000000>;
|
||||||
|
reg = <0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
flash1: n25q256a@1 {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
compatible = "micron,n25q256a", "jedec,spi-nor";
|
||||||
|
spi-max-frequency = <29000000>;
|
||||||
|
reg = <1>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -1051,6 +1051,24 @@ static int fsl_qspi_probe(struct platform_device *pdev)
|
||||||
spi_nor_set_flash_node(nor, np);
|
spi_nor_set_flash_node(nor, np);
|
||||||
nor->priv = q;
|
nor->priv = q;
|
||||||
|
|
||||||
|
if (q->nor_num > 1 && !mtd->name) {
|
||||||
|
int spiflash_idx;
|
||||||
|
|
||||||
|
ret = of_property_read_u32(np, "reg", &spiflash_idx);
|
||||||
|
if (!ret) {
|
||||||
|
mtd->name = devm_kasprintf(dev, GFP_KERNEL,
|
||||||
|
"%s-%d",
|
||||||
|
dev_name(dev),
|
||||||
|
spiflash_idx);
|
||||||
|
if (!mtd->name) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto mutex_failed;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dev_warn(dev, "reg property is missing\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* fill the hooks */
|
/* fill the hooks */
|
||||||
nor->read_reg = fsl_qspi_read_reg;
|
nor->read_reg = fsl_qspi_read_reg;
|
||||||
nor->write_reg = fsl_qspi_write_reg;
|
nor->write_reg = fsl_qspi_write_reg;
|
||||||
|
@ -1174,7 +1192,6 @@ static int fsl_qspi_resume(struct platform_device *pdev)
|
||||||
static struct platform_driver fsl_qspi_driver = {
|
static struct platform_driver fsl_qspi_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "fsl-quadspi",
|
.name = "fsl-quadspi",
|
||||||
.bus = &platform_bus_type,
|
|
||||||
.of_match_table = fsl_qspi_dt_ids,
|
.of_match_table = fsl_qspi_dt_ids,
|
||||||
},
|
},
|
||||||
.probe = fsl_qspi_probe,
|
.probe = fsl_qspi_probe,
|
||||||
|
|
Loading…
Reference in New Issue