samsung-a5y17lte: kconfig: add muic debug option (!556)

Some Samsung muic's have debug possibility, but seems kernel config
option for that was deleted. Muic debug can be useful for attaching UART
cable to phone.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Dzmitry Sankouski 2019-08-15 22:21:10 +03:00 committed by Oliver Smith
parent 6afffe73e1
commit 4c48457589
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 203 additions and 2 deletions

View file

@ -3,7 +3,7 @@
pkgname="linux-samsung-a5y17lte" pkgname="linux-samsung-a5y17lte"
pkgver=3.18.14 pkgver=3.18.14
pkgrel=1 pkgrel=2
pkgdesc="Samsung Galaxy A5 (2017) kernel fork" pkgdesc="Samsung Galaxy A5 (2017) kernel fork"
arch="aarch64" arch="aarch64"
_carch="arm64" _carch="arm64"
@ -29,6 +29,7 @@ source="
gcc8-fix-put-user.patch gcc8-fix-put-user.patch
0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
disable_knox.patch disable_knox.patch
debug_muic.patch
" "
builddir="$srcdir/${_repository}-${_commit}" builddir="$srcdir/${_repository}-${_commit}"
@ -75,4 +76,5 @@ sha512sums="96794c6c5c91375a0110906c512644ccfb7c1d1f6e9275a0807e123bd8d02c930478
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch 197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
b5f7aed0d4c78fcd9ea6f65e11606c4d33004b45eed39017baa8b0a78db801396aa04ba7cd3a4a669c23f878f5462ae1b5f753e0e26b65c9962fd1e98855e524 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch b5f7aed0d4c78fcd9ea6f65e11606c4d33004b45eed39017baa8b0a78db801396aa04ba7cd3a4a669c23f878f5462ae1b5f753e0e26b65c9962fd1e98855e524 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
0ed3a870c33728b5337261770e8e8ea3d4135235339407d7e4d070d2f6aef5a866ad2012451b75aeeb813bd7d514c959d49d2f31a93ce95c0dbfc03275328a33 disable_knox.patch" 0ed3a870c33728b5337261770e8e8ea3d4135235339407d7e4d070d2f6aef5a866ad2012451b75aeeb813bd7d514c959d49d2f31a93ce95c0dbfc03275328a33 disable_knox.patch
fefc6dde6c74201e2862b998a1e9a75cc0f71a7921383c99cf058f8fec53e278abb1cc40fc1fc6e532cf60e4a6670123129de60cc59e64057856769e1612edd1 debug_muic.patch"

View file

