-
Notifications
You must be signed in to change notification settings - Fork 908
iio: ad6676: Fix default attenuation value #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The reset value of the attenuation is according to the datasheet 12 dB but pdata->base.attenuation was incorrectly set to 0. Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
| return -EINVAL; | ||
| } | ||
|
|
||
| phy->pdata->base.attenuation = 0x0C; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just curious, shouldn't this information be retrieved from the devicetree? Just like the other members of the pdata->base field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also argue the other way that the base data shouldn't be part of the platform data since it is not part of the hardware description. It's application configuration data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could consider a later update of the driver that handles this as config data.
For now this should be fine.
|
I apologize for closing this issue, I accidentally pressed the wrong button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Will merge this later today if no objections
…-for-cachestat-validation-checkpatch-fixes ERROR: "foo* bar" should be "foo *bar" #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: open brace '{' following function definitions go on the next line #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: switch and case should be at the same indent #42: FILE: tools/testing/selftests/cachestat/test_cachestat.c:210: + switch (type) { + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required after that ',' (ctx:VxV) #72: FILE: tools/testing/selftests/cachestat/test_cachestat.c:239: + ksft_print_msg("Unable to create %s file.\n",file_type_str(type)); ^ ERROR: space required after that ',' (ctx:VxV) #79: FILE: tools/testing/selftests/cachestat/test_cachestat.c:245: + ksft_print_msg("Unable to truncate %s file.\n",file_type_str(type)); ^ ERROR: switch and case should be at the same indent #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required before the open brace '{' #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ WARNING: Missing a blank line after declarations #98: FILE: tools/testing/selftests/cachestat/test_cachestat.c:259: + char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (map == MAP_FAILED) { WARNING: braces {} are not necessary for single statement blocks #103: FILE: tools/testing/selftests/cachestat/test_cachestat.c:264: + for (int i = 0; i < filesize; i++) { + map[i] = 'A'; + } WARNING: break is not useful after a goto #111: FILE: tools/testing/selftests/cachestat/test_cachestat.c:272: + goto close_fd; + break; total: 7 errors, 3 warnings, 108 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joshua Hahn <joshua.hahnjy@gmail.com> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suresh K C <suresh.k.chandrappa@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
…-for-cachestat-validation-checkpatch-fixes ERROR: "foo* bar" should be "foo *bar" #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: open brace '{' following function definitions go on the next line #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: switch and case should be at the same indent #42: FILE: tools/testing/selftests/cachestat/test_cachestat.c:210: + switch (type) { + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required after that ',' (ctx:VxV) #72: FILE: tools/testing/selftests/cachestat/test_cachestat.c:239: + ksft_print_msg("Unable to create %s file.\n",file_type_str(type)); ^ ERROR: space required after that ',' (ctx:VxV) #79: FILE: tools/testing/selftests/cachestat/test_cachestat.c:245: + ksft_print_msg("Unable to truncate %s file.\n",file_type_str(type)); ^ ERROR: switch and case should be at the same indent #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required before the open brace '{' #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ WARNING: Missing a blank line after declarations #98: FILE: tools/testing/selftests/cachestat/test_cachestat.c:259: + char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (map == MAP_FAILED) { WARNING: braces {} are not necessary for single statement blocks #103: FILE: tools/testing/selftests/cachestat/test_cachestat.c:264: + for (int i = 0; i < filesize; i++) { + map[i] = 'A'; + } WARNING: break is not useful after a goto #111: FILE: tools/testing/selftests/cachestat/test_cachestat.c:272: + goto close_fd; + break; total: 7 errors, 3 warnings, 108 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joshua Hahn <joshua.hahnjy@gmail.com> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suresh K C <suresh.k.chandrappa@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
…-for-cachestat-validation-checkpatch-fixes ERROR: "foo* bar" should be "foo *bar" #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: open brace '{' following function definitions go on the next line #41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209: +const char* file_type_str(enum file_type type) { ERROR: switch and case should be at the same indent #42: FILE: tools/testing/selftests/cachestat/test_cachestat.c:210: + switch (type) { + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required after that ',' (ctx:VxV) #72: FILE: tools/testing/selftests/cachestat/test_cachestat.c:239: + ksft_print_msg("Unable to create %s file.\n",file_type_str(type)); ^ ERROR: space required after that ',' (ctx:VxV) #79: FILE: tools/testing/selftests/cachestat/test_cachestat.c:245: + ksft_print_msg("Unable to truncate %s file.\n",file_type_str(type)); ^ ERROR: switch and case should be at the same indent #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ + case FILE_SHMEM: [...] + case FILE_MMAP: [...] + default: ERROR: space required before the open brace '{' #88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249: + switch (type){ WARNING: Missing a blank line after declarations #98: FILE: tools/testing/selftests/cachestat/test_cachestat.c:259: + char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (map == MAP_FAILED) { WARNING: braces {} are not necessary for single statement blocks #103: FILE: tools/testing/selftests/cachestat/test_cachestat.c:264: + for (int i = 0; i < filesize; i++) { + map[i] = 'A'; + } WARNING: break is not useful after a goto #111: FILE: tools/testing/selftests/cachestat/test_cachestat.c:272: + goto close_fd; + break; total: 7 errors, 3 warnings, 108 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joshua Hahn <joshua.hahnjy@gmail.com> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Suresh K C <suresh.k.chandrappa@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
The reset value of the attenuation is according to the datasheet 12 dB
but pdata->base.attenuation was incorrectly set to 0.
Signed-off-by: Dragos Bogdan dragos.bogdan@analog.com