Skip to content

Commit d90f351

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32
Pull AVR32 updates from Hans-Christian Noren Egtvedt. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32: mmc: atmel: get rid of struct mci_dma_data mmc: atmel-mci: restore dma on AVR32 avr32: wire up missing syscalls avr32: wire up accept4 syscall
2 parents c1a198d + 238d1c6 commit d90f351

File tree

6 files changed

+51
-32
lines changed

6 files changed

+51
-32
lines changed

arch/avr32/include/uapi/asm/unistd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,5 +333,9 @@
333333
#define __NR_memfd_create 318
334334
#define __NR_bpf 319
335335
#define __NR_execveat 320
336+
#define __NR_accept4 321
337+
#define __NR_userfaultfd 322
338+
#define __NR_membarrier 323
339+
#define __NR_mlock2 324
336340

337341
#endif /* _UAPI__ASM_AVR32_UNISTD_H */

arch/avr32/kernel/syscall_table.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,8 @@ sys_call_table:
334334
.long sys_memfd_create
335335
.long sys_bpf
336336
.long sys_execveat /* 320 */
337+
.long sys_accept4
338+
.long sys_userfaultfd
339+
.long sys_membarrier
340+
.long sys_mlock2
337341
.long sys_ni_syscall /* r8 is saturated at nr_syscalls */

arch/avr32/mach-at32ap/at32ap700x.c

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/spi/spi.h>
1818
#include <linux/usb/atmel_usba_udc.h>
1919

20-
#include <linux/platform_data/mmc-atmel-mci.h>
2120
#include <linux/atmel-mci.h>
2221

2322
#include <asm/io.h>
@@ -1321,11 +1320,26 @@ static struct clk atmel_mci0_pclk = {
13211320
.index = 9,
13221321
};
13231322

1323+
static bool at32_mci_dma_filter(struct dma_chan *chan, void *pdata)
1324+
{
1325+
struct dw_dma_slave *sl = pdata;
1326+
1327+
if (!sl)
1328+
return false;
1329+
1330+
if (sl->dma_dev == chan->device->dev) {
1331+
chan->private = sl;
1332+
return true;
1333+
}
1334+
1335+
return false;
1336+
}
1337+
13241338
struct platform_device *__init
13251339
at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
13261340
{
13271341
struct platform_device *pdev;
1328-
struct mci_dma_data *slave;
1342+
struct dw_dma_slave *slave;
13291343
u32 pioa_mask;
13301344
u32 piob_mask;
13311345

@@ -1344,17 +1358,18 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
13441358
ARRAY_SIZE(atmel_mci0_resource)))
13451359
goto fail;
13461360

1347-
slave = kzalloc(sizeof(struct mci_dma_data), GFP_KERNEL);
1361+
slave = kzalloc(sizeof(*slave), GFP_KERNEL);
13481362
if (!slave)
13491363
goto fail;
13501364

1351-
slave->sdata.dma_dev = &dw_dmac0_device.dev;
1352-
slave->sdata.src_id = 0;
1353-
slave->sdata.dst_id = 1;
1354-
slave->sdata.src_master = 1;
1355-
slave->sdata.dst_master = 0;
1365+
slave->dma_dev = &dw_dmac0_device.dev;
1366+
slave->src_id = 0;
1367+
slave->dst_id = 1;
1368+
slave->src_master = 1;
1369+
slave->dst_master = 0;
13561370

13571371
data->dma_slave = slave;
1372+
data->dma_filter = at32_mci_dma_filter;
13581373

13591374
if (platform_device_add_data(pdev, data,
13601375
sizeof(struct mci_platform_data)))

drivers/mmc/host/atmel-mci.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/slab.h>
3030
#include <linux/stat.h>
3131
#include <linux/types.h>
32-
#include <linux/platform_data/mmc-atmel-mci.h>
3332

3433
#include <linux/mmc/host.h>
3534
#include <linux/mmc/sdio.h>
@@ -2439,6 +2438,23 @@ static int atmci_configure_dma(struct atmel_mci *host)
24392438
{
24402439
host->dma.chan = dma_request_slave_channel_reason(&host->pdev->dev,
24412440
"rxtx");
2441+
2442+
if (PTR_ERR(host->dma.chan) == -ENODEV) {
2443+
struct mci_platform_data *pdata = host->pdev->dev.platform_data;
2444+
dma_cap_mask_t mask;
2445+
2446+
if (!pdata->dma_filter)
2447+
return -ENODEV;
2448+
2449+
dma_cap_zero(mask);
2450+
dma_cap_set(DMA_SLAVE, mask);
2451+
2452+
host->dma.chan = dma_request_channel(mask, pdata->dma_filter,
2453+
pdata->dma_slave);
2454+
if (!host->dma.chan)
2455+
host->dma.chan = ERR_PTR(-ENODEV);
2456+
}
2457+
24422458
if (IS_ERR(host->dma.chan))
24432459
return PTR_ERR(host->dma.chan);
24442460

include/linux/atmel-mci.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define __LINUX_ATMEL_MCI_H
33

44
#include <linux/types.h>
5+
#include <linux/dmaengine.h>
56

67
#define ATMCI_MAX_NR_SLOTS 2
78

@@ -36,7 +37,8 @@ struct mci_slot_pdata {
3637
* @slot: Per-slot configuration data.
3738
*/
3839
struct mci_platform_data {
39-
struct mci_dma_data *dma_slave;
40+
void *dma_slave;
41+
dma_filter_fn dma_filter;
4042
struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS];
4143
};
4244

include/linux/platform_data/mmc-atmel-mci.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)