+ goto out;
+ }
+ break;
+ case 'l':
+ log_level = atoi(optarg);
+ if (log_level < AM7XXX_LOG_FATAL || log_level > AM7XXX_LOG_TRACE) {
+ fprintf(stderr, "Unsupported log level, falling back to AM7XXX_LOG_ERROR\n");
+ log_level = AM7XXX_LOG_ERROR;
+ }
+ break;
+ case 'p':
+ power_mode = atoi(optarg);
+ switch(power_mode) {
+ case AM7XXX_POWER_OFF:
+ case AM7XXX_POWER_LOW:
+ case AM7XXX_POWER_MIDDLE:
+ case AM7XXX_POWER_HIGH:
+ case AM7XXX_POWER_TURBO:
+ fprintf(stdout, "Power mode: %d\n", power_mode);
+ break;
+ default:
+ fprintf(stderr, "Invalid power mode value, must be between %d and %d\n",
+ AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
+ ret = -EINVAL;
+ goto out;
+ }
+ break;
+ case 'z':
+ zoom = atoi(optarg);
+ switch(zoom) {
+ case AM7XXX_ZOOM_ORIGINAL:
+ case AM7XXX_ZOOM_H:
+ case AM7XXX_ZOOM_H_V:
+ case AM7XXX_ZOOM_TEST:
+ case AM7XXX_ZOOM_TELE:
+ fprintf(stdout, "Zoom: %d\n", zoom);
+ break;
+ default:
+ fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
+ AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TELE);
+ ret = -EINVAL;
+ goto out;