Skip to content

Commit 7dd7b69

Browse files
committed
backports: greybus: from: linux.git
Reference: v5.12.8 Signed-off-by: Robert Nelson <[email protected]>
1 parent 5b64eb9 commit 7dd7b69

31 files changed

+557
-367
lines changed

drivers/greybus/Kconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
menuconfig GREYBUS
33
tristate "Greybus support"
44
depends on SYSFS
5-
---help---
6-
This option enables the Greybus driver core. Greybus is an
5+
help
6+
This option enables the Greybus driver core. Greybus is a
77
hardware protocol that was designed to provide Unipro with a
88
sane application layer. It was originally designed for the
99
ARA project, a module phone system, but has shown up in other
@@ -12,20 +12,20 @@ menuconfig GREYBUS
1212

1313
Say Y here to enable support for these types of drivers.
1414

15-
To compile this code as a module, chose M here: the module
15+
To compile this code as a module, choose M here: the module
1616
will be called greybus.ko
1717

1818
if GREYBUS
1919

2020
config GREYBUS_ES2
2121
tristate "Greybus ES3 USB host controller"
2222
depends on USB
23-
---help---
23+
help
2424
Select this option if you have a Toshiba ES3 USB device that
2525
acts as a Greybus "host controller". This device is a bridge
2626
from a USB device to a Unipro network.
2727

28-
To compile this code as a module, chose M here: the module
28+
To compile this code as a module, choose M here: the module
2929
will be called gb-es2.ko
3030

3131
endif # GREYBUS

drivers/greybus/arpc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct arpc_request_message {
2121
__le16 id; /* RPC unique id */
2222
__le16 size; /* Size in bytes of header + payload */
2323
__u8 type; /* RPC type */
24-
__u8 data[0]; /* ARPC data */
24+
__u8 data[]; /* ARPC data */
2525
} __packed;
2626

2727
struct arpc_response_message {

drivers/greybus/connection.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,6 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection)
361361
if (connection->mode_switch)
362362
peer_space += sizeof(struct gb_operation_msg_hdr);
363363

364-
if (!hd->driver->cport_quiesce)
365-
return 0;
366-
367364
ret = hd->driver->cport_quiesce(hd, connection->hd_cport_id,
368365
peer_space,
369366
GB_CONNECTION_CPORT_QUIESCE_TIMEOUT);

