Skip to content

Commit 6c7d89c

Browse files
author
Alex Shi
committed
Merge tag 'v4.4.92' into linux-linaro-lsk-v4.4
This is the 4.4.92 stable release
2 parents 11c5615 + 69f53f5 commit 6c7d89c

51 files changed

Lines changed: 467 additions & 218 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 91
3+
SUBLEVEL = 92
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

drivers/base/platform.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,8 @@ static ssize_t driver_override_store(struct device *dev,
809809
struct platform_device *pdev = to_platform_device(dev);
810810
char *driver_override, *old, *cp;
811811

812-
if (count > PATH_MAX)
812+
/* We need to keep extra room for a newline */
813+
if (count >= (PAGE_SIZE - 1))
813814
return -EINVAL;
814815

815816
driver_override = kstrndup(buf, count, GFP_KERNEL);

drivers/gpu/drm/i915/intel_bios.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,13 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
957957
is_hdmi = is_dvi && (child->common.device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
958958
is_edp = is_dp && (child->common.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
959959

960+
if (port == PORT_A && is_dvi) {
961+
DRM_DEBUG_KMS("VBT claims port A supports DVI%s, ignoring\n",
962+
is_hdmi ? "/HDMI" : "");
963+
is_dvi = false;
964+
is_hdmi = false;
965+
}
966+
960967
info->supports_dvi = is_dvi;
961968
info->supports_hdmi = is_hdmi;
962969
info->supports_dp = is_dp;

drivers/hid/i2c-hid/i2c-hid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@ static int i2c_hid_alloc_buffers(struct i2c_hid *ihid, size_t report_size)
540540
{
541541
/* the worst case is computed from the set_report command with a
542542
* reportID > 15 and the maximum report length */
543-
int args_len = sizeof(__u8) + /* optional ReportID byte */
543+
int args_len = sizeof(__u8) + /* ReportID */
544+
sizeof(__u8) + /* optional ReportID byte */
544545
sizeof(__u16) + /* data register */
545546
sizeof(__u16) + /* size of the report */
546547
report_size; /* report */

drivers/hv/hv_fcopy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ static void fcopy_send_data(struct work_struct *dummy)
155155
out_src = smsg_out;
156156
break;
157157

158+
case WRITE_TO_FILE:
159+
out_src = fcopy_transaction.fcopy_msg;
160+
out_len = sizeof(struct hv_do_fcopy);
161+
break;
158162
default:
159163
out_src = fcopy_transaction.fcopy_msg;
160164
out_len = fcopy_transaction.recv_len;

drivers/hwtracing/stm/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ void stm_source_unregister_device(struct stm_source_data *data)
10651065

10661066
stm_source_link_drop(src);
10671067

1068-
device_destroy(&stm_source_class, src->dev.devt);
1068+
device_unregister(&src->dev);
10691069
}
10701070
EXPORT_SYMBOL_GPL(stm_source_unregister_device);
10711071

drivers/iio/adc/ad7793.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
257257
unsigned int vref_mv)
258258
{
259259
struct ad7793_state *st = iio_priv(indio_dev);
260-
int i, ret = -1;
260+
int i, ret;
261261
unsigned long long scale_uv;
262262
u32 id;
263263

@@ -266,7 +266,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
266266
return ret;
267267

268268
/* reset the serial interface */
269-
ret = spi_write(st->sd.spi, (u8 *)&ret, sizeof(ret));
269+
ret = ad_sd_reset(&st->sd, 32);
270270
if (ret < 0)
271271
goto out;
272272
usleep_range(500, 2000); /* Wait for at least 500us */

drivers/iio/adc/ad_sigma_delta.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,34 @@ int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta,
177177
}
178178
EXPORT_SYMBOL_GPL(ad_sd_read_reg);
179179

180+
/**
181+
* ad_sd_reset() - Reset the serial interface
182+
*
183+
* @sigma_delta: The sigma delta device
184+
* @reset_length: Number of SCLKs with DIN = 1
185+
*
186+
* Returns 0 on success, an error code otherwise.
187+
**/
188+
int ad_sd_reset(struct ad_sigma_delta *sigma_delta,
189+
unsigned int reset_length)
190+
{
191+
uint8_t *buf;
192+
unsigned int size;
193+
int ret;
194+
195+
size = DIV_ROUND_UP(reset_length, 8);
196+
buf = kcalloc(size, sizeof(*buf), GFP_KERNEL);
197+
if (!buf)
198+
return -ENOMEM;
199+
200+
memset(buf, 0xff, size);
201+
ret = spi_write(sigma_delta->spi, buf, size);
202+
kfree(buf);
203+
204+
return ret;
205+
}
206+
EXPORT_SYMBOL_GPL(ad_sd_reset);
207+
180208
static int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
181209
unsigned int mode, unsigned int channel)
182210
{

drivers/iio/adc/mcp320x.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* MCP3204
1818
* MCP3208
1919
* ------------
20+
* 13 bit converter
21+
* MCP3301
2022
*
2123
* Datasheet can be found here:
2224
* http://ww1.microchip.com/downloads/en/DeviceDoc/21293C.pdf mcp3001
@@ -96,7 +98,7 @@ static int mcp320x_channel_to_tx_data(int device_index,
9698
}
9799

98100
static int mcp320x_adc_conversion(struct mcp320x *adc, u8 channel,
99-
bool differential, int device_index)
101+
bool differential, int device_index, int *val)
100102
{
101103
int ret;
102104

@@ -117,19 +119,25 @@ static int mcp320x_adc_conversion(struct mcp320x *adc, u8 channel,
117119

118120
switch (device_index) {
119121
case mcp3001:
120-
return (adc->rx_buf[0] << 5 | adc->rx_buf[1] >> 3);
122+
*val = (adc->rx_buf[0] << 5 | adc->rx_buf[1] >> 3);
123+
return 0;
121124
case mcp3002:
122125
case mcp3004:
123126
case mcp3008:
124-
return (adc->rx_buf[0] << 2 | adc->rx_buf[1] >> 6);
127+
*val = (adc->rx_buf[0] << 2 | adc->rx_buf[1] >> 6);
128+
return 0;
125129
case mcp3201:
126-
return (adc->rx_buf[0] << 7 | adc->rx_buf[1] >> 1);
130+
*val = (adc->rx_buf[0] << 7 | adc->rx_buf[1] >> 1);
131+
return 0;
127132
case mcp3202:
128133
case mcp3204:
129134
case mcp3208:
130-
return (adc->rx_buf[0] << 4 | adc->rx_buf[1] >> 4);
135+
*val = (adc->rx_buf[0] << 4 | adc->rx_buf[1] >> 4);
136+
return 0;
131137
case mcp3301:
132-
return sign_extend32((adc->rx_buf[0] & 0x1f) << 8 | adc->rx_buf[1], 12);
138+
*val = sign_extend32((adc->rx_buf[0] & 0x1f) << 8
139+
| adc->rx_buf[1], 12);
140+
return 0;
133141
default:
134142
return -EINVAL;
135143
}
@@ -150,12 +158,10 @@ static int mcp320x_read_raw(struct iio_dev *indio_dev,
150158
switch (mask) {
151159
case IIO_CHAN_INFO_RAW:
152160
ret = mcp320x_adc_conversion(adc, channel->address,
153-
channel->differential, device_index);
154-
161+
channel->differential, device_index, val);
155162
if (ret < 0)
156163
goto out;
157164

158-
*val = ret;
159165
ret = IIO_VAL_INT;
160166
break;
161167

@@ -304,6 +310,7 @@ static int mcp320x_probe(struct spi_device *spi)
304310
indio_dev->name = spi_get_device_id(spi)->name;
305311
indio_dev->modes = INDIO_DIRECT_MODE;
306312
indio_dev->info = &mcp320x_info;
313+
spi_set_drvdata(spi, indio_dev);
307314

308315
chip_info = &mcp320x_chip_infos[spi_get_device_id(spi)->driver_data];
309316
indio_dev->channels = chip_info->channels;

drivers/iio/adc/twl4030-madc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
866866

867867
/* Enable 3v1 bias regulator for MADC[3:6] */
868868
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
869-
if (IS_ERR(madc->usb3v1))
870-
return -ENODEV;
869+
if (IS_ERR(madc->usb3v1)) {
870+
ret = -ENODEV;
871+
goto err_i2c;
872+
}
871873

872874
ret = regulator_enable(madc->usb3v1);
873875
if (ret)
@@ -876,11 +878,13 @@ static int twl4030_madc_probe(struct platform_device *pdev)
876878
ret = iio_device_register(iio_dev);
877879
if (ret) {
878880
dev_err(&pdev->dev, "could not register iio device\n");
879-
goto err_i2c;
881+
goto err_usb3v1;
880882
}
881883

882884
return 0;
883885

886+
err_usb3v1:
887+
regulator_disable(madc->usb3v1);
884888
err_i2c:
885889
twl4030_madc_set_current_generator(madc, 0, 0);
886890
err_current_generator:

0 commit comments

Comments
 (0)