Re: [RFC PATCH 2/3] radio-keene: add a driver for the Keene FM Transmitter.
From: Oliver Neukum <hidden>
Date: 2012-01-16 13:09:31
Also in:
linux-media
From: Oliver Neukum <hidden>
Date: 2012-01-16 13:09:31
Also in:
linux-media
Am Montag, 16. Januar 2012, 14:02:05 schrieb Hans Verkuil:
quoted
quoted
+/* Set frequency (if non-0), PA, mute and turn on/off the FM transmitter. */ +static int keene_cmd_main(struct keene_device *radio, unsigned freq, bool play) +{ + unsigned short freq_send = freq ? (freq - 76 * 16000) / 800 : 0; + int ret; + + radio->buffer[0] = 0x00; + radio->buffer[1] = 0x50; + radio->buffer[2] = (freq_send >> 8) & 0xff; + radio->buffer[3] = freq_send & 0xff;Please use the endianness macro appropriate hereI don't see any endianness issues here, but perhaps I missed something.
You are doing the endianness conversion by hand. We have a nice macro for that that assures that special swapping cpu instructions will be used. Regards Oliver