I've followed instructions from http://www.circuitbasics.com/setup-lcd-touchscreen-raspberry-pi/#content.
But use flexfb device instead of waveshare32b. You may keep the configuration of touch device, but have to calibrate it or rotate screen to keep it as is.
Add modules in /etc/modules as below:
flexfb width=480 height=320 regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3
fbtft_device debug=3 rotate=0 name=flexfb speed=16000000 gpios=reset:25,dc:24
Changing screen rotation is a bit tricky but possible. You have to modify value of register 0x36 at the end of init string (value 0x28 just after 0x36). In the example above there is 0x28, as well as rotate=0 below. This is for horizontal screen with power socket on upper side, touch inverted.
You can try these combinations:
Reg 0x36 value | rotate value | result
0x28 | 0 | Horizontal (power socket on top)
0xF8 | 0 | Horizontal (power socket on bottom side), touch works well
0x48 | 90 | Vertical
0x84 | 90 | Vertical (opposite)
Above values are found by testing, may not be the best settings but works :)
This is my /boot/cmdline.txt file:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbtft_device.custom fbtft_device.name=flexfb fbtft_device.gpios=dc:24,reset:25 fbtft_device.bgr=1 fbtft_device.speed=16000000 fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo dma.dmachans=0x7f35 console=tty1 consoleblank=0 fbtft_device.fps=50 fbtft_device.rotate=0
Note: The Noobs distribution of Raspbian installs the root filesystem to logical partition p6 rather than the second primary partition p2. The above change to /boot/cmdline.txt assumes the filesystem is on p2. If you are using Noobs and you get a kernel panic following reboot after this change, log in using Recovery Mode and edit the line above changing root=/dev/mmcblk0p2 to root=/dev/mmcblk0p6.
and my /etc/modules entry for touch device:
ads7846_device model=7846 cs=1 gpio_pendown=17 speed=1000000 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900
Full thread can be found there https://github.com/notro/fbtft/issues/215