drivers/greybus/es2.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,9 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id,
567567
USB_DIR_OUT | USB_TYPE_VENDOR |
568568
USB_RECIP_INTERFACE, cport_id, 0,
569569
req, sizeof(*req), ES2_USB_CTRL_TIMEOUT);
570-
if (ret != sizeof(*req)) {
570+
if (ret < 0) {
571571
dev_err(&udev->dev, "failed to set cport flags for port %d\n",
572572
cport_id);
573-
if (ret >= 0)
574-
ret = -EIO;
575-
576573
goto out;
577574
}
578575

@@ -759,7 +756,7 @@ static int check_urb_status(struct urb *urb)
759756
case -EOVERFLOW:
760757
dev_err(dev, "%s: overflow actual length is %d\n",
761758
__func__, urb->actual_length);
762-
/* fall through */
759+
fallthrough;
763760
case -ECONNRESET:
764761
case -ENOENT:
765762
case -ESHUTDOWN:
@@ -961,12 +958,10 @@ static int arpc_send(struct es2_ap_dev *es2, struct arpc *rpc, int timeout)
961958
0, 0,
962959
rpc->req, le16_to_cpu(rpc->req->size),
963960
ES2_USB_CTRL_TIMEOUT);
964-
if (retval != le16_to_cpu(rpc->req->size)) {
961+
if (retval < 0) {
965962
dev_err(&udev->dev,
966963
"failed to send ARPC request %d: %d\n",
967964
rpc->req->type, retval);
968-
if (retval > 0)
969-
retval = -EIO;
970965
return retval;
971966
}
972967

drivers/greybus/greybus_trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ DECLARE_EVENT_CLASS(gb_message,
4040
__entry->result = message->header->result;
4141
),
4242

43-
TP_printk("size=%hu operation_id=0x%04x type=0x%02x result=0x%02x",
43+
TP_printk("size=%u operation_id=0x%04x type=0x%02x result=0x%02x",
4444
__entry->size, __entry->operation_id,
4545
__entry->type, __entry->result)
4646
);
@@ -317,7 +317,7 @@ DECLARE_EVENT_CLASS(gb_interface,
317317
__entry->mode_switch = intf->mode_switch;
318318
),
319319

320-
TP_printk("intf_id=%hhu device_id=%hhu module_id=%hhu D=%d J=%d A=%d E=%d M=%d",
320+
TP_printk("intf_id=%u device_id=%u module_id=%u D=%d J=%d A=%d E=%d M=%d",
321321
__entry->id, __entry->device_id, __entry->module_id,
322322
__entry->disconnected, __entry->ejected, __entry->active,
323323
__entry->enabled, __entry->mode_switch)
@@ -391,7 +391,7 @@ DECLARE_EVENT_CLASS(gb_module,
391391
__entry->disconnected = module->disconnected;
392392
),
393393

394-
TP_printk("hd_bus_id=%d module_id=%hhu num_interfaces=%zu disconnected=%d",
394+
TP_printk("hd_bus_id=%d module_id=%u num_interfaces=%zu disconnected=%d",
395395
__entry->hd_bus_id, __entry->module_id,
396396
__entry->num_interfaces, __entry->disconnected)
397397
);

drivers/greybus/interface.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static struct attribute *interface_common_attrs[] = {
620620
static umode_t interface_unipro_is_visible(struct kobject *kobj,
621621
struct attribute *attr, int n)
622622
{
623-
struct device *dev = container_of(kobj, struct device, kobj);
623+
struct device *dev = kobj_to_dev(kobj);
624624
struct gb_interface *intf = to_gb_interface(dev);
625625

626626
switch (intf->type) {
@@ -635,7 +635,7 @@ static umode_t interface_unipro_is_visible(struct kobject *kobj,
635635
static umode_t interface_greybus_is_visible(struct kobject *kobj,
636636
struct attribute *attr, int n)
637637
{
638-
struct device *dev = container_of(kobj, struct device, kobj);
638+
struct device *dev = kobj_to_dev(kobj);
639639
struct gb_interface *intf = to_gb_interface(dev);
640640

641641
switch (intf->type) {
@@ -649,7 +649,7 @@ static umode_t interface_greybus_is_visible(struct kobject *kobj,
649649
static umode_t interface_power_is_visible(struct kobject *kobj,
650650
struct attribute *attr, int n)
651651
{
652-
struct device *dev = container_of(kobj, struct device, kobj);
652+
struct device *dev = kobj_to_dev(kobj);
653653
struct gb_interface *intf = to_gb_interface(dev);
654654

655655
switch (intf->type) {
@@ -1233,7 +1233,7 @@ int gb_interface_add(struct gb_interface *intf)
12331233
case GB_INTERFACE_TYPE_GREYBUS:
12341234
dev_info(&intf->dev, "GMP VID=0x%08x, PID=0x%08x\n",
12351235
intf->vendor_id, intf->product_id);
1236-
/* fall-through */
1236+
fallthrough;
12371237
case GB_INTERFACE_TYPE_UNIPRO:
12381238
dev_info(&intf->dev, "DDBL1 Manufacturer=0x%08x, Product=0x%08x\n",
12391239
intf->ddbl1_manufacturer_id,

drivers/staging/greybus/Kconfig

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@ if GREYBUS
33

44
config GREYBUS_AUDIO
55
tristate "Greybus Audio Class driver"
6-
depends on SOUND
7-
---help---
6+
depends on SOUND && SND_SOC
7+
help
88
Select this option if you have a device that follows the
99
Greybus Audio Class specification.
1010

1111
To compile this code as a module, chose M here: the module
1212
will be called gb-audio.ko
1313

14+
config GREYBUS_AUDIO_APB_CODEC
15+
tristate "Greybus APBridge Audio codec driver"
16+
depends on SND_SOC && GREYBUS_AUDIO
17+
help
18+
Select this option if you have a Toshiba APB device that has I2S
19+
ports and acts as a Greybus "Dummy codec". This device is a
20+
bridge from an APB-I2S port to a Unipro network.
21+
22+
To compile this code as a module, chose M here: the module
23+
will be called gb-audio-codec.ko
24+
25+
1426
config GREYBUS_BOOTROM
1527
tristate "Greybus Bootrom Class driver"
16-
---help---
28+
help
1729
Select this option if you have a device that follows the
1830
Greybus Bootrom Class specification.
1931

@@ -23,7 +35,7 @@ config GREYBUS_BOOTROM
2335
config GREYBUS_CAMERA
2436
tristate "Greybus Camera Class driver"
2537
depends on MEDIA_SUPPORT && LEDS_CLASS_FLASH && BROKEN
26-
---help---
38+
help
2739
Select this option if you have a device that follows the
2840
Greybus Camera Class specification.
2941

@@ -33,7 +45,7 @@ config GREYBUS_CAMERA
3345
config GREYBUS_FIRMWARE
3446
tristate "Greybus Firmware Download Class driver"
3547
depends on SPI
36-
---help---
48+
help
3749
Select this option if you have a device that follows the
3850
Greybus Firmware Download Class specification.
3951

@@ -43,7 +55,7 @@ config GREYBUS_FIRMWARE
4355
config GREYBUS_HID
4456
tristate "Greybus HID Class driver"
4557
depends on HID && INPUT
46-
---help---
58+
help
4759
Select this option if you have a device that follows the
4860
Greybus HID Class specification.
4961

@@ -53,7 +65,7 @@ config GREYBUS_HID
5365
config GREYBUS_LIGHT
5466
tristate "Greybus LED Class driver"
5567
depends on LEDS_CLASS
56-
---help---
68+
help
5769
Select this option if you have a device that follows the
5870
Greybus LED Class specification.
5971

@@ -62,7 +74,7 @@ config GREYBUS_LIGHT
6274

6375
config GREYBUS_LOG
6476
tristate "Greybus Debug Log Class driver"
65-
---help---
77+
help
6678
Select this option if you have a device that follows the
6779
Greybus Debug Log Class specification.
6880

@@ -71,7 +83,7 @@ config GREYBUS_LOG
7183

7284
config GREYBUS_LOOPBACK
7385
tristate "Greybus Loopback Class driver"
74-
---help---
86+
help
7587
Select this option if you have a device that follows the
7688
Greybus Debug Log Class specification.
7789

@@ -81,7 +93,7 @@ config GREYBUS_LOOPBACK
8193
config GREYBUS_POWER
8294
tristate "Greybus Powersupply Class driver"
8395
depends on POWER_SUPPLY
84-
---help---
96+
help
8597
Select this option if you have a device that follows the
8698
Greybus Powersupply Class specification.
8799

@@ -90,7 +102,7 @@ config GREYBUS_POWER
90102

91103
config GREYBUS_RAW
92104
tristate "Greybus Raw Class driver"
93-
---help---
105+
help
94106
Select this option if you have a device that follows the
95107
Greybus Raw Class specification.
96108

@@ -99,7 +111,7 @@ config GREYBUS_RAW
99111

100112
config GREYBUS_VIBRATOR
101113
tristate "Greybus Vibrator Motor Class driver"
102-
---help---
114+
help
103115
Select this option if you have a device that follows the
104116
Greybus Vibrator Motor Class specification.
105117

@@ -108,7 +120,7 @@ config GREYBUS_VIBRATOR
108120

109121
menuconfig GREYBUS_BRIDGED_PHY
110122
tristate "Greybus Bridged PHY Class drivers"
111-
---help---
123+
help
112124
Select this option to pick from a variety of Greybus Bridged
113125
PHY class drivers. These drivers emulate a number of
114126
different "traditional" busses by tunneling them over Greybus.
@@ -123,7 +135,7 @@ config GREYBUS_GPIO
123135
tristate "Greybus GPIO Bridged PHY driver"
124136
depends on GPIOLIB
125137
select GPIOLIB_IRQCHIP
126-
---help---
138+
help
127139
Select this option if you have a device that follows the
128140
Greybus GPIO Bridged PHY Class specification.
129141

@@ -133,7 +145,7 @@ config GREYBUS_GPIO
133145
config GREYBUS_I2C
134146
tristate "Greybus I2C Bridged PHY driver"
135147
depends on I2C
136-
---help---
148+
help
137149
Select this option if you have a device that follows the
138150
Greybus I2C Bridged PHY Class specification.
139151

@@ -143,7 +155,7 @@ config GREYBUS_I2C
143155
config GREYBUS_PWM
144156
tristate "Greybus PWM Bridged PHY driver"
145157
depends on PWM
146-
---help---
158+
help
147159
Select this option if you have a device that follows the
148160
Greybus PWM Bridged PHY Class specification.
149161

@@ -153,7 +165,7 @@ config GREYBUS_PWM
153165
config GREYBUS_SDIO
154166
tristate "Greybus SDIO Bridged PHY driver"
155167
depends on MMC
156-
---help---
168+
help
157169
Select this option if you have a device that follows the
158170
Greybus SDIO Bridged PHY Class specification.
159171

@@ -163,7 +175,7 @@ config GREYBUS_SDIO
163175
config GREYBUS_SPI
164176
tristate "Greybus SPI Bridged PHY driver"
165177
depends on SPI
166-
---help---
178+
help
167179
Select this option if you have a device that follows the
168180
Greybus SPI Bridged PHY Class specification.
169181

@@ -173,7 +185,7 @@ config GREYBUS_SPI
173185
config GREYBUS_UART
174186
tristate "Greybus UART Bridged PHY driver"
175187
depends on TTY
176-
---help---
188+
help
177189
Select this option if you have a device that follows the
178190
Greybus UART Bridged PHY Class specification.
179191

@@ -183,7 +195,7 @@ config GREYBUS_UART
183195
config GREYBUS_USB
184196
tristate "Greybus USB Host Bridged PHY driver"
185197
depends on USB
186-
---help---
198+
help
187199
Select this option if you have a device that follows the
188200
Greybus USB Host Bridged PHY Class specification.
189201

@@ -195,7 +207,7 @@ endif # GREYBUS_BRIDGED_PHY
195207
config GREYBUS_ARCHE
196208
tristate "Greybus Arche Platform driver"
197209
depends on USB_HSIC_USB3613 || COMPILE_TEST
198-
---help---
210+
help
199211
Select this option if you have an Arche device.
200212

201213
To compile this code as a module, chose M here: the module

drivers/staging/greybus/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ obj-$(CONFIG_GREYBUS_VIBRATOR) += gb-vibrator.o
2828

2929
# Greybus Audio is a bunch of modules
3030
gb-audio-module-y := audio_module.o audio_topology.o
31-
gb-audio-codec-y := audio_codec.o
31+
gb-audio-codec-y := audio_codec.o audio_helper.o
3232
gb-audio-gb-y := audio_gb.o
3333
gb-audio-apbridgea-y := audio_apbridgea.o
3434
gb-audio-manager-y := audio_manager.o audio_manager_module.o
@@ -40,8 +40,8 @@ gb-audio-manager-y := audio_manager.o audio_manager_module.o
4040
#ccflags-y += -DGB_AUDIO_MANAGER_SYSFS
4141
#endif
4242

43-
obj-$(CONFIG_GREYBUS_AUDIO_MSM8994) += gb-audio-codec.o
44-
obj-$(CONFIG_GREYBUS_AUDIO_MSM8994) += gb-audio-module.o
43+
obj-$(CONFIG_GREYBUS_AUDIO_APB_CODEC) += gb-audio-codec.o
44+
obj-$(CONFIG_GREYBUS_AUDIO_APB_CODEC) += gb-audio-module.o
4545
obj-$(CONFIG_GREYBUS_AUDIO) += gb-audio-gb.o
4646
obj-$(CONFIG_GREYBUS_AUDIO) += gb-audio-apbridgea.o
4747
obj-$(CONFIG_GREYBUS_AUDIO) += gb-audio-manager.o

drivers/staging/greybus/TODO

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* Convert all uses of the old GPIO API from <linux/gpio.h> to the
22
GPIO descriptor API in <linux/gpio/consumer.h> and look up GPIO
33
lines from device tree or ACPI.
4+
* Make pwm.c use the struct pwm_ops::apply instead of ::config, ::set_polarity,
5+
::enable and ::disable.

drivers/staging/greybus/audio_apbridgea.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
struct audio_apbridgea_hdr {
6666
__u8 type;
6767
__le16 i2s_port;
68-
__u8 data[0];
68+
__u8 data[];
6969
} __packed;
7070

7171
struct audio_apbridgea_set_config_request {

0 commit comments

Comments
 (0)