Accelerometer and orientation

On Android, accelerometer values read using SDL_JoystickGetAxis seem automatically to compensate for the orientation, so for example the returned x-axis value is approximately zero when the device is ‘level’, whether in portrait or landscape. On iOS however this doesn’t happen, so the x-axis value is near zero when the device is in portrait orientation, but about 6000 when ‘level’ in landscape.

I don’t know whether this difference is down to SDL or the OS, but it’s making it difficult to achieve compatibility. I could attempt to compensate in my code if I knew what the ‘normal’ orientation was (i.e. portrait for a phone, landscape for a tablet) but how would I discover that in SDL?