@ -0,0 +1,199 @@
diff --git a/drivers/muic/Kconfig b/drivers/muic/Kconfig
index 66873fc853d..1741eee5a14 100755
--- a/drivers/muic/Kconfig
+++ b/drivers/muic/Kconfig
@@ -12,6 +12,13 @@ config USE_MUIC
If you say yes here you will get support for
the MUIC device driver.
+config DEBUG_MUIC
+ bool "Enable MUIC debug"
+ depends on SAMSUNG_MUIC
+ default n
+ help
+ If you say yes here you will get debug info from your muic.
+
config USE_SAFEOUT
bool "Using SAFEOUT device driver"
depends on I2C
diff --git a/drivers/muic/s2mm001.c b/drivers/muic/s2mm001.c
index 15107098f4b..cf43d5f8bfa 100755
--- a/drivers/muic/s2mm001.c
+++ b/drivers/muic/s2mm001.c
@@ -37,9 +37,9 @@
#include <linux/muic/muic_notifier.h>
#endif /* CONFIG_MUIC_NOTIFIER */
-#define DEBUG_MUIC
+#define CONFIG_DEBUG_MUIC
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
#define MAX_LOG 25
#define READ 0
@@ -164,7 +164,7 @@ static int s2mm001_i2c_read_byte(const struct i2c_client *client, u8 command)
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mm001_reg_log(command, ret, retry << 1 | READ);
#endif
return ret;
@@ -187,7 +187,7 @@ static int s2mm001_i2c_write_byte(const struct i2c_client *client,
ret = i2c_smbus_write_byte_data(client, command, value);
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mm001_reg_log(command, value, retry << 1 | WRITE);
#endif
return ret;
@@ -490,7 +490,7 @@ static ssize_t s2mm001_muic_show_usb_state(struct device *dev,
return 0;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static ssize_t s2mm001_muic_show_mansw1(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -729,7 +729,7 @@ static DEVICE_ATTR(uart_sel, 0664, s2mm001_muic_show_uart_sel,
static DEVICE_ATTR(usb_sel, 0664,
s2mm001_muic_show_usb_sel, s2mm001_muic_set_usb_sel);
static DEVICE_ATTR(adc, 0664, s2mm001_muic_show_adc, NULL);
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static DEVICE_ATTR(mansw1, 0664, s2mm001_muic_show_mansw1, NULL);
static DEVICE_ATTR(mansw2, 0664, s2mm001_muic_show_mansw2, NULL);
static DEVICE_ATTR(dump_registers, 0664, s2mm001_muic_show_registers, NULL);
@@ -755,7 +755,7 @@ static struct attribute *s2mm001_muic_attributes[] = {
&dev_attr_uart_sel.attr,
&dev_attr_usb_sel.attr,
&dev_attr_adc.attr,
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
&dev_attr_mansw1.attr,
&dev_attr_mansw2.attr,
&dev_attr_dump_registers.attr,
diff --git a/drivers/muic/s2mu004-muic.c b/drivers/muic/s2mu004-muic.c
index 577a3e87c76..1a4c98ff3c3 100755
--- a/drivers/muic/s2mu004-muic.c
+++ b/drivers/muic/s2mu004-muic.c
@@ -97,7 +97,7 @@ static int s2mu004_i2c_write_byte(struct i2c_client *client,
static bool s2mu004_get_ccic_cable_state(struct s2mu004_muic_data *muic_data);
#endif
-#if defined(DEBUG_MUIC)
+#if defined(CONFIG_DEBUG_MUIC)
#define MAX_LOG 25
#define READ 0
#define WRITE 1
@@ -186,7 +186,7 @@ static int s2mu004_i2c_read_byte(struct i2c_client *client, u8 command)
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mu004_reg_log(command, ret, retry << 1 | READ);
#endif
return ret;
@@ -211,7 +211,7 @@ static int s2mu004_i2c_write_byte(struct i2c_client *client,
ret = s2mu004_write_reg(client, command, value);
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mu004_reg_log(command, value, retry << 1 | WRITE);
#endif
return ret;
@@ -698,7 +698,7 @@ static ssize_t s2mu004_muic_show_usb_state(struct device *dev,
return 0;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static ssize_t s2mu004_muic_show_mansw(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -1159,7 +1159,7 @@ static ssize_t muic_store_afc_set_voltage(struct device *dev,
static DEVICE_ATTR(uart_en, 0664, s2mu004_muic_show_uart_en,
s2mu004_muic_set_uart_en);
static DEVICE_ATTR(adc, 0664, s2mu004_muic_show_adc, NULL);
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static DEVICE_ATTR(mansw, 0664, s2mu004_muic_show_mansw, NULL);
static DEVICE_ATTR(dump_registers, 0664, s2mu004_muic_show_registers, NULL);
static DEVICE_ATTR(int_status, 0664, s2mu004_muic_show_interrupt_status, NULL);
@@ -1192,7 +1192,7 @@ static DEVICE_ATTR(afc_set_voltage, 0220,
static struct attribute *s2mu004_muic_attributes[] = {
&dev_attr_uart_en.attr,
&dev_attr_adc.attr,
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
&dev_attr_mansw.attr,
&dev_attr_dump_registers.attr,
&dev_attr_int_status.attr,
diff --git a/drivers/muic/s2mu005-muic.c b/drivers/muic/s2mu005-muic.c
index c3b89b3612d..b53f54cd3d8 100755
--- a/drivers/muic/s2mu005-muic.c
+++ b/drivers/muic/s2mu005-muic.c
@@ -54,10 +54,10 @@ static void s2mu005_muic_handle_detach(struct s2mu005_muic_data *muic_data);
static int set_manual_sw(struct s2mu005_muic_data *muic_data, bool on);
/*
-#define DEBUG_MUIC
+#define CONFIG_DEBUG_MUIC
*/
-#if defined(DEBUG_MUIC)
+#if defined(CONFIG_DEBUG_MUIC)
#define MAX_LOG 25
#define READ 0
#define WRITE 1
@@ -150,7 +150,7 @@ static int s2mu005_i2c_read_byte(struct i2c_client *client, u8 command)
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mu005_reg_log(command, ret, retry << 1 | READ);
#endif
return ret;
@@ -175,7 +175,7 @@ static int s2mu005_i2c_write_byte(struct i2c_client *client,
ret = s2mu005_write_reg(client, command, value);
retry++;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
s2mu005_reg_log(command, value, retry << 1 | WRITE);
#endif
return ret;
@@ -463,7 +463,7 @@ static ssize_t s2mu005_muic_show_usb_state(struct device *dev,
return 0;
}
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static ssize_t s2mu005_muic_show_mansw(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -686,7 +686,7 @@ static ssize_t s2mu005_muic_set_apo_factory(struct device *dev,
static DEVICE_ATTR(uart_en, 0664, s2mu005_muic_show_uart_en,
s2mu005_muic_set_uart_en);
static DEVICE_ATTR(adc, 0664, s2mu005_muic_show_adc, NULL);
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
static DEVICE_ATTR(mansw, 0664, s2mu005_muic_show_mansw, NULL);
static DEVICE_ATTR(dump_registers, 0664, s2mu005_muic_show_registers, NULL);
static DEVICE_ATTR(int_status, 0664, s2mu005_muic_show_interrupt_status, NULL);
@@ -709,7 +709,7 @@ static DEVICE_ATTR(usb_en, 0664,
static struct attribute *s2mu005_muic_attributes[] = {
&dev_attr_uart_en.attr,
&dev_attr_adc.attr,
-#ifdef DEBUG_MUIC
+#ifdef CONFIG_DEBUG_MUIC
&dev_attr_mansw.attr,
&dev_attr_dump_registers.attr,
&dev_attr_int_status.attr,