Pull HSI updates from Sebastian Reichel: "Misc fixes" * tag 'hsi-for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: HSI: nokia-modem: use flags argument of devm_gpiod_get to set direction HSI: nokia-modem: Reduce missing driver message to debug level HSI: cmt_speech: fix timestamp interface
Unified · Split
| @@ -451,9 +451,14 @@ static void cs_hsi_read_on_control_complete(struct hsi_msg *msg) · 450 unmodified lines | ||
| 451 | 451 | dev_dbg(&hi->cl->device, "Read on control: %08X\n", cmd); |
| 452 | 452 | cs_release_cmd(msg); |
| 453 | 453 | if (hi->flags & CS_FEAT_TSTAMP_RX_CTRL) { |
| 454 | − struct timespec *tstamp = | |
| 454 | + struct timespec tspec; | |
| 455 | + struct cs_timestamp *tstamp = | |
| 455 | 456 | &hi->mmap_cfg->tstamp_rx_ctrl; |
| 456 | − do_posix_clock_monotonic_gettime(tstamp); | |
| 457 | + | |
| 458 | + ktime_get_ts(&tspec); | |
| 459 | + | |
| 460 | + tstamp->tv_sec = (__u32) tspec.tv_sec; | |
| 461 | + tstamp->tv_nsec = (__u32) tspec.tv_nsec; | |
| 457 | 462 | } |
| 458 | 463 | spin_unlock(&hi->lock); |
| 459 | 464 | |
| @@ -112,7 +112,8 @@ static int nokia_modem_gpio_probe(struct device *dev) · 111 unmodified lines | ||
| 112 | 112 | modem->gpio_amount = gpio_count; |
| 113 | 113 | |
| 114 | 114 | for (i = 0; i < gpio_count; i++) { |
| 115 | − modem->gpios[i].gpio = devm_gpiod_get_index(dev, NULL, i); | |
| 115 | + modem->gpios[i].gpio = devm_gpiod_get_index(dev, NULL, i, | |
| 116 | + GPIOD_OUT_LOW); | |
| 116 | 117 | if (IS_ERR(modem->gpios[i].gpio)) { |
| 117 | 118 | dev_err(dev, "Could not get gpio %d\n", i); |
| 118 | 119 | return PTR_ERR(modem->gpios[i].gpio); |
| @@ -125,10 +126,6 @@ static int nokia_modem_gpio_probe(struct device *dev) · 6 unmodified lines | ||
| 125 | 126 | return err; |
| 126 | 127 | } |
| 127 | 128 | |
| 128 | − err = gpiod_direction_output(modem->gpios[i].gpio, 0); | |
| 129 | − if (err) | |
| 130 | − return err; | |
| 131 | − | |
| 132 | 129 | err = gpiod_export(modem->gpios[i].gpio, 0); |
| 133 | 130 | if (err) |
| 134 | 131 | return err; |
| @@ -208,7 +205,7 @@ static int nokia_modem_probe(struct device *dev) · 73 unmodified lines | ||
| 208 | 205 | |
| 209 | 206 | err = device_attach(&modem->ssi_protocol->device); |
| 210 | 207 | if (err == 0) { |
| 211 | − dev_err(dev, "Missing ssi-protocol driver\n"); | |
| 208 | + dev_dbg(dev, "Missing ssi-protocol driver\n"); | |
| 212 | 209 | err = -EPROBE_DEFER; |
| 213 | 210 | goto error3; |
| 214 | 211 | } else if (err < 0) { |
| @@ -231,7 +228,7 @@ static int nokia_modem_probe(struct device *dev) · 16 unmodified lines | ||
| 231 | 228 | |
| 232 | 229 | err = device_attach(&modem->cmt_speech->device); |
| 233 | 230 | if (err == 0) { |
| 234 | − dev_err(dev, "Missing cmt-speech driver\n"); | |
| 231 | + dev_dbg(dev, "Missing cmt-speech driver\n"); | |
| 235 | 232 | err = -EPROBE_DEFER; |
| 236 | 233 | goto error4; |
| 237 | 234 | } else if (err < 0) { |
| @@ -75,6 +75,15 @@ struct cs_buffer_config { · 74 unmodified lines | ||
| 75 | 75 | __u32 reserved[4]; |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | +/* | |
| 79 | + * struct for monotonic timestamp taken when the | |
| 80 | + * last control command was received | |
| 81 | + */ | |
| 82 | +struct cs_timestamp { | |
| 83 | + __u32 tv_sec; /* seconds */ | |
| 84 | + __u32 tv_nsec; /* nanoseconds */ | |
| 85 | +}; | |
| 86 | + | |
| 78 | 87 | /* |
| 79 | 88 | * Struct describing the layout and contents of the driver mmap area. |
| 80 | 89 | * This information is meant as read-only information for the application. |
| @@ -91,11 +100,8 @@ struct cs_mmap_config_block { · 10 unmodified lines | ||
| 91 | 100 | __u32 rx_ptr; |
| 92 | 101 | __u32 rx_ptr_boundary; |
| 93 | 102 | __u32 reserved3[2]; |
| 94 | − /* | |
| 95 | − * if enabled with CS_FEAT_TSTAMP_RX_CTRL, monotonic | |
| 96 | − * timestamp taken when the last control command was received | |
| 97 | − */ | |
| 98 | − struct timespec tstamp_rx_ctrl; | |
| 103 | + /* enabled with CS_FEAT_TSTAMP_RX_CTRL */ | |
| 104 | + struct cs_timestamp tstamp_rx_ctrl; | |
| 99 | 105 | }; |
| 100 | 106 | |
| 101 | 107 | #define CS_IO_MAGIC 'C' |