summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/spi
Commit message (Collapse)AuthorAgeFilesLines
* can: mcp251x: add message about sucessful/unsuccessful probeEd Spiridonov2016-06-231-1/+6
| | | | | | | | | | | Silent ignorance of errors during probe procedure is a bad thing, this patch fixes it. Extra message added for hardware initialization failure. Such common issues are mostly caused by wrong wiring. Message about success added as well, it should be useful to debug new hardware configuration, especially in case of several CAN buses. Signed-off-by: Ed Spiridonov <edo.rus@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: Replace create_freezable_workqueue with alloc_workqueueAmitoj Kaur Chawla2016-05-091-1/+2
| | | | | | | | | | | | | | | | | | | Replace scheduled to be removed create_freezable_workqueue with alloc_workqueue. priv->wq should be explicitly set as freezable to ensure it is frozen in the suspend sequence and work items are drained so that no new work item starts execution until thawed. Thus, use of WQ_FREEZABLE flag here is required. WQ_MEM_RECLAIM flag has been set here to ensure forward progress regardless of memory pressure. The order of execution is not important so set @max_active as 0. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: avoid write to error flag register if it's unnecessaryEd Spiridonov2016-03-041-1/+1
| | | | | | | | Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set. Signed-off-by: Ed Spiridonov <edo.rus@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* spi: Drop owner assignment from spi_driversAndrew F. Davis2015-10-281-1/+0
| | | | | | | | | An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* can: mcp251x: get regulators optionallyStefan Agner2015-07-161-2/+2
| | | | | | | | | | The regulators power and transceiver are optional. If those are not present, the pointer (or error pointer) is correctly handled by the driver, hence we can use devm_regulator_get_optional safely, which avoids regulators getting created. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: fix resume when device is downStefan Agner2015-07-161-7/+6
| | | | | | | | | | | | | | | | | | | If a valid power regulator or a dummy regulator is used (which happens to be the case when no regulator is specified), restart_work is queued no matter whether the device was running or not at suspend time. Since work queues get initialized in the ndo_open callback, resuming leads to a NULL pointer exception. Reverse exactly the steps executed at suspend time: - Enable the power regulator in any case - Enable the transceiver regulator if the device was running, even in case we have a power regulator - Queue restart_work only in case the device was running Fixes: bf66f3736a94 ("can: mcp251x: Move to threaded interrupts instead of workqueues.") Signed-off-by: Stefan Agner <stefan@agner.ch> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: use correct register address for acceptance filtersTomas Krcka2015-06-091-4/+5
| | | | | | | | | This patch corrects addresses of acceptance filters. These registers are not in use, but values should be correct. Tested with MCP2515 and am3352 and also checked datasheets for MCP2515 and MCP2510. Signed-off-by: Tomas Krcka <tomas.krcka@nkgroup.cz> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: move can_stats.bus_off++ from can_bus_off into can_change_stateAndri Yngvason2015-01-201-0/+1
| | | | | | | | | | | | | In order to be able to move the stats increment from can_bus_off() into can_change_state(), the increment had to be moved back into code that was using can_bus_off() but not can_change_state(). As a side-effect, this patch fixes the following bugs: * Redundant call to can_bus_off() in c_can. * Bus-off counted twice in xilinx_can. Signed-off-by: Andri Yngvason <andri.yngvason@marel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: Use dmam_alloc_coherentHimangi Saraogi2014-08-181-12/+4
| | | | | | | | | | This patch moves the data allocated using dma_alloc_coherent to the corresponding managed interface and does away with the calls to free the allocated memory in the probe and remove functions. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* net: can: use kbuild magic to inherit debug settingsWolfram Sang2014-08-181-2/+0
| | | | | | | | No need to manually copy debug settings into subdir Makefiles. kbuild has a mechanism for inheriting, so let's use it. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: mcp251x: fix coccinelle warningsDan Carpenter2014-05-191-1/+1
| | | | | | | | | | | | | | drivers/net/can/spi/mcp251x.c:953:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT Make sure threaded IRQs without a primary handler are always request with IRQF_ONESHOT Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci CC: Stefano Babic <sbabic@denx.de> CC: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: move SPI drivers into a separate directoryStefano Babic2014-04-243-0/+1284
Create a directory for all CAN drivers using SPI and move mcp251x driver there. Signed-off-by: Stefano Babic <sbabic@denx.de> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>