--- /dev/null
+From d1d787bcebfe122a5bd443ae565696661e2e9656 Mon Sep 17 00:00:00 2001
+From: Corentin Labbe <clabbe.montjoie@gmail.com>
+Date: Thu, 14 Nov 2019 13:58:49 +0100
+Subject: crypto: sun4i-ss - fix big endian issues
+
+From: Corentin Labbe <clabbe.montjoie@gmail.com>
+
+commit d1d787bcebfe122a5bd443ae565696661e2e9656 upstream.
+
+When testing BigEndian kernel, the sun4i-ss was failling all crypto
+tests.
+This patch fix endian issues with it.
+
+Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
+Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
++++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
+@@ -179,7 +179,7 @@ static int sun4i_hash(struct ahash_reque
+ */
+ unsigned int i = 0, end, fill, min_fill, nwait, nbw = 0, j = 0, todo;
+ unsigned int in_i = 0;
+- u32 spaces, rx_cnt = SS_RX_DEFAULT, bf[32] = {0}, wb = 0, v, ivmode = 0;
++ u32 spaces, rx_cnt = SS_RX_DEFAULT, bf[32] = {0}, v, ivmode = 0;
+ struct sun4i_req_ctx *op = ahash_request_ctx(areq);
+ struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
+ struct sun4i_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
+@@ -188,6 +188,7 @@ static int sun4i_hash(struct ahash_reque
+ struct sg_mapping_iter mi;
+ int in_r, err = 0;
+ size_t copied = 0;
++ __le32 wb = 0;
+
+ dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x",
+ __func__, crypto_tfm_alg_name(areq->base.tfm),
+@@ -399,7 +400,7 @@ hash_final:
+
+ nbw = op->len - 4 * nwait;
+ if (nbw) {
+- wb = *(u32 *)(op->buf + nwait * 4);
++ wb = cpu_to_le32(*(u32 *)(op->buf + nwait * 4));
+ wb &= GENMASK((nbw * 8) - 1, 0);
+
+ op->byte_count += nbw;
+@@ -408,7 +409,7 @@ hash_final:
+
+ /* write the remaining bytes of the nbw buffer */
+ wb |= ((1 << 7) << (nbw * 8));
+- bf[j++] = wb;
++ bf[j++] = le32_to_cpu(wb);
+
+ /*
+ * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)
+@@ -427,13 +428,13 @@ hash_final:
+
+ /* write the length of data */
+ if (op->mode == SS_OP_SHA1) {
+- __be64 bits = cpu_to_be64(op->byte_count << 3);
+- bf[j++] = lower_32_bits(bits);
+- bf[j++] = upper_32_bits(bits);
++ __be64 *bits = (__be64 *)&bf[j];
++ *bits = cpu_to_be64(op->byte_count << 3);
++ j += 2;
+ } else {
+- __le64 bits = op->byte_count << 3;
+- bf[j++] = lower_32_bits(bits);
+- bf[j++] = upper_32_bits(bits);
++ __le64 *bits = (__le64 *)&bf[j];
++ *bits = cpu_to_le64(op->byte_count << 3);
++ j += 2;
+ }
+ writesl(ss->base + SS_RXFIFO, bf, j);
+
+@@ -475,7 +476,7 @@ hash_final:
+ }
+ } else {
+ for (i = 0; i < 4; i++) {
+- v = readl(ss->base + SS_MD0 + i * 4);
++ v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4));
+ memcpy(areq->result + i * 4, &v, 4);
+ }
+ }
--- /dev/null
+From a2cafdfd8cf5ad8adda6c0ce44a59f46431edf02 Mon Sep 17 00:00:00 2001
+From: Jean-Jacques Hiblot <jjhiblot@ti.com>
+Date: Mon, 23 Sep 2019 12:02:50 +0200
+Subject: leds: tlc591xx: update the maximum brightness
+
+From: Jean-Jacques Hiblot <jjhiblot@ti.com>
+
+commit a2cafdfd8cf5ad8adda6c0ce44a59f46431edf02 upstream.
+
+The TLC chips actually offer 257 levels:
+- 0: led OFF
+- 1-255: Led dimmed is using a PWM. The duty cycle range from 0.4% to 99.6%
+- 256: led fully ON
+
+Fixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c LED driver")
+Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
+Signed-off-by: Pavel Machek <pavel@ucw.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/leds/leds-tlc591xx.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/leds/leds-tlc591xx.c
++++ b/drivers/leds/leds-tlc591xx.c
+@@ -16,6 +16,7 @@
+ #include <linux/slab.h>
+
+ #define TLC591XX_MAX_LEDS 16
++#define TLC591XX_MAX_BRIGHTNESS 256
+
+ #define TLC591XX_REG_MODE1 0x00
+ #define MODE1_RESPON_ADDR_MASK 0xF0
+@@ -115,11 +116,11 @@ tlc591xx_brightness_set(struct led_class
+ struct tlc591xx_priv *priv = led->priv;
+ int err;
+
+- switch (brightness) {
++ switch ((int)brightness) {
+ case 0:
+ err = tlc591xx_set_ledout(priv, led, LEDOUT_OFF);
+ break;
+- case LED_FULL:
++ case TLC591XX_MAX_BRIGHTNESS:
+ err = tlc591xx_set_ledout(priv, led, LEDOUT_ON);
+ break;
+ default:
+@@ -160,7 +161,7 @@ tlc591xx_configure(struct device *dev,
+ led->priv = priv;
+ led->led_no = i;
+ led->ldev.brightness_set_blocking = tlc591xx_brightness_set;
+- led->ldev.max_brightness = LED_FULL;
++ led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
+ err = led_classdev_register(dev, &led->ldev);
+ if (err < 0) {
+ dev_err(dev, "couldn't register LED %s\n",