blob: 1ee8236c05c8fba244371ae32788e7d9b5b69b9d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Michal Simekc886f352016-09-08 15:06:45 +02002/*
3 * Copyright (c) 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
5 * Copyright (c) 2016 Xilinx, Inc
6 * Written by Michal Simek
7 *
8 * Based on ahci-uclass.c
Michal Simekc886f352016-09-08 15:06:45 +02009 */
10
Patrick Delaunay81313352021-04-27 11:02:19 +020011#define LOG_CATEGORY UCLASS_SCSI
12
Michal Simekc886f352016-09-08 15:06:45 +020013#include <dm.h>
14#include <scsi.h>
15
Simon Glassc4dfa892017-06-14 21:28:43 -060016int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
17{
18 struct scsi_ops *ops = scsi_get_ops(dev);
19
20 if (!ops->exec)
21 return -ENOSYS;
22
23 return ops->exec(dev, pccb);
24}
25
26int scsi_bus_reset(struct udevice *dev)
27{
28 struct scsi_ops *ops = scsi_get_ops(dev);
29
30 if (!ops->bus_reset)
31 return -ENOSYS;
32
33 return ops->bus_reset(dev);
34}
35
Michal Simekc886f352016-09-08 15:06:45 +020036UCLASS_DRIVER(scsi) = {
37 .id = UCLASS_SCSI,
38 .name = "scsi",
Simon Glassb75b15b2020-12-03 16:55:23 -070039 .per_device_plat_auto = sizeof(struct scsi_plat),
Michal Simekc886f352016-09-08 15:06:45 +020040};