dw-i3c-master.c
Includes Linux kernel module headerAssigns a negative errno constant
SHA-256b13ba105cf8a37602e70acd555f1b16331d64e2cda8110f8a0147115fb7fbbb3
MaleculeO(Er)H(Os)
Evidence
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018 Synopsys, Inc. and/or its affiliates.
4 *
5 * Author: Vitor Soares <vitor.soares@synopsys.com>
6 */
7
8#include <linux/bitfield.h>
9#include <linux/bitops.h>
10#include <linux/clk.h>
11#include <linux/completion.h>
12#include <linux/err.h>
13#include <linux/errno.h>
14#include <linux/i3c/master.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <linux/iopoll.h>
18#include <linux/list.h>
19#include <linux/module.h>
20#include <linux/of.h>
21#include <linux/pinctrl/consumer.h>
22#include <linux/platform_device.h>
23#include <linux/pm_runtime.h>
24#include <linux/reset.h>
25#include <linux/slab.h>
26
27#include "../internals.h"
28#include "dw-i3c-master.h"
29
30#define DEVICE_CTRL 0x0
31#define DEV_CTRL_ENABLE BIT(31)
32#define DEV_CTRL_RESUME BIT(30 …
68:14… NSE_PORT_ERR_STATUS(x) (((x) & GENMASK(31, 28)) >> 28)
69#define RESPONSE_NO_ERROR 0
70#define RESPONSE_ERROR_CRC 1
71#define RESPONSE_ERROR_PARITY 2
72#d …
78:8… RESPONSE_PORT_TID(x) (((x) & GENMASK(27, 24)) >> 24)
79#define RESPONSE_PORT_DATA_LEN(x) ((x) & GENMASK(15, 0))
80
81#define RX_TX_DATA_PORT 0x14
82#defi …
⋯7 lines
349 }
350
351 return -EINVAL;
352}
353
354static int dw_i3c_master_get_free_pos(struct dw_i3c_master *master)
355{
356 if (!(master->free_pos & GENMASK(master->maxdevs - 1 …
500:29… _ABORT:
501 case RESPONSE_ERROR_CRC:
502 case RESPONSE_ERROR_FRAME:
503 ret = -EIO;
504 break;
505 case RESPONSE_ERROR_OVER_UNDER_FLOW:
506 ret = -ENOSPC;
507 break;
508 case RESPONSE_ERROR_I2C_W_NACK_ERR:
509 case RESPONSE_ERROR_ADDRESS_NACK:
510 default:
511 ret = -EINVAL;
512 break;
513 }
⋯7 lines