linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pinmux 1/2] csv-to-board: handle missing gpio_init_vals
@ 2015-07-21 22:30 Stephen Warren
       [not found] ` <1437517833-721-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2015-07-21 22:30 UTC (permalink / raw)
  To: swarren-DDmLM1+adcrQT0dZR+AlfA; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Some board spreadsheets have missing values in the gpio_init_val column.
This occurs to handle initialization ordering quirks in downstream SW.
Modify csv-to-board to handle such spreadsheets without throwing an
error, but warn the user that they need to fix up the resultant config
file with valid data.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 csv-to-board.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/csv-to-board.py b/csv-to-board.py
index 60493465bfac..1d98cfa74a7a 100755
--- a/csv-to-board.py
+++ b/csv-to-board.py
@@ -159,8 +159,13 @@ def e_input_munge(d):
         'ENABLE': True,
     }[d]
 
+warn_empty_gpio_init_val = False
 def gpio_init_val_munge(d):
+    global warn_empty_gpio_init_val
+    if d == '':
+        warn_empty_gpio_init_val = True
     return {
+        '': 'out?',
         '0': 'out0',
         '1': 'out1',
     }[d]
@@ -326,3 +331,6 @@ with open(cfgfile, 'wt') as fh:
     print('mipi_pad_ctrl_groups = (', file=fh)
     dump_py_table(mipi_headings, mipi_table, file=fh)
     print(')', file=fh)
+
+if warn_empty_gpio_init_val:
+    print('WARNING: Missing gpio_init_vals detected. Manual fixup required', file=sys.stderr)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [pinmux 2/2] csv-to-board: allow 'Ball Name' in an abitrary column
       [not found] ` <1437517833-721-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2015-07-21 22:30   ` Stephen Warren
  2015-07-22 19:15   ` [pinmux 1/2] csv-to-board: handle missing gpio_init_vals Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2015-07-21 22:30 UTC (permalink / raw)
  To: swarren-DDmLM1+adcrQT0dZR+AlfA; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

csv-to-board currently parses the header row to find out which column
each desired piece of data is located in. However, it checks a hard-coded
column to determine which row is the header row. Enhance the script to
allow the header row identification data to be in an arbitrary column.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 csv-to-board.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/csv-to-board.py b/csv-to-board.py
index 1d98cfa74a7a..2f99f4afa48f 100755
--- a/csv-to-board.py
+++ b/csv-to-board.py
@@ -193,7 +193,7 @@ with open(board_conf['filename'], newline='') as fh:
 
         # Header rows
         if not found_header:
-            if row[0] != 'Ball Name':
+            if 'Ball Name' not in row:
                 if lnum > 25:
                     print('ERROR: Header row not found', file=sys.stderr)
                     sys.exit(1)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [pinmux 1/2] csv-to-board: handle missing gpio_init_vals
       [not found] ` <1437517833-721-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2015-07-21 22:30   ` [pinmux 2/2] csv-to-board: allow 'Ball Name' in an abitrary column Stephen Warren
@ 2015-07-22 19:15   ` Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2015-07-22 19:15 UTC (permalink / raw)
  To: swarren-DDmLM1+adcrQT0dZR+AlfA; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 07/21/2015 04:30 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Some board spreadsheets have missing values in the gpio_init_val column.
> This occurs to handle initialization ordering quirks in downstream SW.
> Modify csv-to-board to handle such spreadsheets without throwing an
> error, but warn the user that they need to fix up the resultant config
> file with valid data.

I've applied the series.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-22 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 22:30 [pinmux 1/2] csv-to-board: handle missing gpio_init_vals Stephen Warren
     [not found] ` <1437517833-721-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-07-21 22:30   ` [pinmux 2/2] csv-to-board: allow 'Ball Name' in an abitrary column Stephen Warren
2015-07-22 19:15   ` [pinmux 1/2] csv-to-board: handle missing gpio_init_vals Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).