Meanwhile, in the UK: https://www.hcsolicitors.co.uk/news/giving-the-police-your-p... If a judge authorises a notice, under RIPA, you can be served a 2 year sentence for failing to disclose your phone's passcode.
This particular case is different because the police did not get a warrant and instead just asked the guy to disclose (without a warrant), which he refused to do, then they tried to use that against the guy in court, which is a violation of the US constitution.